Commit 48b0f733 authored by lujunye's avatar lujunye

新增,编辑采购单

parent 0f143499
......@@ -93,6 +93,8 @@
E07B1E6C245926330055BA3C /* GYSGLCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E07B1E6A245926330055BA3C /* GYSGLCell.xib */; };
E07B1E6F245929060055BA3C /* GYSGLViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E07B1E6D245929060055BA3C /* GYSGLViewController.swift */; };
E07B1E70245929060055BA3C /* GYSGLViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E07B1E6E245929060055BA3C /* GYSGLViewController.xib */; };
E07B1E78245966E60055BA3C /* XinCaiGouViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E07B1E76245966E60055BA3C /* XinCaiGouViewController.swift */; };
E07B1E79245966E60055BA3C /* XinCaiGouViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E07B1E77245966E60055BA3C /* XinCaiGouViewController.xib */; };
E088CC8D24470BF0000DAA8A /* CodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E088CC8C24470BF0000DAA8A /* CodeView.swift */; };
E088CC932447124D000DAA8A /* BindViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E088CC912447124D000DAA8A /* BindViewController.swift */; };
E088CC942447124D000DAA8A /* BindViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E088CC922447124D000DAA8A /* BindViewController.xib */; };
......@@ -390,6 +392,8 @@
E07B1E6A245926330055BA3C /* GYSGLCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GYSGLCell.xib; sourceTree = "<group>"; };
E07B1E6D245929060055BA3C /* GYSGLViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GYSGLViewController.swift; sourceTree = "<group>"; };
E07B1E6E245929060055BA3C /* GYSGLViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GYSGLViewController.xib; sourceTree = "<group>"; };
E07B1E76245966E60055BA3C /* XinCaiGouViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XinCaiGouViewController.swift; sourceTree = "<group>"; };
E07B1E77245966E60055BA3C /* XinCaiGouViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = XinCaiGouViewController.xib; sourceTree = "<group>"; };
E088CC8C24470BF0000DAA8A /* CodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeView.swift; sourceTree = "<group>"; };
E088CC912447124D000DAA8A /* BindViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BindViewController.swift; sourceTree = "<group>"; };
E088CC922447124D000DAA8A /* BindViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BindViewController.xib; sourceTree = "<group>"; };
......@@ -891,6 +895,15 @@
path = "供应商管理";
sourceTree = "<group>";
};
E07B1E75245966C90055BA3C /* 新增采购单 */ = {
isa = PBXGroup;
children = (
E07B1E76245966E60055BA3C /* XinCaiGouViewController.swift */,
E07B1E77245966E60055BA3C /* XinCaiGouViewController.xib */,
);
path = "新增采购单";
sourceTree = "<group>";
};
E088CC882446FFA1000DAA8A /* Other */ = {
isa = PBXGroup;
children = (
......@@ -986,6 +999,7 @@
E09B03AD2445B0BA00211A51 /* ViewController */ = {
isa = PBXGroup;
children = (
E07B1E75245966C90055BA3C /* 新增采购单 */,
E07B1E64245925F30055BA3C /* 供应商管理 */,
E03549AA24582806008BD021 /* 客户管理 */,
E06524EA2458006600CA22E2 /* 入库 */,
......@@ -1703,6 +1717,7 @@
E02DDD9A24501A5B00ABB707 /* DelGuiGeCell.xib in Resources */,
E00D85E8244561FE00F5F816 /* Preview Assets.xcassets in Resources */,
E02DDD962450106C00ABB707 /* PuTongJieTiCell.xib in Resources */,
E07B1E79245966E60055BA3C /* XinCaiGouViewController.xib in Resources */,
E0A2E81B24552E3C00D6DB34 /* XinZengPinPaiViewController.xib in Resources */,
E0A7548B244A8F0F00A84B67 /* CheckWareHourseViewController.xib in Resources */,
F95D9B5024484FAE0080D6E3 /* GeliAlertView.xib in Resources */,
......@@ -1824,6 +1839,7 @@
E03549AD24582828008BD021 /* KeHuGuanLiCell.swift in Sources */,
F95567A72453DA86009674AB /* WarehoseMangementListVC.swift in Sources */,
F933F6CF2452C68B00189561 /* PKHUDErrorView.swift in Sources */,
E07B1E78245966E60055BA3C /* XinCaiGouViewController.swift in Sources */,
F933F6C42452C68B00189561 /* PKHUD.swift in Sources */,
E0F97B102451728D001BD600 /* AddGuiGeCell.swift in Sources */,
E0F97B1A2451951D001BD600 /* ShangPinGguiGeCell.swift in Sources */,
......
......@@ -41,7 +41,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, UITabBarControllerDeleg
// vc.delegate = self
// let contentView = vc
let vc = GYSGLViewController()
let vc = XinCaiGouViewController()
let contentView = vc
if let windowScene = sceneC as? UIWindowScene {
......
......@@ -10,6 +10,7 @@ import UIKit
class DaiKeXiaDanGouWuCell: UITableViewCell {
@IBOutlet weak var changeBtn: UIButton!
@IBOutlet weak var btmLIneWidth: NSLayoutConstraint!
@IBOutlet weak var detailLbl2: UILabel!
@IBOutlet weak var delBtn: UIButton!
......
......@@ -31,6 +31,17 @@
<constraint firstAttribute="height" constant="90" id="VQx-k5-HpD"/>
</constraints>
</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"/>
<color key="backgroundColor" name="标题字颜色"/>
<constraints>
<constraint firstAttribute="width" constant="90" id="UQL-IV-mXE"/>
<constraint firstAttribute="height" constant="90" id="kE0-JX-5xu"/>
</constraints>
<state key="normal" title="更 换">
<color key="titleColor" name="白色背景色"/>
</state>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="shanchuDel" translatesAutoresizingMaskIntoConstraints="NO" id="ftv-xQ-eXW">
<rect key="frame" x="97.5" y="7.5" width="15" height="15"/>
<constraints>
......@@ -95,7 +106,9 @@
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="HYf-UQ-mHg" secondAttribute="trailing" constant="17" id="1et-A0-Mm7"/>
<constraint firstItem="4lb-rz-I6F" firstAttribute="centerY" secondItem="AWX-Qu-0ML" secondAttribute="centerY" id="6mE-8H-dPD"/>
<constraint firstAttribute="trailingMargin" secondItem="Rio-TZ-iyo" secondAttribute="trailing" id="Bgy-0b-yb6"/>
<constraint firstItem="4lb-rz-I6F" firstAttribute="centerX" secondItem="AWX-Qu-0ML" secondAttribute="centerX" id="DtW-X9-NRk"/>
<constraint firstItem="Rio-TZ-iyo" firstAttribute="bottom" secondItem="X1B-vl-mvy" secondAttribute="bottom" id="JcG-ly-QUv"/>
<constraint firstItem="AWX-Qu-0ML" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="PkW-SQ-lMP"/>
<constraint firstItem="AWX-Qu-0ML" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="QkU-Fn-YVB"/>
......@@ -120,6 +133,7 @@
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="btmLIneWidth" destination="qMJ-nI-cSg" id="dsM-yO-8bv"/>
<outlet property="changeBtn" destination="4lb-rz-I6F" id="OEf-1Q-OVb"/>
<outlet property="delBtn" destination="eKc-LO-OD0" id="sTb-4h-fLY"/>
<outlet property="delImg" destination="ftv-xQ-eXW" id="CON-aC-p5Y"/>
<outlet property="detailLbl" destination="LBB-wB-bMd" id="Z5L-Om-fG8"/>
......@@ -137,11 +151,17 @@
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" 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.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
//
// XinCaiGouViewController.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/29.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource{
@IBOutlet weak var lineView: UIView!
@IBAction func btnAction(_ sender: Any) {
//sender.tag 0:提交 1:提交并新增
}
@IBOutlet weak var listView: UITableView!
var isEdit:Bool?
//测试数据
var data:NSDictionary? = nil
override func viewDidLoad() {
super.viewDidLoad()
//编辑状态
// isEdit = true
// data = NSDictionary()
//
navbar.title = "新增采购单"
self.view.addSubview(navbar)
listView.separatorStyle = .none
SetTopFrameView(view: listView, btmView: lineView)
listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
listView.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtnCell")
listView.register(UINib(nibName: "AddGuiGeCell", bundle: nil), forCellReuseIdentifier: "AddGuiGeCell")
listView.register(UINib(nibName: "RuKuJiaGeCell", bundle: nil), forCellReuseIdentifier: "RuKuJiaGeCell")
listView.register(UINib(nibName: "DaiKeXiaDanGouWuCell", bundle: nil), forCellReuseIdentifier: "DaiKeXiaDanGouWuCell")
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 1 {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 36))
view.backgroundColor = UIColor.white
let title = UILabel()
title.text = "商品清单"
title.font = UIFont.boldSystemFont(ofSize: 15)
title.textColor = UIColor(named: "标题字颜色")
view.addSubview(title)
title.sizeToFit()
title.snp.makeConstraints { (make) in
make.left.equalTo(15)
make.height.equalTo(21)
make.width.equalTo(title.bounds.size.width)
make.bottom.equalTo(0)
}
let ti1 = UILabel()
ti1.text = "(仅支持采购一种商品)"
ti1.font = UIFont.boldSystemFont(ofSize: 11)
ti1.textColor = UIColor(named: "灰色字体颜色")
view.addSubview(ti1)
ti1.sizeToFit()
ti1.snp.makeConstraints { (make) in
make.left.equalTo(title.snp_right)
make.height.equalTo(15)
make.width.equalTo(ti1.bounds.size.width)
make.bottom.equalTo(0)
}
return view
}
return UIView()
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section == 1 {
return 38
}
return 0.001
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if isEdit == true /*&& 有商品 */{
if section == 1 {
return 87
}
}
return 10
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
if isEdit == true && data != nil {
if section == 1 {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 87))
let bgV = UIView()
bgV.backgroundColor = UIColor.white
view.addSubview(bgV)
bgV.snp.makeConstraints { (make) in
make.top.left.right.equalTo(0)
make.height.equalTo(77)
}
let line = UIView()
line.backgroundColor = UIColor(named: "灰色分界线")
view.addSubview(line)
line.snp.makeConstraints { (make) in
make.top.right.equalTo(0)
make.left.equalTo(15)
make.height.equalTo(1)
}
let countLbl = UILabel()
countLbl.text = "abc"
countLbl.font = UIFont.boldSystemFont(ofSize: 13)
countLbl.textColor = UIColor(named: "蓝色字体颜色")
countLbl.sizeToFit()
view.addSubview(countLbl)
countLbl.snp.makeConstraints { (make) in
make.right.equalTo(-15)
make.top.equalTo(15)
make.height.equalTo(18.5)
make.width.equalTo(countLbl.bounds.size.width)
}
let countTLbl = UILabel()
countTLbl.text = "商品合计:"
countTLbl.font = UIFont.systemFont(ofSize: 13)
countTLbl.textAlignment = .right
countTLbl.textColor = UIColor(named: "标题字颜色")
view.addSubview(countTLbl)
countTLbl.snp.makeConstraints { (make) in
make.right.equalTo(countLbl.snp_left)
make.left.top.equalTo(15)
make.height.equalTo(18.5)
}
let countLbl2 = UILabel()
countLbl2.text = "a123123123bc"
countLbl2.font = UIFont.systemFont(ofSize: 13)
countLbl2.textColor = UIColor(named: "蓝色字体颜色")
countLbl2.sizeToFit()
view.addSubview(countLbl2)
countLbl2.snp.makeConstraints { (make) in
make.right.equalTo(-15)
make.top.equalTo(countTLbl.snp_bottom).offset(10)
make.height.equalTo(18.5)
make.width.equalTo(countLbl2.bounds.size.width)
}
let countTLbl2 = UILabel()
countTLbl2.text = "订单合计:"
countTLbl2.font = UIFont.systemFont(ofSize: 13)
countTLbl2.textAlignment = .right
countTLbl2.textColor = UIColor(named: "标题字颜色")
view.addSubview(countTLbl2)
countTLbl2.snp.makeConstraints { (make) in
make.right.equalTo(countLbl2.snp_left)
make.centerY.equalTo(countLbl2.snp_centerY)
make.height.equalTo(18.5)
}
return view
}
}
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 10))
return view
}
let p1Arr = ["采购单号:","采购日期:","供应商:","采购人:","制单人:","采购类型:"]
let p3Arr = ["采购数量:","采购单价:","采购金额:"]
let hold1Arr = ["请输入采购单号","请选择采购日期","请选择供应商","请输入采购人姓名","请输入制单人姓名","请选择采购类型"]
func numberOfSections(in tableView: UITableView) -> Int {
return 3
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0:return 6
case 1:return 1
default:return 3
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 1 {
return 123.5
}
return 49
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
switch indexPath.section {
case 0:
if indexPath.row == 1 || indexPath.row == 2 || indexPath.row == 5 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = p1Arr[indexPath.row]
cell.contentLbl.text = hold1Arr[indexPath.row]
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = p1Arr[indexPath.row]
cell.textTF.placeholder = hold1Arr[indexPath.row]
return cell
case 1:
if data != nil{
let cell = tableView.dequeueReusableCell(withIdentifier: "DaiKeXiaDanGouWuCell") as! DaiKeXiaDanGouWuCell
cell.delImg.isHidden = true
cell.delBtn.isHidden = true
cell.changeBtn.isHidden = false
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "AddGuiGeCell") as! AddGuiGeCell
cell.imgBtn.setImage(UIImage(named: "tianjiashangpin"), for: .normal)
return cell
default:
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = p3Arr[indexPath.row]
cell.textTF.placeholder = "请输入采购数量"
return cell
}else{
let cell = tableView.dequeueReusableCell(withIdentifier: "RuKuJiaGeCell") as! RuKuJiaGeCell
cell.nameLbl.text = p3Arr[indexPath.row]
return cell
}
}
}
}
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