Commit aa04e9fa authored by lujunye's avatar lujunye

采购详情

parent 7d892571
......@@ -12,6 +12,7 @@
E007B1D5248F6880004D14CC /* CGDDayCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E007B1D3248F6880004D14CC /* CGDDayCell.xib */; };
E007B1D8248F7276004D14CC /* CGDCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E007B1D6248F7276004D14CC /* CGDCell.swift */; };
E007B1D9248F7276004D14CC /* CGDCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E007B1D7248F7276004D14CC /* CGDCell.xib */; };
E007B1DB248F8F57004D14CC /* PurchaseInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = E007B1DA248F8F57004D14CC /* PurchaseInterface.swift */; };
E00B0B1B24629E99006DC846 /* SJMapCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00B0B1924629E99006DC846 /* SJMapCell.swift */; };
E00B0B1C24629E99006DC846 /* SJMapCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E00B0B1A24629E99006DC846 /* SJMapCell.xib */; };
E00CBA0124820CF000701D9D /* CRKSumCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E00CB9FF24820CF000701D9D /* CRKSumCell.swift */; };
......@@ -55,6 +56,8 @@
E0206335246CE45A007A40C4 /* HeaderOnlyTitleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0206334246CE45A007A40C4 /* HeaderOnlyTitleView.xib */; };
E0228BB0246FDA9A005812FA /* TitleAndLblCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0228BAE246FDA9A005812FA /* TitleAndLblCell.swift */; };
E0228BB1246FDA9A005812FA /* TitleAndLblCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0228BAF246FDA9A005812FA /* TitleAndLblCell.xib */; };
E0239202249069FD00C4C632 /* CGDXQVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0239200249069FD00C4C632 /* CGDXQVc.swift */; };
E0239203249069FD00C4C632 /* CGDXQVc.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0239201249069FD00C4C632 /* CGDXQVc.xib */; };
E0273DD824551B4C00B3FCAE /* SendTimeSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0273DD724551B4C00B3FCAE /* SendTimeSelectView.swift */; };
E0273DDA24551B6D00B3FCAE /* SendTimeSelectView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0273DD924551B6D00B3FCAE /* SendTimeSelectView.xib */; };
E0273DDD24551D4500B3FCAE /* OnlyLabelCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0273DDB24551D4500B3FCAE /* OnlyLabelCell.swift */; };
......@@ -536,6 +539,7 @@
E007B1D3248F6880004D14CC /* CGDDayCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CGDDayCell.xib; sourceTree = "<group>"; };
E007B1D6248F7276004D14CC /* CGDCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGDCell.swift; sourceTree = "<group>"; };
E007B1D7248F7276004D14CC /* CGDCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CGDCell.xib; sourceTree = "<group>"; };
E007B1DA248F8F57004D14CC /* PurchaseInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchaseInterface.swift; sourceTree = "<group>"; };
E00B0B1924629E99006DC846 /* SJMapCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SJMapCell.swift; sourceTree = "<group>"; };
E00B0B1A24629E99006DC846 /* SJMapCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SJMapCell.xib; sourceTree = "<group>"; };
E00CB9FF24820CF000701D9D /* CRKSumCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CRKSumCell.swift; sourceTree = "<group>"; };
......@@ -586,6 +590,8 @@
E0206334246CE45A007A40C4 /* HeaderOnlyTitleView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HeaderOnlyTitleView.xib; sourceTree = "<group>"; };
E0228BAE246FDA9A005812FA /* TitleAndLblCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleAndLblCell.swift; sourceTree = "<group>"; };
E0228BAF246FDA9A005812FA /* TitleAndLblCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TitleAndLblCell.xib; sourceTree = "<group>"; };
E0239200249069FD00C4C632 /* CGDXQVc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGDXQVc.swift; sourceTree = "<group>"; };
E0239201249069FD00C4C632 /* CGDXQVc.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CGDXQVc.xib; sourceTree = "<group>"; };
E0273DD724551B4C00B3FCAE /* SendTimeSelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendTimeSelectView.swift; sourceTree = "<group>"; };
E0273DD924551B6D00B3FCAE /* SendTimeSelectView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SendTimeSelectView.xib; sourceTree = "<group>"; };
E0273DDB24551D4500B3FCAE /* OnlyLabelCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnlyLabelCell.swift; sourceTree = "<group>"; };
......@@ -1473,6 +1479,15 @@
path = "下运单";
sourceTree = "<group>";
};
E04DFF092490695A002A6931 /* 采购单详情 */ = {
isa = PBXGroup;
children = (
E0239200249069FD00C4C632 /* CGDXQVc.swift */,
E0239201249069FD00C4C632 /* CGDXQVc.xib */,
);
path = "采购单详情";
sourceTree = "<group>";
};
E0516F742448000F00E373CE /* 支付账号(设置,修改) */ = {
isa = PBXGroup;
children = (
......@@ -1647,6 +1662,7 @@
F956D5BD246A3629003FF510 /* PersonCenterModel */,
F956D5BC246A35DB003FF510 /* GoodsManageMoel */,
F9171EFB245128B200359C2B /* Interface.swift */,
E007B1DA248F8F57004D14CC /* PurchaseInterface.swift */,
F9697243248F70C00010D39B /* VendorInterface.swift */,
E0AA3A88248F3E1400CBFC27 /* StatisticsInterface.swift */,
E0571C6D248DD4DE00E85711 /* AdressInterface.swift */,
......@@ -1685,6 +1701,7 @@
F94A315024626D4000FEC38E /* 工作中心 */,
E0707DC82462475700E039A8 /* 地图 */,
E0BE8A8D245A9B6500E80134 /* 应付账款 */,
E04DFF092490695A002A6931 /* 采购单详情 */,
E07B1E75245966C90055BA3C /* 新增采购单 */,
E07B1E64245925F30055BA3C /* 供应商管理 */,
E03549AA24582806008BD021 /* 客户管理 */,
......@@ -2686,6 +2703,7 @@
E0BE8A9D245A9E5900E80134 /* YingFuZhangKuanXQCell.xib in Resources */,
F96A5856247BBFFF0070A057 /* AddGuiGeCell.xib in Resources */,
E0A2E82824555B4400D6DB34 /* KuCunShangPinCell.xib in Resources */,
E0239203249069FD00C4C632 /* CGDXQVc.xib in Resources */,
E042F73D245288F800CDFA12 /* WenDuCell.xib in Resources */,
E02DDD92244FE55400ABB707 /* NewCreateHeader.xib in Resources */,
F9956B1C2463D941001A617D /* WorkSelectTimeView.xib in Resources */,
......@@ -3135,6 +3153,7 @@
E0CC847C24823087009B1FE9 /* GetGoodBatchModel.swift in Sources */,
E0AA3A89248F3E1400CBFC27 /* StatisticsInterface.swift in Sources */,
E0F8E91F248747D200817A08 /* NewCKVc.swift in Sources */,
E0239202249069FD00C4C632 /* CGDXQVc.swift in Sources */,
F956D5C0246A3789003FF510 /* OrderDetailModel.swift in Sources */,
E0DDCB1D244AE81800DF54C7 /* GuanLianKeHuCell.swift in Sources */,
E0D197BF2448431C002B080C /* BabyBluetooth.m in Sources */,
......@@ -3187,6 +3206,7 @@
F933F6CC2452C68B00189561 /* WindowRootViewController.swift in Sources */,
F956D5AE246A2D9C003FF510 /* LMNTextLine.m in Sources */,
F9531F442465108800724BEE /* JXPhotoBrowserFadeAnimator.swift in Sources */,
E007B1DB248F8F57004D14CC /* PurchaseInterface.swift in Sources */,
F956D5AD246A2D9C003FF510 /* LMNLine.m in Sources */,
E0CC848724823EC1009B1FE9 /* CRKCell.swift in Sources */,
E088CC8D24470BF0000DAA8A /* CodeView.swift in Sources */,
......
......@@ -144,5 +144,7 @@
<string>Finance/statistics</string>
<key>供应商列表 +详情</key>
<string>Vender/vendorList</string>
<key>新增采购单</key>
<string>Purchase/purchaseOrderAdd</string>
</dict>
</plist>
//
// PurchaseInterface.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/9.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import Alamofire
import SwiftyJSON
import ObjectMapper
//MARK:--供应商列表 +详情
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key(
//user_token(验证token)
//ven_id 供应商id
//purchase_time 采购时间,时间戳格式
purchaser 采购人
type 采购单类型:1临时采购,2固定采购
remarks 采购订单备注
is_apply 是否为申请,1申请,2非申请
goods_info 商品数据,json格式,字段见下表
goods_id 商品id
goods_name 商品名
sku_id 商品sku_id
sku_name 商品规格名
num 数量
unit 单位
price 价格(售价)
amount 采购价
*/
func purchaseOrderAdd(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("新增采购单", params, { (rep:DataResponse<UpDataModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
......@@ -8,7 +8,7 @@
import Foundation
import ObjectMapper
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单
class UpDataModel: Mappable {
var code:Int?
......
......@@ -237,10 +237,13 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
}
}
if deSelectArr.count > 0 {
cell.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
cell.selectBtn.isSelected = true
for i in deSelectArr {
if i == indexPath.row {
cell.titleLbl.textColor = UIColor(named: "#999999")
cell.selectBtn.isUserInteractionEnabled = false
cell.selectBtn.isSelected = false
}
}
}
......
<?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"/>
......@@ -10,7 +11,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TitleAndSelectCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TitleAndSelectCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<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">
......
......@@ -544,7 +544,8 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
self.navigationController?.pushViewController(vc, animated: true)
return
case 119: //新增采购单
let vc = XinCaiGouViewController()
let vc = CGDXQVc()
// let vc = XinCaiGouViewController()
self.navigationController?.pushViewController(vc, animated: true)
return
case 120: //商品毛利统计
......
......@@ -15,6 +15,7 @@ class CGDCell: UITableViewCell {
@IBAction func delAction(_ sender: UIButton) {
delegate?.CGDCellDelAction(cell: self)
}
@IBOutlet weak var lblRight: NSLayoutConstraint!
@IBOutlet weak var cgTotalPrice: UILabel!
@IBOutlet weak var cgPrice: UILabel!
@IBOutlet weak var cgCount: UILabel!
......
......@@ -39,15 +39,13 @@
<action selector="delAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="VeY-uG-gFs"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="53n-Ij-aLj">
<rect key="frame" x="15" y="15" width="296.5" height="37"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="53n-Ij-aLj">
<rect key="frame" x="15" y="15" width="311.5" height="37"/>
<constraints>
<constraint firstAttribute="height" constant="37" id="Cdm-G9-7ol"/>
<constraint firstAttribute="height" constant="37" id="2Td-7E-Tpz"/>
</constraints>
<string key="text">六和川香鸡柳2.5kg/六和川香鸡柳2.六和川香鸡柳2
kg/六和川香鸡六和川香鸡柳2.5kg/六和川香鸡六…</string>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="13"/>
<nil key="textColor"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uED-Ck-HCh">
......@@ -116,18 +114,18 @@ kg/六和川香鸡六和川香鸡柳2.5kg/六和川香鸡六…</string>
<constraint firstItem="kBE-rT-dOt" firstAttribute="top" secondItem="uED-Ck-HCh" secondAttribute="bottom" constant="10" id="DXT-Nj-hCW"/>
<constraint firstAttribute="trailing" secondItem="uED-Ck-HCh" secondAttribute="trailing" constant="15" id="Dzn-qc-0aj"/>
<constraint firstItem="xMe-fM-o6d" firstAttribute="centerX" secondItem="mJ8-AR-jCS" secondAttribute="centerX" id="E49-7P-0vg"/>
<constraint firstItem="53n-Ij-aLj" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="F36-ij-Hn0"/>
<constraint firstItem="zUM-gk-TDF" firstAttribute="leading" secondItem="53n-Ij-aLj" secondAttribute="trailing" id="FNm-yK-j5F"/>
<constraint firstAttribute="trailing" secondItem="zUM-gk-TDF" secondAttribute="trailing" id="GYX-Pp-TVw"/>
<constraint firstItem="zUM-gk-TDF" firstAttribute="leading" secondItem="53n-Ij-aLj" secondAttribute="trailing" constant="15" id="JH7-Ox-vgW"/>
<constraint firstItem="53n-Ij-aLj" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="IY9-Bn-zNP"/>
<constraint firstAttribute="trailing" secondItem="kBE-rT-dOt" secondAttribute="trailing" constant="15" id="Kjn-Yq-ekR"/>
<constraint firstItem="c2P-6b-lpC" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="LQH-t0-OEw"/>
<constraint firstAttribute="trailing" secondItem="c2P-6b-lpC" secondAttribute="trailing" id="Nfl-mv-J8f"/>
<constraint firstItem="uED-Ck-HCh" firstAttribute="top" secondItem="53n-Ij-aLj" secondAttribute="bottom" constant="5" id="OWh-uG-IlA"/>
<constraint firstItem="kBE-rT-dOt" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="ZH2-ul-Rc5"/>
<constraint firstItem="m0Z-19-yG6" firstAttribute="top" secondItem="kBE-rT-dOt" secondAttribute="bottom" constant="15" id="Zv2-hp-Kwg"/>
<constraint firstItem="uED-Ck-HCh" firstAttribute="top" secondItem="53n-Ij-aLj" secondAttribute="bottom" constant="5" id="c3e-zB-PD7"/>
<constraint firstItem="zUM-gk-TDF" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="gwz-w4-HaY"/>
<constraint firstItem="53n-Ij-aLj" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="i0z-WF-P7a"/>
<constraint firstItem="HF8-ja-1Mp" firstAttribute="top" secondItem="kBE-rT-dOt" secondAttribute="bottom" constant="15" id="j4F-Nl-GY1"/>
<constraint firstItem="53n-Ij-aLj" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="jb1-N1-bkz"/>
<constraint firstItem="m0Z-19-yG6" firstAttribute="centerX" secondItem="46J-ih-76e" secondAttribute="centerX" id="sq5-BU-PcI"/>
<constraint firstItem="uED-Ck-HCh" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="vb1-1w-P6S"/>
<constraint firstAttribute="bottom" secondItem="c2P-6b-lpC" secondAttribute="bottom" id="xqy-z2-fqO"/>
......@@ -141,6 +139,7 @@ kg/六和川香鸡六和川香鸡柳2.5kg/六和川香鸡六…</string>
<outlet property="cgPrice" destination="m0Z-19-yG6" id="zQy-Cc-uZQ"/>
<outlet property="cgTotalPrice" destination="xMe-fM-o6d" id="baZ-ZX-rbr"/>
<outlet property="detailLbl" destination="uED-Ck-HCh" id="zoK-Xu-ytf"/>
<outlet property="lblRight" destination="FNm-yK-j5F" id="Ax4-S8-T59"/>
<outlet property="nameLbl" destination="53n-Ij-aLj" id="aPc-sG-d9k"/>
</connections>
<point key="canvasLocation" x="132.60869565217394" y="132.58928571428572"/>
......@@ -156,6 +155,9 @@ kg/六和川香鸡六和川香鸡柳2.5kg/六和川香鸡六…</string>
<namedColor name="个人中心灰色字体">
<color red="0.3919999897480011" green="0.3919999897480011" blue="0.3919999897480011" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -9,8 +9,56 @@
import UIKit
class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,CGDCellDelegate,XuanZeShangPinViewControllerDelegate, ShowTimeSelectViewDelegate,GLAlertSelectViewDelegate, GYSListViewControllerDelegate{
class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,CGDCellDelegate,XuanZeShangPinViewControllerDelegate, ShowTimeSelectViewDelegate,GLAlertSelectViewDelegate, GYSListViewControllerDelegate,UITextFieldDelegate, GeliAlertViewDelegate{
func sureGeliAlertViewAction(sender: UIButton) {
let UserToken = UserDefaults.standard.value(forKey: "user_token")
var goodsInfoArr:Array<Any>? = []
datas.forEach { (model) in
let p = model.target_Price as! NSString
let amount = p.floatValue * Float(model.target_Count!)
let goods = [
"goods_id":model.goods_id as Any,
"sku_id":model.sku_id as Any,
"goods_name":model.goods_name as Any,
"sku_name":model.sku_attr as Any,
"num":model.target_Count as Any,
"unit":model.unit as Any,
"price":model.target_Price as Any,
"amount":amount as Any,
]
goodsInfoArr?.append(goods)
}
let goods_info = dataChangeString(sender: goodsInfoArr!)
let dict = [
"user_token":UserToken as Any,
"ven_id":vendor?.ven_id as Any,
"purchase_time":dayTime as Any,
"purchaser":cgName as Any,
"type":typeSelect! + 1 as Any,
"remarks":"" as Any,
"is_apply":1 as Any,
"goods_info":goods_info as Any
]
HUD.flash(.progress)
purchaseOrderAdd(dict, success: { (data) in
HUD.hide()
self.navigationController?.popViewController(animated: true)
}) { (error) in
}
}
func textFieldDidEndEditing(_ textField: UITextField) {
if textField.text!.containsEmoji {
HUD.flash(.label("不可输入表情符号"), delay: 1.2)
textField.text = ""
return
}
cgName = textField.text
listView.reloadData()
}
func GLASClose(view: GLAlertSelectView, selectnum: Int, selectArr: Array<Int>) {
typeSelect = selectnum
......@@ -44,13 +92,41 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
listView.reloadData()
}
var dayTimeStr = ""
var dayTime:Int?
var dayTime:Int?
var vendor:VendorListDataModel?
var glSelectView:GLAlertSelectView?
var typeSelect:Int?
var cgName:String?
//MARK: - 提交审核
@IBAction func submitAction(_ sender: Any) {
print("submit")
if dayTime == nil {
HUD.flash(.label("请选择时间"), delay: 1.2)
return
}
if vendor == nil {
HUD.flash(.label("请选择供应商"), delay: 1.2)
return
}
if cgName == nil {
HUD.flash(.label("请输入采购人姓名"), delay: 1.2)
return
}
if typeSelect == nil {
HUD.flash(.label("请选择采购类型"), delay: 1.2)
return
}
if datas.count == 0 {
HUD.flash(.label("请选择商品"), delay: 1.2)
return
}
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "是否提交申请?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "保存"), for: .normal)
self.view.window?.addSubview(alertView)
}
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var btmLine: UIView!
......@@ -87,10 +163,10 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
let time = TimeInterval(exactly:dayTime!)
timeSelectV.BeginDate = Date(timeIntervalSince1970: time!)
timeSelectV.EndDate = Date(timeIntervalSince1970: time!)//无用处
}
timeSelectV.endDateByWork = Date()
timeSelectV.titleLbl.text = "请选择采购日期"
timeSelectV.delegate = self
self.view.window?.addSubview(timeSelectV)
......@@ -123,7 +199,7 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
//MARK:--选择时间回调数据
func showTimeSelectByData(timeStr: String, beginDate: Date, endginDate: Date) {
let timeInterval:TimeInterval = beginDate.timeIntervalSince1970
print(timeStr,"采购日期",timeInterval)
......@@ -158,10 +234,13 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
cell.nameLbl.text = titleArr[indexPath.row]
cell.textTF.placeholder = holderArr[indexPath.row]
if indexPath.row == 3 {
if typeSelect != nil {
if typeSelect != nil && typeSelect != 10086{
cell.textTF.text = typeArr[typeSelect!]
}
cell.textTF.isUserInteractionEnabled = false
}else{
cell.textTF.delegate = self
cell.textTF.text = cgName
}
return cell
......@@ -252,9 +331,5 @@ class XinCaiGouViewController: BaseViewController,UITableViewDelegate,UITableVie
holderArr.remove(at: 2)
listView.reloadData()
}
}
//
// CGDXQVc.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/10.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAlertSelectViewDelegate {
@IBOutlet weak var btmView: UIView!
@IBOutlet weak var listView: UITableView!
let tArr = ["制单信息","商品信息"]
var glSelectView:GLAlertSelectView?
var datas:Array<Any> = [1,2]
//MARK: - cell delegate
var status = 1//审核状态
var titleArr = ["采购单号","采购日期","供应商","采购人","采购类型","支付方式","支付类型","备注"]
var holderArr = ["-","-","-","-","-","未支付","未付款","-"]
let zfTypeArr = ["未付款","欠款","月结","已付款"]
let zfWayArr = ["未支付","现金","转账(私)","转账(公)","转账(微信)","转账(支付宝)"]
var payType = 0//支付方式
var payStatus = 0//支付状态
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "采购单详情"
self.view.addSubview(navbar)
SetTopFrameView(view: listView, btmView: btmView)
listView.separatorStyle = .none
listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
listView.register(UINib(nibName: "TitleAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndBtnCell")
listView.register(UINib(nibName: "CGDCell", bundle: nil), forCellReuseIdentifier: "CGDCell")
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
if indexPath.row == 5 || indexPath.row == 6 {
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndBtnCell") as! TitleAndBtnCell
cell.nameLbl.text = titleArr[indexPath.row]
cell.contentLbl.text = holderArr[indexPath.row]
cell.btn.isUserInteractionEnabled = false
return cell
}else{
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = titleArr[indexPath.row]
cell.textTF.isUserInteractionEnabled = false
cell.textTF.text = holderArr[indexPath.row]
return cell
}
}
let cell = tableView.dequeueReusableCell(withIdentifier: "CGDCell") as! CGDCell
cell.btnWidth.constant = 0
cell.lblRight.constant = 15
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 {
if indexPath.row == 6 {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.tag = 100
view.delegate = self
if payStatus != 0 {
view.deSelectArr = [0,1,2]
}
view.selectNum = payType
view.tempNum = view.selectNum
view.titleLbl.text = "请选择支付状态"
view.dataArr = zfTypeArr
self.view.addSubview(view)
glSelectView = view
}
}
if indexPath.row == 5 {
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.tag = 999
view.delegate = self
view.selectNum = payStatus
view.tempNum = view.selectNum
view.titleLbl.text = "请选择支付方式"
view.dataArr = zfWayArr
self.view.addSubview(view)
glSelectView = view
}
}
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if status == 0 {//审核中
if indexPath.section == 0 {
if indexPath.row == 5 || indexPath.row == 6 {
return 0
}else{
if indexPath.section == 1 {
return 174
}else{
return 49
}
}
}
}else{
if indexPath.section == 1 {
return 174
}else{
return 49
}
}
return 0
}
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return 8
}
return datas.count
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 10))
view.backgroundColor = UIColor(named: "app底色")
return view
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 10
}
func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
if view.tag == 999 {
payStatus = selectNum
holderArr.insert(zfWayArr[payStatus], at: 5)
holderArr.remove(at: 6)
if payStatus != 0 {
payType = 3
}else{
payType = 0
}
holderArr.insert(zfTypeArr[payType], at: 6)
holderArr.remove(at: 7)
}else{
if payStatus == 0 {
payType = selectNum
holderArr.insert(zfTypeArr[payType], at: 6)
holderArr.remove(at: 7)
}
}
listView.reloadData()
view.removeFromSuperview()
glSelectView = nil
}
func GLASClose(view: GLAlertSelectView, selectnum: Int, selectArr: Array<Int>) {
if selectnum != 10086 {
if view.titleLbl.text == "请选择支付状态" {
payStatus = selectnum
}
if view.titleLbl.text == "请选择支付方式" {
payType = selectnum
}
}
view.removeFromSuperview()
glSelectView = nil
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: fullScreenWidth, height: 39))
view.backgroundColor = UIColor.white
let lbl = UILabel(frame: CGRect(x: 15, y: 15, width: fullScreenWidth, height: 21))
lbl.text = tArr[section]
lbl.textColor = UIColor(named: "标题字颜色")
lbl.font = UIFont.boldSystemFont(ofSize: 15)
view.addSubview(lbl)
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 39
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<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="CGDXQVc" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="btmView" destination="AfC-cy-CDK" id="OZa-qe-r81"/>
<outlet property="listView" destination="xUS-ih-bIA" id="8g9-zc-R5S"/>
<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="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XSf-8D-3tt">
<rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AfC-cy-CDK">
<rect key="frame" x="0.0" y="813" width="414" height="49"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dwq-B6-yP1">
<rect key="frame" x="0.0" y="0.0" width="414" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="RaB-iP-LUm"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Dwq-B6-yP1" firstAttribute="top" secondItem="AfC-cy-CDK" secondAttribute="top" id="Uwq-mr-1EE"/>
<constraint firstAttribute="trailing" secondItem="Dwq-B6-yP1" secondAttribute="trailing" id="jWB-aj-AFy"/>
<constraint firstItem="Dwq-B6-yP1" firstAttribute="leading" secondItem="AfC-cy-CDK" secondAttribute="leading" id="mGr-13-dXP"/>
<constraint firstAttribute="height" constant="49" id="nCB-Nc-mxK"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="xUS-ih-bIA">
<rect key="frame" x="0.0" y="44" width="414" height="769"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="gjW-9u-BlI"/>
<outlet property="delegate" destination="-1" id="408-BM-NmJ"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="AfC-cy-CDK" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="94h-1F-uZH"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="AfC-cy-CDK" secondAttribute="bottom" id="EHY-yk-VSm"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="AfC-cy-CDK" secondAttribute="trailing" id="FFt-14-zJ8"/>
<constraint firstAttribute="bottom" secondItem="XSf-8D-3tt" secondAttribute="bottom" id="NKW-oC-1Zi"/>
<constraint firstItem="xUS-ih-bIA" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Usu-TP-BXo"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="xUS-ih-bIA" secondAttribute="trailing" id="dfz-H0-dvM"/>
<constraint firstItem="XSf-8D-3tt" firstAttribute="top" secondItem="AfC-cy-CDK" secondAttribute="top" id="fbS-Mw-bYd"/>
<constraint firstItem="XSf-8D-3tt" firstAttribute="top" secondItem="xUS-ih-bIA" secondAttribute="bottom" id="sai-re-htA"/>
<constraint firstAttribute="trailing" secondItem="XSf-8D-3tt" secondAttribute="trailing" id="vVr-L7-EE6"/>
<constraint firstItem="XSf-8D-3tt" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="y6Y-uT-HXY"/>
<constraint firstItem="xUS-ih-bIA" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="yAf-Sd-CdE"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="131.8840579710145" y="96.428571428571431"/>
</view>
</objects>
<resources>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</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