Commit 43b4a8a5 authored by lujunye's avatar lujunye

修改串联bug

parent 1f95bdc9
......@@ -7,8 +7,8 @@
//
import UIKit
class WarehoseMangementCell: UITableViewCell {
import SwipeCellKit
class WarehoseMangementCell: SwipeTableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
......
......@@ -138,7 +138,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -8,8 +8,9 @@
import UIKit
import ViewAnimator
import SwipeCellKit
class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource, SearchBarViewDelegate {
class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource, SearchBarViewDelegate,SwipeTableViewCellDelegate {
weak var searchV: SearchBarView? = nil
@IBOutlet weak var contentView: UIView!
@IBOutlet weak var searchView: UIView!
......@@ -124,7 +125,7 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "WarehoseMangementCell") as! WarehoseMangementCell
cell.delegate = self
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
......@@ -136,4 +137,27 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 94*glscale
}
//MARK:- 左滑删除
func tableView(_ tableView: UITableView,
editActionsOptionsForRowAt indexPath: IndexPath,
for orientation: SwipeActionsOrientation) -> SwipeTableOptions {
var options = SwipeTableOptions()
options.transitionStyle = .border //变化样式(使用默认的不变)
options.expansionStyle = .selection //展开样式(默认为.none)
return options
}
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]? {
//创建“删除”事件按钮
let deleteAction = SwipeAction(style: .destructive, title: nil) {
action, indexPath in
//将对应条目的数据删除
tableView.reloadData()
}
deleteAction.image = UIImage(named: "shanchuWhite")
deleteAction.backgroundColor = UIColor(named: "#F57575")
//返回右侧事件按钮
return [deleteAction,]
}
}
......@@ -41,6 +41,8 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
}
@IBAction func addAction(_ sender: Any) {
let vc = GYSGLViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK: - 自定义DELEGATE
func clearSearchAction() {
......
......@@ -50,7 +50,7 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YingFuZhangKuanXQViewController()
vc.navTitle = "\(navbar.title!)详情"
vc.navTitle = "\(barTitle!)详情"
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
......
......@@ -7,10 +7,13 @@
//
import UIKit
@objc protocol YingFuZhangKuanXQCellDelegate {
@objc optional func YingFuZhangKuanXQCellBtnClick(cell:YingFuZhangKuanXQCell,sender:UIButton)
}
class YingFuZhangKuanXQCell: UITableViewCell {
@IBAction func submitAction(_ sender: Any) {
var delegate:YingFuZhangKuanXQCellDelegate?
@IBAction func submitAction(_ sender: UIButton) {
delegate?.YingFuZhangKuanXQCellBtnClick?(cell: self,sender:sender)
}
@IBOutlet weak var p3Title: UILabel!
@IBOutlet weak var p2Title: UILabel!
......
......@@ -8,7 +8,7 @@
import UIKit
class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource {
class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource,YingFuZhangKuanXQCellDelegate{
var navTitle:String = ""
var searchV : SearchBarView? = nil
@IBOutlet weak var listView: UITableView!
......@@ -147,7 +147,8 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "YingFuZhangKuanXQCell") as! YingFuZhangKuanXQCell
cell.delegate = self
cell.submitBtn.tag = indexPath.row
if navTitle.contains("应付"){
if indexPath.row == 0 {
cell.submitBtn.backgroundColor = UIColor(named: "按钮渐变色下,字体颜色")
......@@ -169,4 +170,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
}
return cell
}
func YingFuZhangKuanXQCellBtnClick(cell: YingFuZhangKuanXQCell, sender: UIButton) {
print("应收/应付账款 == ",sender.tag)
}
}
......@@ -13,8 +13,8 @@ import IQKeyboardManagerSwift
class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,WareHouseSpCellDelegate,GLAlertSelectViewDelegate{
var titleStr:String?
@IBOutlet weak var bottomBtn: LGButton!
@IBOutlet weak var color: LGButton!
@IBOutlet weak var btnTitleLbl: UILabel!
@IBOutlet weak var listView: UITableView!
var btnArray:NSMutableArray = NSMutableArray()
......@@ -33,7 +33,7 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa
navbar.title = titleStr
self.view.addSubview(navbar)
if titleStr != "新增仓库" {
bottomBtn.titleString = "编辑"
btnTitleLbl.text = "编辑"
navbar.rightTitle = "删除"
}
listView.delegate = self
......@@ -42,11 +42,11 @@ class CheckWareHourseViewController: BaseViewController,UITableViewDelegate,UITa
listView?.register(UINib(nibName: "WareHouseSpCell", bundle: nil), forCellReuseIdentifier: "WareHouse")
listView.isScrollEnabled = false
color.isUserInteractionEnabled = false
listView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
make.left.right.equalTo(0)
make.bottom.equalTo(bottomBtn.snp_top)
make.bottom.equalTo(btnTitleLbl.snp_top)
}
// Do any additional setup after loading the view.
}
......
......@@ -10,7 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CheckWareHourseViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="bottomBtn" destination="3xa-Lo-irO" id="5Em-Lo-mW9"/>
<outlet property="btnTitleLbl" destination="Il1-TV-CC8" id="ZxK-s6-x8I"/>
<outlet property="listView" destination="wre-tZ-eDu" id="rds-VX-rIT"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
......@@ -20,6 +20,25 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3xa-Lo-irO" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<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"/>
<userDefinedRuntimeAttribute type="number" keyPath="titleFontSize">
<real key="value" value="0.0"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="submitAction:" destination="-1" eventType="touchUpInside" id="TSG-mS-OJb"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Il1-TV-CC8">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<constraints>
......@@ -40,25 +59,6 @@
<rect key="frame" x="0.0" y="44" width="414" height="769"/>
<color key="backgroundColor" name="app底色"/>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3xa-Lo-irO" customClass="LGButton" customModule="LGButton">
<rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<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"/>
<userDefinedRuntimeAttribute type="number" keyPath="titleFontSize">
<real key="value" value="0.0"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="submitAction:" destination="-1" eventType="touchUpInside" id="TSG-mS-OJb"/>
</connections>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
......
......@@ -186,16 +186,9 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 {
if indexPath.row == 2{
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.isMultipleSelect = false//是否多选
view.delegate = self
view.titleLbl.text = "请选择供应商"
view.dataArr = ["普通订单","预售下单"]
self.view.addSubview(view)
glSelectView = view
}
if indexPath.row == 2{//跳转供应商选择
let vc = GYSListViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
if indexPath.row == 5 {
if glSelectView == nil {
......
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