Commit cc21e5b8 authored by lujunye's avatar lujunye

打印界面大致完成

parent 6a9ab706
......@@ -408,6 +408,10 @@
E0E341EB246E95EE0060AC20 /* PingLunCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0E341E9246E95EE0060AC20 /* PingLunCell.xib */; };
E0E4456924B00F7B00EF788E /* LogisticsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0E4456824B00F7B00EF788E /* LogisticsModel.swift */; };
E0E4456B24B0221500EF788E /* LogisticsInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0E4456A24B0221500EF788E /* LogisticsInterface.swift */; };
E0E5604F25C167220004BA56 /* Print_Gprinter_View.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0E5604E25C167220004BA56 /* Print_Gprinter_View.swift */; };
E0E5605425C1672E0004BA56 /* Print_Gprinter_View.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0E5605325C1672E0004BA56 /* Print_Gprinter_View.xib */; };
E0E5605A25C169E30004BA56 /* GPrinter_Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0E5605825C169E30004BA56 /* GPrinter_Cell.swift */; };
E0E5605B25C169E30004BA56 /* GPrinter_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0E5605925C169E30004BA56 /* GPrinter_Cell.xib */; };
E0E7CB6124C17B9F00A26D3F /* GLKHCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0E7CB5F24C17B9F00A26D3F /* GLKHCell.swift */; };
E0E7CB6224C17B9F00A26D3F /* GLKHCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0E7CB6024C17B9F00A26D3F /* GLKHCell.xib */; };
E0E8ABFD246E359700E3BB54 /* GuiGeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0E8ABFC246E359700E3BB54 /* GuiGeModel.swift */; };
......@@ -1141,6 +1145,10 @@
E0E341E9246E95EE0060AC20 /* PingLunCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PingLunCell.xib; sourceTree = "<group>"; };
E0E4456824B00F7B00EF788E /* LogisticsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogisticsModel.swift; sourceTree = "<group>"; };
E0E4456A24B0221500EF788E /* LogisticsInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogisticsInterface.swift; sourceTree = "<group>"; };
E0E5604E25C167220004BA56 /* Print_Gprinter_View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Print_Gprinter_View.swift; sourceTree = "<group>"; };
E0E5605325C1672E0004BA56 /* Print_Gprinter_View.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Print_Gprinter_View.xib; sourceTree = "<group>"; };
E0E5605825C169E30004BA56 /* GPrinter_Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GPrinter_Cell.swift; sourceTree = "<group>"; };
E0E5605925C169E30004BA56 /* GPrinter_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GPrinter_Cell.xib; sourceTree = "<group>"; };
E0E7CB5F24C17B9F00A26D3F /* GLKHCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GLKHCell.swift; sourceTree = "<group>"; };
E0E7CB6024C17B9F00A26D3F /* GLKHCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GLKHCell.xib; sourceTree = "<group>"; };
E0E8ABFC246E359700E3BB54 /* GuiGeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuiGeModel.swift; sourceTree = "<group>"; };
......@@ -2001,6 +2009,10 @@
E01313DF25C00496006CFA5D /* Add_Report_View.xib */,
E0974D6A25C140A600E3C86B /* S_Y_Detail_Vc.swift */,
E0974D6B25C140A600E3C86B /* S_Y_Detail_Vc.xib */,
E0E5604E25C167220004BA56 /* Print_Gprinter_View.swift */,
E0E5605325C1672E0004BA56 /* Print_Gprinter_View.xib */,
E0E5605825C169E30004BA56 /* GPrinter_Cell.swift */,
E0E5605925C169E30004BA56 /* GPrinter_Cell.xib */,
);
path = "溯源";
sourceTree = "<group>";
......@@ -3716,6 +3728,7 @@
F9A1D4AB255B7AF70018DA8A /* RetailManageHeaderView.xib in Resources */,
E00CBA0224820CF000701D9D /* CRKSumCell.xib in Resources */,
E0206335246CE45A007A40C4 /* HeaderOnlyTitleView.xib in Resources */,
E0E5605425C1672E0004BA56 /* Print_Gprinter_View.xib in Resources */,
E0B903CA259B11C20041EF62 /* FXSY_Detail_ViewController.xib in Resources */,
E0A409D524640B8300CFF109 /* DZGLViewController.xib in Resources */,
F95567A82453DA86009674AB /* WarehoseMangementListVC.xib in Resources */,
......@@ -3731,6 +3744,7 @@
E00D85EB244561FE00F5F816 /* LaunchScreen.storyboard in Resources */,
E0AD92EA2550E50500D82C17 /* GYS_FX_Product_VC.xib in Resources */,
E02FD9FB24557E8600E10E27 /* XinZengDiZhiViewController.xib in Resources */,
E0E5605B25C169E30004BA56 /* GPrinter_Cell.xib in Resources */,
E0B94624245671E100FBEC9A /* DaiKeXiaDanGouWuViewController.xib in Resources */,
F9023F722449ACA800DD5A63 /* TitleAndSwitchCell.xib in Resources */,
E08B0675244A98B2001D2E01 /* WareHouseSpCell.xib in Resources */,
......@@ -3960,6 +3974,7 @@
E0B94623245671E100FBEC9A /* DaiKeXiaDanGouWuViewController.swift in Sources */,
E0D11BD525C12C540066DB21 /* img_title_cell.swift in Sources */,
E0A320C52456D01300AF321C /* DaiKeXiaDanFooterView.swift in Sources */,
E0E5605A25C169E30004BA56 /* GPrinter_Cell.swift in Sources */,
E0336DD5244EC40000380BE9 /* CreatNewSpecsViewController.swift in Sources */,
F9531F3F2465108800724BEE /* JXPhotoBrowserNumberPageIndicator.swift in Sources */,
E0272A85259C2525008142BB /* FXYGL_ViewController.swift in Sources */,
......@@ -4112,6 +4127,7 @@
E07C2FFA24ECCD4D0043649B /* GLMessageAlertView.swift in Sources */,
E0A409D02464041200CFF109 /* ThirdCell.swift in Sources */,
F956D59F246A2D9C003FF510 /* LMNPhotoCollectionCell.m in Sources */,
E0E5604F25C167220004BA56 /* Print_Gprinter_View.swift in Sources */,
F950FDE424518B9500C40530 /* FSCalendarTransitionCoordinator.m in Sources */,
F9B6D9E12486890D00111698 /* MoreAndTimeSelectView.swift in Sources */,
E0BE8A90245A9B9600E80134 /* YingFuZhangKuanCell.swift in Sources */,
......
......@@ -116,21 +116,21 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo
@IBOutlet weak var gm_view: UIView!
@IBAction func ck_action(_ sender: UIButton) {
if typeSelect == nil {
HUD.flash(.label("请选择出库类型"),delay: 1.2)
return
}
if remark.count == 0 {
HUD.flash(.label("请填写备注"), delay: 1.2)
return
}
// if typeSelect == nil {
// HUD.flash(.label("请选择出库类型"),delay: 1.2)
// return
// }
// if remark.count == 0 {
// HUD.flash(.label("请填写备注"), delay: 1.2)
// return
// }
if rkSelectArr.count == 0 {
HUD.flash(.label("请选择出库商品"), delay: 1.2)
return
}
HUD.show(.progress)
var goodsInfoArr:Array<Any> = []
for i in 0 ..< rkSelectArr.count {
let item = rkSelectArr[i]
......@@ -172,27 +172,30 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo
]
goodsInfoArr.append(goods)
}
let dict = [
"user_token":UserToken as Any,
"o_type":typeSelect! + 1 as Any,
"audit_remark":remark as Any,
"goods_info":dataChangeString(sender: goodsInfoArr) as Any
]
if typeSelect != nil {
let dict = [
"user_token":UserToken as Any,
"o_type":typeSelect! + 1 as Any,
"audit_remark":remark as Any,
"goods_info":dataChangeString(sender: goodsInfoArr) as Any
]
}
if sender.tag == 1 {//打印
print("连接打印机")
let vc = Print_Gprinter_View(frame: self.view.bounds)
vc.rkSelectArr = rkSelectArr
vc.piCiArr = piCiArr
self.view.addSubview(vc)
return
}
GoodsOutput(dict, success: { (data) in
HUD.hide()
HUD.flash(.labeledSubSuccess(subtitle: "出库成功"), delay: 1.2)
self.navigationController?.popViewController(animated: true)
}) { (error) in
}
HUD.show(.progress)
// GoodsOutput(dict, success: { (data) in
// HUD.hide()
// HUD.flash(.labeledSubSuccess(subtitle: "出库成功"), delay: 1.2)
// self.navigationController?.popViewController(animated: true)
// }) { (error) in
//
// }
}
@IBOutlet weak var btmBtn: LGButton!
@IBOutlet weak var btmLbl: UILabel!
......
//
// GPrinter_Cell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2021/1/27.
// Copyright © 2021 junye lu. All rights reserved.
//
import UIKit
protocol GPrinter_Cell_Delegate {
func GPrinter_Cell_select_item(selects:Array<Int>,cell:GPrinter_Cell)
}
class GPrinter_Cell: UITableViewCell {
var delegate:GPrinter_Cell_Delegate?
@IBOutlet weak var title_lbl_3: UILabel!
@IBOutlet weak var title_lbl_2: UILabel!
@IBOutlet weak var title_lbl_1: UILabel!
@IBAction func select_all(_ sender: UIButton) {
all_select_btn.isSelected = !all_select_btn.isSelected
if all_select_btn.isSelected {
select_arr.removeAll()
for i in 0 ..< piciArr.count {
select_arr.append(i)
}
}else{
select_arr.removeAll()
for _ in 0 ..< piciArr.count {
select_arr.append(999999)
}
}
delegate?.GPrinter_Cell_select_item(selects: select_arr, cell: self)
}
@IBOutlet weak var bg_view: UIView!
@IBOutlet weak var all_select_btn: UIButton!
@IBOutlet weak var name_lbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
self.selectionStyle = .none
}
func setUI(){
if bg_view.subviews.count > 0 {
bg_view.subviews.forEach { (item) in
item.removeFromSuperview()
}
}
if piciArr.count == 0 {return}
for i in 0 ..< piciArr.count {
if select_arr.count != piciArr.count {
select_arr.append(999999)
}
let view = UIView()
view.tag = i
bg_view.addSubview(view)
view.snp.makeConstraints { (make) in
make.left.right.equalTo(0)
make.height.equalTo(67)
make.top.equalTo(i * 67)
}
let btn = UIButton(frame: CGRect(x: 0, y: 0, width: 44, height: 67))
btn.tag = i
view.addSubview(btn)
btn.setImage(UIImage(named: "daixuan"), for: .normal)
btn.setImage(UIImage(named: "yuxuan"), for: .selected)
btn.addTarget(self, action: #selector(single_select(btn:)), for: .touchUpInside)
if btn.tag == select_arr[i] {
btn.isSelected = true
}else{
btn.isSelected = false
}
let num_lbl = UILabel()
num_lbl.textColor = UIColor(named: "个人中心灰色字体")
num_lbl.font = UIFont.systemFont(ofSize: 13)
view.addSubview(num_lbl)
num_lbl.text = "330"
num_lbl.snp.makeConstraints { (make) in
make.centerY.equalTo(btn.snp_centerY)
make.centerX.equalTo(title_lbl_1.snp_centerX)
}
let type_lbl = UILabel()
type_lbl.textColor = UIColor(named: "个人中心灰色字体")
type_lbl.font = UIFont.systemFont(ofSize: 13)
view.addSubview(type_lbl)
type_lbl.text = "正常"
type_lbl.snp.makeConstraints { (make) in
make.centerY.equalTo(btn.snp_centerY)
make.centerX.equalTo(title_lbl_2.snp_centerX)
}
}
}
var select_arr:Array<Int> = []
override func layoutIfNeeded() {
super.layoutIfNeeded()
for i in 0 ..< bg_view.subviews.count {
let view = bg_view.subviews[i]
if view.tag == select_arr[i] {
view.subviews.forEach { (item) in
if item.isMember(of: UIButton.classForCoder()){
let btn = item as! UIButton
btn.isSelected = true
}
}
}else{
view.subviews.forEach { (item) in
if item.isMember(of: UIButton.classForCoder()){
let btn = item as! UIButton
btn.isSelected = false
}
}
}
}
}
@objc func single_select(btn:UIButton){
if btn.isSelected {
btn.isSelected = false
select_arr.insert(999999, at: btn.tag)
select_arr.remove(at: btn.tag+1)
}else{
btn.isSelected = true
select_arr.insert(btn.tag, at: btn.tag)
select_arr.remove(at: btn.tag+1)
}
if select_arr.contains(999999){
all_select_btn.isSelected = false
}else{
all_select_btn.isSelected = true
}
delegate?.GPrinter_Cell_select_item(selects: select_arr, cell: self)
}
var piciArr:Array<GetGoodBatchDataModel> = []{
didSet{
setUI()
}
}
@IBOutlet weak var btm_line: UIView!
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="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.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="GPrinter_Cell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="304"/>
<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="375" height="304"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="t1e-KP-5I6">
<rect key="frame" x="15" y="303" width="360" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="tg8-WQ-Rzs"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lxn-1x-6GG">
<rect key="frame" x="15" y="15" width="345" height="37"/>
<constraints>
<constraint firstAttribute="height" constant="37" id="cdH-OO-qLe"/>
</constraints>
<string key="text">六和川香鸡柳2.5kg/六和川香鸡柳2.六和川香鸡柳2kg/六和
川香鸡六和川香鸡柳2.5kg/六和川香鸡六</string>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b1g-mU-o3B">
<rect key="frame" x="0.0" y="57.5" width="44" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="44" id="D6d-tU-yzD"/>
<constraint firstAttribute="height" constant="44" id="wQa-EU-GIQ"/>
</constraints>
<state key="normal" image="daixuan"/>
<state key="selected" image="yuxuan"/>
<connections>
<action selector="select_all:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="gem-or-dWN"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LWX-gw-VUO">
<rect key="frame" x="44" y="62" width="316" height="35"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="批次编号" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X88-jm-Xcv">
<rect key="frame" x="10" y="8.5" width="52" height="18.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" 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="PzW-AE-eOK">
<rect key="frame" x="132" y="8.5" width="52" height="18.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" 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="Tf7-aw-r9B">
<rect key="frame" x="229.5" y="8.5" width="52" height="18.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" name="app底色"/>
<constraints>
<constraint firstItem="Tf7-aw-r9B" firstAttribute="centerY" secondItem="PzW-AE-eOK" secondAttribute="centerY" id="5fu-Z6-hFs"/>
<constraint firstItem="PzW-AE-eOK" firstAttribute="centerX" secondItem="LWX-gw-VUO" secondAttribute="centerX" id="60M-3n-End"/>
<constraint firstItem="X88-jm-Xcv" firstAttribute="leading" secondItem="LWX-gw-VUO" secondAttribute="leading" constant="10" id="HNc-MD-tAI"/>
<constraint firstAttribute="height" constant="35" id="S3e-Fk-0yS"/>
<constraint firstItem="PzW-AE-eOK" firstAttribute="centerY" secondItem="LWX-gw-VUO" secondAttribute="centerY" id="ZDF-8C-iSm"/>
<constraint firstItem="X88-jm-Xcv" firstAttribute="centerY" secondItem="LWX-gw-VUO" secondAttribute="centerY" id="nzY-WU-gGj"/>
<constraint firstAttribute="trailing" secondItem="Tf7-aw-r9B" secondAttribute="trailing" constant="34.5" id="sFO-xx-I3W"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7At-Co-CrQ">
<rect key="frame" x="0.0" y="101.5" width="375" height="186.5"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="lxn-1x-6GG" secondAttribute="trailing" constant="15" id="BZE-bX-gaX"/>
<constraint firstItem="t1e-KP-5I6" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="EgB-cI-wwy"/>
<constraint firstItem="t1e-KP-5I6" firstAttribute="top" secondItem="7At-Co-CrQ" secondAttribute="bottom" constant="15" id="KiV-A3-xJf"/>
<constraint firstItem="LWX-gw-VUO" firstAttribute="centerY" secondItem="b1g-mU-o3B" secondAttribute="centerY" id="VB8-2a-1lX"/>
<constraint firstItem="lxn-1x-6GG" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="XLW-1l-4Vo"/>
<constraint firstItem="b1g-mU-o3B" firstAttribute="top" secondItem="lxn-1x-6GG" secondAttribute="bottom" constant="5.5" id="Xnw-qy-87b"/>
<constraint firstItem="7At-Co-CrQ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="fcF-E2-qj1"/>
<constraint firstItem="lxn-1x-6GG" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="h0M-Vs-Ny3"/>
<constraint firstAttribute="trailing" secondItem="7At-Co-CrQ" secondAttribute="trailing" id="h51-MH-gQK"/>
<constraint firstAttribute="trailing" secondItem="t1e-KP-5I6" secondAttribute="trailing" id="kYs-Rw-wy5"/>
<constraint firstAttribute="bottom" secondItem="t1e-KP-5I6" secondAttribute="bottom" id="lvn-Vo-hvD"/>
<constraint firstItem="LWX-gw-VUO" firstAttribute="leading" secondItem="b1g-mU-o3B" secondAttribute="trailing" id="pep-T1-evw"/>
<constraint firstAttribute="trailing" secondItem="LWX-gw-VUO" secondAttribute="trailing" constant="15" id="q8V-d7-T41"/>
<constraint firstItem="7At-Co-CrQ" firstAttribute="top" secondItem="b1g-mU-o3B" secondAttribute="bottom" id="vTa-1f-gzF"/>
<constraint firstItem="b1g-mU-o3B" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="wEh-5w-vmj"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="all_select_btn" destination="b1g-mU-o3B" id="5bD-lp-eZP"/>
<outlet property="bg_view" destination="7At-Co-CrQ" id="vYy-U5-fxK"/>
<outlet property="btm_line" destination="t1e-KP-5I6" id="1Wy-sA-fqU"/>
<outlet property="name_lbl" destination="lxn-1x-6GG" id="leb-cr-XBi"/>
<outlet property="title_lbl_1" destination="X88-jm-Xcv" id="wdU-6k-whS"/>
<outlet property="title_lbl_2" destination="PzW-AE-eOK" id="IYm-az-30e"/>
<outlet property="title_lbl_3" destination="Tf7-aw-r9B" id="9dH-fm-hYV"/>
</connections>
<point key="canvasLocation" x="-197" y="94"/>
</tableViewCell>
</objects>
<resources>
<image name="daixuan" width="19" height="19"/>
<image name="yuxuan" width="19" height="19"/>
<namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" 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>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// Print_Gprinter_View.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2021/1/27.
// Copyright © 2021 junye lu. All rights reserved.
//
import UIKit
import LGButton
class Print_Gprinter_View: UIView,UITableViewDelegate,UITableViewDataSource, GPrinter_Cell_Delegate {
func GPrinter_Cell_select_item(selects: Array<Int>, cell: GPrinter_Cell) {
pi_ci_select.insert(selects, at: cell.tag)
pi_ci_select.remove(at: cell.tag+1)
cell.layoutIfNeeded()
list_view.reloadData()
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return rkSelectArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "GPrinter_Cell") as! GPrinter_Cell
cell.delegate = self
cell.select_arr = pi_ci_select[indexPath.row]
cell.tag = indexPath.row
let model = rkSelectArr[indexPath.row]
cell.name_lbl.text = model.goods_name
cell.piciArr = piCiArr![indexPath.row]
cell.btm_line.isHidden = false
if indexPath.row == rkSelectArr.count - 1 {
cell.btm_line.isHidden = true
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
let pici = piCiArr![indexPath.row]
return CGFloat(103 + 67 * pici.count)
}
var rkSelectArr:Array<InputInitInfoGoodsInfoModel> = []{
didSet {
for i in 0 ..< rkSelectArr.count {
pi_ci_select.append([])
}
}
}//产品选择
var piCiArr:Array<Array<GetGoodBatchDataModel>>? = []
var contentView:UIView!
var pi_ci_select:Array<Array<Int>> = []
@IBOutlet weak var list_view: UITableView!
@IBAction func print_action(_ sender: LGButton) {
}
@IBAction func close_action(_ sender: UIButton) {
self.removeFromSuperview()
}
//初始化时将xib中的view添加进来
override init(frame: CGRect) {
super.init(frame: frame)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
list_view.register(UINib(nibName: "GPrinter_Cell", bundle: nil), forCellReuseIdentifier: "GPrinter_Cell")
list_view.separatorStyle = .none
}
// /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
list_view.register(UINib(nibName: "GPrinter_Cell", bundle: nil), forCellReuseIdentifier: "GPrinter_Cell")
list_view.separatorStyle = .none
}
//加载xib
func loadViewFromNib() -> UIView {
let className = type(of: self)
let bundle = Bundle(for: className)
let name = NSStringFromClass(className).components(separatedBy: ".").last
let nib = UINib(nibName: name!, bundle: bundle)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
return view
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="Print_Gprinter_View" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="list_view" destination="tg1-Mu-DiU" id="Lnf-Be-uXc"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" alpha="0.40000000000000002" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oEf-W5-yQm">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<color key="backgroundColor" name="标题字颜色"/>
<connections>
<action selector="close_action:" destination="-1" eventType="touchUpInside" id="JE9-Am-Z6x"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ldh-k1-OH6" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="print_action:" destination="-1" eventType="touchUpInside" id="ftV-2T-wEl"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="确认出库并打印" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BPl-41-65h">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="9Nc-vp-S9Z"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
<color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FKx-Wz-KDW">
<rect key="frame" x="0.0" y="420" width="414" height="393"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="打印商品格利批次号" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vTf-aY-1ge">
<rect key="frame" x="0.0" y="0.0" width="414" height="49"/>
<constraints>
<constraint firstAttribute="height" constant="49" id="HWE-ib-DMW"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vfG-wL-c5P">
<rect key="frame" x="0.0" y="49" width="414" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="1N8-sp-1At"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="tg1-Mu-DiU">
<rect key="frame" x="0.0" y="50" width="414" height="343"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="TxP-cg-CI8"/>
<outlet property="delegate" destination="-1" id="vud-ro-DI6"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="tg1-Mu-DiU" secondAttribute="trailing" id="044-Ar-jor"/>
<constraint firstItem="vfG-wL-c5P" firstAttribute="leading" secondItem="FKx-Wz-KDW" secondAttribute="leading" id="68h-My-t5p"/>
<constraint firstItem="vTf-aY-1ge" firstAttribute="leading" secondItem="FKx-Wz-KDW" secondAttribute="leading" id="753-C1-izB"/>
<constraint firstAttribute="trailing" secondItem="vfG-wL-c5P" secondAttribute="trailing" id="BI2-RG-iga"/>
<constraint firstAttribute="height" constant="393" id="DXi-Yd-mer"/>
<constraint firstItem="tg1-Mu-DiU" firstAttribute="top" secondItem="vfG-wL-c5P" secondAttribute="bottom" id="azc-7t-y1K"/>
<constraint firstItem="tg1-Mu-DiU" firstAttribute="leading" secondItem="FKx-Wz-KDW" secondAttribute="leading" id="hcI-lq-K6s"/>
<constraint firstAttribute="bottom" secondItem="tg1-Mu-DiU" secondAttribute="bottom" id="qJS-Ur-7HF"/>
<constraint firstItem="vfG-wL-c5P" firstAttribute="top" secondItem="vTf-aY-1ge" secondAttribute="bottom" id="sqF-RL-mnG"/>
<constraint firstAttribute="trailing" secondItem="vTf-aY-1ge" secondAttribute="trailing" id="wP8-4B-LD6"/>
<constraint firstItem="vTf-aY-1ge" firstAttribute="top" secondItem="FKx-Wz-KDW" secondAttribute="top" id="yHh-i3-jxF"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="BPl-41-65h" secondAttribute="trailing" id="3ry-uY-JD4"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="oEf-W5-yQm" secondAttribute="trailing" id="4AG-ST-Naj"/>
<constraint firstAttribute="bottom" secondItem="Ldh-k1-OH6" secondAttribute="bottom" id="Al9-vz-iyc"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="BPl-41-65h" secondAttribute="bottom" id="D10-9A-hrJ"/>
<constraint firstItem="Ldh-k1-OH6" firstAttribute="top" secondItem="BPl-41-65h" secondAttribute="top" id="MCH-sM-Z0P"/>
<constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="FKx-Wz-KDW" secondAttribute="trailing" id="QAW-Dc-ztm"/>
<constraint firstItem="oEf-W5-yQm" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="VP1-Aq-Hi2"/>
<constraint firstItem="oEf-W5-yQm" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="bXT-Ri-XZU"/>
<constraint firstItem="Ldh-k1-OH6" firstAttribute="top" secondItem="FKx-Wz-KDW" secondAttribute="bottom" id="bzX-CB-izu"/>
<constraint firstAttribute="trailing" secondItem="Ldh-k1-OH6" secondAttribute="trailing" id="etO-Ki-fks"/>
<constraint firstAttribute="bottom" secondItem="oEf-W5-yQm" secondAttribute="bottom" id="mcm-BF-WQV"/>
<constraint firstItem="Ldh-k1-OH6" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="rsm-aL-iLT"/>
<constraint firstItem="BPl-41-65h" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="tsa-il-j9J"/>
<constraint firstItem="FKx-Wz-KDW" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="uTM-w5-s0J"/>
</constraints>
<point key="canvasLocation" x="140.57971014492756" y="103.79464285714285"/>
</view>
</objects>
<designables>
<designable name="Ldh-k1-OH6">
<size key="intrinsicContentSize" width="10" height="10"/>
</designable>
</designables>
<resources>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" 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>
<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="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
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