Commit cb4f379d authored by lujunye's avatar lujunye

待完善

parent cf4d49d2
......@@ -77,6 +77,8 @@
E02FD9FB24557E8600E10E27 /* XinZengDiZhiViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E02FD9F924557E8600E10E27 /* XinZengDiZhiViewController.xib */; };
E030DF362485DD3E002764D3 /* NewRKCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030DF342485DD3E002764D3 /* NewRKCell.swift */; };
E030DF372485DD3E002764D3 /* NewRKCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E030DF352485DD3E002764D3 /* NewRKCell.xib */; };
E030DF3B248651A5002764D3 /* NewRKVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030DF39248651A5002764D3 /* NewRKVc.swift */; };
E030DF3C248651A5002764D3 /* NewRKVc.xib in Resources */ = {isa = PBXBuildFile; fileRef = E030DF3A248651A5002764D3 /* NewRKVc.xib */; };
E0336DD5244EC40000380BE9 /* CreatNewSpecsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0336DD3244EC40000380BE9 /* CreatNewSpecsViewController.swift */; };
E0336DD6244EC40000380BE9 /* CreatNewSpecsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0336DD4244EC40000380BE9 /* CreatNewSpecsViewController.xib */; };
E0337EED2464EED000952EF4 /* PinPaiListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0337EEB2464EED000952EF4 /* PinPaiListViewController.swift */; };
......@@ -580,6 +582,8 @@
E02FD9F924557E8600E10E27 /* XinZengDiZhiViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = XinZengDiZhiViewController.xib; sourceTree = "<group>"; };
E030DF342485DD3E002764D3 /* NewRKCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewRKCell.swift; sourceTree = "<group>"; };
E030DF352485DD3E002764D3 /* NewRKCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewRKCell.xib; sourceTree = "<group>"; };
E030DF39248651A5002764D3 /* NewRKVc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewRKVc.swift; sourceTree = "<group>"; };
E030DF3A248651A5002764D3 /* NewRKVc.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewRKVc.xib; sourceTree = "<group>"; };
E0336DD3244EC40000380BE9 /* CreatNewSpecsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreatNewSpecsViewController.swift; sourceTree = "<group>"; };
E0336DD4244EC40000380BE9 /* CreatNewSpecsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CreatNewSpecsViewController.xib; sourceTree = "<group>"; };
E0337EEB2464EED000952EF4 /* PinPaiListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinPaiListViewController.swift; sourceTree = "<group>"; };
......@@ -1318,6 +1322,15 @@
path = "地址管理";
sourceTree = "<group>";
};
E030DF382486517E002764D3 /* 1.1入库&出库 */ = {
isa = PBXGroup;
children = (
E030DF39248651A5002764D3 /* NewRKVc.swift */,
E030DF3A248651A5002764D3 /* NewRKVc.xib */,
);
path = "1.1入库&出库";
sourceTree = "<group>";
};
E0336DD2244EC3CA00380BE9 /* 新增规格 */ = {
isa = PBXGroup;
children = (
......@@ -1574,6 +1587,7 @@
E07B1E75245966C90055BA3C /* 新增采购单 */,
E07B1E64245925F30055BA3C /* 供应商管理 */,
E03549AA24582806008BD021 /* 客户管理 */,
E030DF382486517E002764D3 /* 1.1入库&出库 */,
E06524EA2458006600CA22E2 /* 入库 */,
E02C88232456B23400925766 /* 物流跟踪 */,
E02FD9EE2455704600E10E27 /* 出入库记录 */,
......@@ -2641,6 +2655,7 @@
E01C26B12446989700ADCC70 /* Interface_Z.plist in Resources */,
E0A409CD2464026B00CFF109 /* SecondCell.xib in Resources */,
F95A9EEA24558B8800867849 /* ShowAlGoodsViewController.xib in Resources */,
E030DF3C248651A5002764D3 /* NewRKVc.xib in Resources */,
F969BF08244EC38000C79953 /* GoodsCollectionViewCell.xib in Resources */,
E0D4166524483058008DCAB4 /* ChangePassViewController.xib in Resources */,
F95A9ED9245520E500867849 /* OrderListVC.xib in Resources */,
......@@ -2773,6 +2788,7 @@
F956D59C246A2D9C003FF510 /* UIFont+LMNote.m in Sources */,
F961D264244FD744007FBE70 /* SearchBarView.swift in Sources */,
F950FDE124518B9500C40530 /* FSCalendarConstants.m in Sources */,
E030DF3B248651A5002764D3 /* NewRKVc.swift in Sources */,
F9023F712449ACA800DD5A63 /* TitleAndSwitchCell.swift in Sources */,
E0C4F4BD244EF53D00CC7E2F /* BindStepTwoViewController.swift in Sources */,
E0A409CC2464026B00CFF109 /* SecondCell.swift in Sources */,
......
......@@ -226,6 +226,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,loginDelegate, UITabBarCon
// Saves changes in the application's managed object context before the application terminates.
}
//MARK:--tabbarVCs
weak var tabBarC:ESTabBarController!
func addTabBarVcs (isAgain:Bool) {
......@@ -240,7 +241,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,loginDelegate, UITabBarCon
tabBarC = tabBarController
let v1 = OrderListViewController()
let v2 = GoodsManageListVC()
let v2 = CRKListVC()
let v3 = WorkCViewController()
let v4 = WarehoseMangementListVC()
let v5 = PersonCenterViewController()
......@@ -255,7 +256,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,loginDelegate, UITabBarCon
tabBarController.viewControllers = [v1, v2, v3, v4, v5]
tabBarController.selectedIndex = 2
tabBarController.selectedIndex = 1
......@@ -275,6 +276,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,loginDelegate, UITabBarCon
window.rootViewController = rootV;
self.window = window
window.makeKeyAndVisible()
}
NotificationCenter.default.addObserver(self, selector: #selector(changgeTabItem(notion:)), name: NSNotification.Name(rawValue: "changgeTabItem"), object: nil)
......
......@@ -27,7 +27,7 @@ import IQKeyboardManagerSwift
class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleAndSelectCellDelegate,KuWeiCellCellDelegate,UITextFieldDelegate{
var deSelectArr:Array<Int> = []
var isOnlySelectKuWei = false
var isMultipleS:Bool = false
var contentView:UIView!
var delegate:GLAlertSelectViewDelegate?
......@@ -105,7 +105,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
make.left.top.right.bottom.equalToSuperview()
}
titleLbl.text = title
if title.contains("库位") {
if title.contains("库位") && isOnlySelectKuWei == false{
self.setKuWeiView()
}else{
self.setSelectView()
......@@ -158,21 +158,21 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
return 49
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if (titleLbl.text?.contains("库位"))!{
if (titleLbl.text?.contains("库位"))! && isOnlySelectKuWei == false{
return kuWeiArr.count
}
return dataArr.count
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if (titleLbl.text?.contains("库位"))! {
if (titleLbl.text?.contains("库位"))! && isOnlySelectKuWei == false{
selectNum = indexPath.row
selectTbv.reloadData()
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if (titleLbl.text?.contains("库位"))! {
if (titleLbl.text?.contains("库位"))! && isOnlySelectKuWei == false {
let cell = tableView.dequeueReusableCell(withIdentifier: "KuWei") as! KuWeiCell
cell.delegate = self
......@@ -215,7 +215,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
}
@IBAction func submitClick(_ sender: Any) {
if (titleLbl.text?.contains("库位"))! {
if (titleLbl.text?.contains("库位"))! && isOnlySelectKuWei == false{
delegate?.KuWeiDataArr?(sender: kuWeiArr)
return
}
......@@ -304,7 +304,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
func deleClickAction(sender: Int) {
print("sender == ",sender)
if (titleLbl.text?.contains("库位"))!{
if (titleLbl.text?.contains("库位"))! && isOnlySelectKuWei == false{
kuWeiArr.remove(at: sender)
delegate?.GLAlertSelectDelAction?(sender: kuWeiArr)
}else{
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" 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="retina5_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<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" customClass="GeliAlertTextView" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GeliAlertTextView" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="placerLbl" destination="9Qr-Ot-aRg" id="JP0-4t-4py"/>
<outlet property="textview" destination="wXk-Gr-x6B" id="Tv2-Vn-k9E"/>
......@@ -188,7 +189,7 @@
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" 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>
//
// NewRKVc.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/2.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class NewRKVc: BaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "入库"
self.view.addSubview(navbar)
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
<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" customClass="NewRKVc" customModuleProvider="target">
<connections>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
</view>
</objects>
</document>
......@@ -9,17 +9,22 @@
import UIKit
import ViewAnimator
import SwipeCellKit
protocol WarehoseMangementListVCDelegate {
func WarehoseMangementListVCSelectFinish(sender:ShopWarehouseListDataModel,kuWeiArr:Array<ShopWarehouseDetailDataPositionModel>)
}
class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource, SearchBarViewDelegate,SwipeTableViewCellDelegate,CheckWareHourseViewControllerDelegate{
func CheckWareHourseViewControllerRefresh() {
tableV.mj_header?.beginRefreshing()
}
var delegate:WarehoseMangementListVCDelegate?
@IBOutlet weak var topBgView: UIView!
weak var searchV: SearchBarView? = nil
@IBOutlet weak var contentView: UIView!
@IBOutlet weak var searchView: UIView!
var page : Int = 0
var isUpData = false
var keyWord = ""
var isSelectWarehouse = false
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
......@@ -28,10 +33,18 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
searchV = searchBr
self.searchView.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.right.equalTo(0)
make.left.equalTo(0)
make.right.equalTo(0)
make.centerY.equalToSuperview()
make.height.equalTo(35)
}
if isSelectWarehouse{
navbar.title = "仓库选择"
self.view.addSubview(navbar)
SetTopFrame(view: topBgView, height: 45)
}
searchBr.delegateL = self
searchBr.placeholderStr = "请输入仓库名称"
searchBr.cornerRadius = 35/2.0
......@@ -212,7 +225,23 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath)
if isSelectWarehouse {
let model = warehourseArr[indexPath.row]
let UserToken = UserDefaults.standard.value(forKey: "user_token")
WarehouseDetail(["user_token":UserToken as Any,"w_id":model.w_id as Any], success: { (data) in
var arr:Array<ShopWarehouseDetailDataPositionModel> = []
let mo = data as! ShopWarehouseDetailModel
mo.data?.position_res?.forEach({ (item) in
arr.append(item)
})
self.delegate?.WarehoseMangementListVCSelectFinish(sender: model, kuWeiArr: arr)
self.navigationController?.popViewController(animated: true)
}) { (error) in
}
}else{
let vc = CheckWareHourseViewController()
vc.titleStr = "编辑仓库"
let model = warehourseArr[indexPath.row]
......@@ -222,6 +251,7 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
self.navigationController?.pushViewController(vc, animated: true)
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 94*glscale
......
<?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="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<deployment identifier="iOS"/>
<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" customClass="WarehoseMangementListVC" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WarehoseMangementListVC" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="contentView" destination="fng-dx-7gZ" id="2eI-9o-xiH"/>
<outlet property="searchView" destination="9uz-hT-q6i" id="XI6-mH-yBP"/>
<outlet property="topBgView" destination="1dv-pl-8n2" id="Wja-Jd-JLL"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......@@ -20,57 +22,69 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1dv-pl-8n2">
<rect key="frame" x="0.0" y="0.0" width="375" height="45"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IoW-Gs-1nk">
<rect key="frame" x="323" y="0.0" width="52" height="45"/>
<constraints>
<constraint firstAttribute="width" constant="52" id="Cqp-x9-cTg"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="新增">
<color key="titleColor" name="蓝色字体颜色"/>
</state>
<connections>
<action selector="addNewWarehose:" destination="-1" eventType="touchUpInside" id="JLP-Yu-o2W"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9uz-hT-q6i">
<rect key="frame" x="0.0" y="0.0" width="320" height="45"/>
<rect key="frame" x="0.0" y="0.0" width="323" height="45"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="ZBv-CM-JLF">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
</constraint>
<constraint firstItem="IoW-Gs-1nk" firstAttribute="top" secondItem="1dv-pl-8n2" secondAttribute="top" id="296-8k-O08"/>
<constraint firstItem="IoW-Gs-1nk" firstAttribute="leading" secondItem="9uz-hT-q6i" secondAttribute="trailing" id="PzG-xQ-nx5"/>
<constraint firstAttribute="bottom" secondItem="9uz-hT-q6i" secondAttribute="bottom" id="W7L-NE-3S7"/>
<constraint firstItem="9uz-hT-q6i" firstAttribute="top" secondItem="1dv-pl-8n2" secondAttribute="top" id="XbX-dv-7To"/>
<constraint firstAttribute="height" constant="45" id="mII-1c-14K"/>
<constraint firstAttribute="bottom" secondItem="IoW-Gs-1nk" secondAttribute="bottom" id="ojs-T8-29l"/>
<constraint firstItem="9uz-hT-q6i" firstAttribute="leading" secondItem="1dv-pl-8n2" secondAttribute="leading" id="pCU-HH-TNE"/>
<constraint firstAttribute="trailing" secondItem="IoW-Gs-1nk" secondAttribute="trailing" id="xuc-TW-4eT"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lfJ-T6-x4o">
<rect key="frame" x="0.0" y="45" width="375" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="7ws-MS-KcF"/>
<constraint firstAttribute="height" constant="1" id="6zA-zC-nKW"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fng-dx-7gZ">
<rect key="frame" x="0.0" y="46" width="375" height="621"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IoW-Gs-1nk">
<rect key="frame" x="320" y="8" width="55" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="新增">
<color key="titleColor" name="蓝色字体颜色"/>
</state>
<connections>
<action selector="addNewWarehose:" destination="-1" eventType="touchUpInside" id="JLP-Yu-o2W"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="IoW-Gs-1nk" secondAttribute="trailing" id="DtM-7e-yIf"/>
<constraint firstItem="lfJ-T6-x4o" firstAttribute="top" secondItem="9uz-hT-q6i" secondAttribute="bottom" id="E7j-5b-odp"/>
<constraint firstItem="1dv-pl-8n2" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="Ajk-NV-H58"/>
<constraint firstAttribute="trailing" secondItem="lfJ-T6-x4o" secondAttribute="trailing" id="GAD-iI-Ezx"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Kmb-EP-k8Q"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="lfJ-T6-x4o" secondAttribute="trailing" id="Ql9-tD-xcD"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="top" secondItem="lfJ-T6-x4o" secondAttribute="bottom" id="MFA-7a-972"/>
<constraint firstAttribute="bottom" secondItem="fng-dx-7gZ" secondAttribute="bottom" id="NR6-go-aKq"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="bottom" secondItem="fnl-2z-Ty3" secondAttribute="bottom" id="Qla-b6-j79"/>
<constraint firstAttribute="trailing" secondItem="9uz-hT-q6i" secondAttribute="trailing" constant="55" id="TLN-y8-x1q"/>
<constraint firstItem="9uz-hT-q6i" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="cTb-zk-cpL"/>
<constraint firstItem="IoW-Gs-1nk" firstAttribute="leading" secondItem="9uz-hT-q6i" secondAttribute="trailing" id="dxS-Hj-Vl7"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="XEH-Me-PrD"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="ZXh-ps-w8J"/>
<constraint firstItem="lfJ-T6-x4o" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="cQB-YL-7Bd"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="ftA-wr-c9b"/>
<constraint firstItem="IoW-Gs-1nk" firstAttribute="centerY" secondItem="9uz-hT-q6i" secondAttribute="centerY" id="nWR-hj-Jco"/>
<constraint firstItem="lfJ-T6-x4o" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="wgP-pX-r1Y"/>
<constraint firstItem="fng-dx-7gZ" firstAttribute="top" secondItem="lfJ-T6-x4o" secondAttribute="bottom" id="wgZ-aZ-YC1"/>
<constraint firstItem="9uz-hT-q6i" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="y1S-EV-3Zn"/>
<constraint firstItem="1dv-pl-8n2" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="gz6-zX-ZkK"/>
<constraint firstItem="1dv-pl-8n2" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="rxQ-wT-KmA"/>
<constraint firstItem="lfJ-T6-x4o" firstAttribute="top" secondItem="1dv-pl-8n2" secondAttribute="bottom" id="t4w-Hk-jOR"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="132" y="135"/>
<point key="canvasLocation" x="132" y="134.48275862068968"/>
</view>
</objects>
<resources>
......@@ -78,7 +92,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>
......@@ -8,7 +8,7 @@
import UIKit
protocol PiCiXuanZeViewControllerDelegate {
func PiCiXuanZeViewControllerPiCiSelect(data:Array<GetGoodBatchDataModel>)
func PiCiXuanZeViewControllerPiCiSelect(data:Array<GetGoodBatchDataModel>,p_id:Int)
}
class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,PiCiXuanZeCellDelegate{
......@@ -16,7 +16,7 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
var p_id:Int?
var sku_id:Int?
var tag:Int?
var totalCount = 0
var selectArr:Array<Int> = []
var recordArr:Array<GetGoodBatchDataModel> = []
......@@ -25,8 +25,13 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
@IBOutlet weak var btmLbl: UILabel!
var delegate:PiCiXuanZeViewControllerDelegate?
@IBAction func submitAction(_ sender: Any) {
delegate?.PiCiXuanZeViewControllerPiCiSelect(data: recordArr)
for item in recordArr {
if item.chuHuoLiang == nil {
HUD.flash(.label("请输入数量"), delay: 1.2)
return
}
}
delegate?.PiCiXuanZeViewControllerPiCiSelect(data: recordArr,p_id: tag!)
self.navigationController?.popViewController(animated: true)
}
@IBOutlet weak var listView: UITableView!
......@@ -54,6 +59,14 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
}) { (error) in
}
totalCount = 0
if recordArr.count > 0 {
for item in recordArr{
totalCount += item.chuHuoLiang!
}
}
}
......@@ -71,6 +84,7 @@ 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
}
......@@ -127,7 +141,9 @@ class PiCiXuanZeViewController: BaseViewController,UITableViewDelegate,UITableVi
if selectArr.contains(cell.tag) {
let idx = selectArr.index(of: cell.tag)
selectArr.remove(at: idx!)
if recordArr[idx!] != nil {
recordArr.remove(at: idx!)
}
}else{
selectArr.append(cell.tag)
recordArr.append(dataArray[cell.tag])
......
<?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"/>
<deployment identifier="iOS"/>
<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" customClass="RuKuViewController" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RuKuViewController" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="btmView" destination="fQY-7f-kO1" id="HbX-Sx-tdn"/>
<outlet property="listVIew" destination="lkk-Dx-Gzp" id="Wgw-dT-DDW"/>
......@@ -125,7 +126,7 @@
<color red="1" green="1" blue="1" 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>
......@@ -2,6 +2,7 @@
<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>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
......@@ -34,14 +35,14 @@
<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">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" 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"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="内容" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rkw-Cn-WEC">
<rect key="frame" x="63" y="0.0" width="239" height="64"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="个人中心灰色字体"/>
<nil key="highlightedColor"/>
......@@ -60,6 +61,7 @@
<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="rkw-Cn-WEC" firstAttribute="leading" secondItem="rZC-N1-umj" secondAttribute="trailing" constant="10" id="UZv-pz-g3K"/>
<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"/>
......
......@@ -12,7 +12,7 @@ import ViewAnimator //cell动效
class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CRKCellDelegate,UISearchBarDelegate, SearchBarViewDelegate {
var page = 0
var isGm = false
var isGm = true
private let animations = [AnimationType.from(direction: .bottom, offset: 300*glscale)]
@IBOutlet weak var topBtn: UIButton!
......@@ -139,6 +139,7 @@ class CRKListVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,CR
let vc = CRKXiangQVC()
vc.isGm = isGm
vc.model = model
vc.status = model.status
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......
......@@ -8,10 +8,38 @@
import UIKit
class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,NewCKCellDelegate,PiCiXuanZeViewControllerDelegate{
class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,NewCKCellDelegate,PiCiXuanZeViewControllerDelegate,WarehoseMangementListVCDelegate,GLAlertSelectViewDelegate,GeliAlertTextViewDelegate{
func GLASClose(view: GLAlertSelectView, selectnum: Int, selectArr: Array<Int>) {
selectIdx = selectnum
view.removeFromSuperview()
glSelectView = nil
}
func WarehoseMangementListVCSelectFinish(sender: ShopWarehouseListDataModel, kuWeiArr: Array<ShopWarehouseDetailDataPositionModel>) {
wareHouseModel = sender
holderArr?.insert(sender.w_name!, at: 0)
holderArr?.remove(at: 1)
positionArr?.removeAll()
kuWeiArr.forEach { (item) in
positionArr?.append(item)
print(item.p_name)
}
listView.reloadData()
}
var selectIdx:Int?
var glSelectView:GLAlertSelectView? = nil
var positionArr:Array<ShopWarehouseDetailDataPositionModel>? = []//库位
var wareHouseModel:ShopWarehouseListDataModel?//仓库
var isGm:Bool?
var piCiArr:Array<GetGoodBatchDataModel> = []
var status:Int?
var piCiArr:Array<Array<GetGoodBatchDataModel>> = []//批次
@IBOutlet weak var btmView: UIView!
@IBOutlet weak var listView: UITableView!
var model:WarehouseIoListDataModel?
......@@ -23,6 +51,9 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
@IBOutlet weak var btmColor: UIView!
var titleArr:Array<String>? = []
var holderArr:Array<String>? = []
var outGoodsBatchArr:Array<Int>? = []
override func viewDidLoad() {
super.viewDidLoad()
......@@ -113,6 +144,7 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
let model = data as! OutGoodsDetailModel
model.data?.goods_res!.forEach({ (item) in
self.outGoodsModels?.append(item)
self.piCiArr.append([])
})
if self.isGm == false {
self.titleArr = ["出库类型","备注"]
......@@ -134,20 +166,86 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
@IBAction func crkxqBtnClick(_ sender: UIButton) {
if sender.tag == 1 {//不通过
}else{
if sender.tag == 0 {//通过
let alterView = GeliAlertTextView(frame: self.view.window!.bounds)
alterView.delegate = self
self.view.window?.addSubview(alterView)
}
}
func sureGeliAlertTextViewAction(sender: String) {
if sender.count > 0 {
let UserToken = UserDefaults.standard.value(forKey: "user_token")
//通过
if model?.io_type == 1 {//入库
}else{//出库
for item in piCiArr {
}
// let dict = ["user_token":UserToken as Any,"io_id":model?.io_id,"audit_remark":sender,"goods_info":]
// GoodsOutputAudit(<#T##params: [String : Any]##[String : Any]#>, success: <#T##(Any) -> ()#>, failture: <#T##(Error) -> ()#>)
}
}else{
HUD.flash(.label("请填写备注"), delay: 1.2)
}
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if isGm! && status! == 1{
if indexPath.section == 0 {
if indexPath.row == 0 {
let cell = tableView.cellForRow(at: indexPath) as! CRKBtnCell
if cell.nameLbl.text != "库位" && cell.nameLbl.text != "仓库"{
return
}
if indexPath.row == 0 {
let vc = WarehoseMangementListVC()
vc.isSelectWarehouse = true
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true)
}
if indexPath.row == 1 {
if positionArr!.count > 0 {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
if selectIdx != nil {
view.selectNum = selectIdx
view.tempNum = view.selectNum
}
view.isOnlySelectKuWei = true
view.delegate = self
view.titleLbl.text = "请选择库位"
var poiArr:Array<String> = []
print(positionArr?.count)
for item in positionArr! {
let str = item.p_name! + "(库存数:\(item.inventory_count!)"
poiArr.append(str)
}
view.dataArr = poiArr
self.view.addSubview(view)
glSelectView = view
}
}else{
HUD.flash(.label("请选择仓库"), delay: 1.2)
}
}
}
}
}
......@@ -170,12 +268,7 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
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{
if cell.nameLbl.text != "仓库" && cell.nameLbl.text != "库位" {
setCellUI(cell: cell)
}
return cell
......@@ -195,6 +288,11 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
cell.rkjg.text = "入库价格:¥" + data.amount!
cell.rkzj.text = "入库总价:¥" + data.subtotal!
cell.baozhiQ.text = "保质期:" + "\(data.shelf_life!)天"
let month = data.shelf_life!/30
if month > 0 {
cell.baozhiQ.text = "保质期:" + "\(month)月"
}
cell.baogao.text = "报告:无"
if data.report_sn != nil {
cell.baogao.text = "报告:" + "\(data.report_sn!)"
......@@ -210,6 +308,11 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
cell.rkjg.text = "入库价格:¥" + "\(model.amount!)"
cell.rkzj.text = "入库总价:¥" + "\(model.subtotal!)"
cell.baozhiQ.text = "保质期:" + "\(model.shelf_life!)天"
let month = model.shelf_life!/30
if month > 0 {
cell.baozhiQ.text = "保质期:" + "\(month)月"
}
cell.baogao.text = "报告:无"
if model.report_sn != nil {
cell.baogao.text = "报告:" + "\(model.report_sn!)"
......@@ -236,6 +339,11 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
cell.rkjg.text = "库位名:" + "\(model.p_name!)"
}
cell.rkzj.text = "保质期:" + "\(model.shelf_life!)天"
let month = model.shelf_life!/30
if month > 0 {
cell.rkzj.text = "保质期:" + "\(month)月"
}
cell.baozhiQ.text = "报告:无"
if model.report_sn != nil {
cell.baozhiQ.text = "报告:" + "\(model.report_sn!)"
......@@ -254,7 +362,8 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
cell.keChuKuLbl.text = "可出库数量:" + "\(data.inventory!)"
if piCiArr.count > 0 {
cell.piCiArr = piCiArr
let arr = piCiArr[indexPath.row]
cell.piCiArr = arr
cell.btmTitleView.alpha = 1
cell.btmListView.alpha = 1
}else{
......@@ -273,7 +382,9 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
let vc = PiCiXuanZeViewController()
vc.sku_id = data.sku_id
vc.delegate = self
vc.recordArr = piCiArr
vc.tag = cell.tag
let arr = piCiArr[cell.tag]
vc.recordArr = arr
self.navigationController?.pushViewController(vc, animated: true)
}
}
......@@ -311,8 +422,20 @@ class CRKXiangQVC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
cell.nameLeft.constant = 0
cell.contentRight.constant = -7
}
func PiCiXuanZeViewControllerPiCiSelect(data: Array<GetGoodBatchDataModel>) {
piCiArr = data
func PiCiXuanZeViewControllerPiCiSelect(data: Array<GetGoodBatchDataModel>, p_id: Int) {
piCiArr.insert(data, at: p_id)
piCiArr.remove(at: p_id + 1)
listView.reloadData()
}
func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
selectIdx = selectNum
let data = positionArr![selectIdx!]
holderArr?.insert(data.p_name!, at: 1)
holderArr?.remove(at: 2)
glSelectView?.removeFromSuperview()
glSelectView = nil
listView.reloadData()
}
}
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