Commit 114609f9 authored by lujunye's avatar lujunye

补充修改采购单UI

parent 8da510de
...@@ -46,7 +46,8 @@ class PurchaseOrderListDataModel: Mappable { ...@@ -46,7 +46,8 @@ class PurchaseOrderListDataModel: Mappable {
var ven_name : String? //供应商名 var ven_name : String? //供应商名
var goods_res :Array<PurchaseOrderListDataItemsModel>? var goods_res :Array<PurchaseOrderListDataItemsModel>?
var purchase_time:Int?
var remarks:String?
required init?( map: Map) { required init?( map: Map) {
...@@ -71,6 +72,9 @@ class PurchaseOrderListDataModel: Mappable { ...@@ -71,6 +72,9 @@ class PurchaseOrderListDataModel: Mappable {
type <- map["type"] type <- map["type"]
ven_name <- map["ven_name"] ven_name <- map["ven_name"]
goods_res <- map["goods_res"] goods_res <- map["goods_res"]
purchase_time <- map["purchase_time"]
remarks <- map["remarks"]
} }
} }
......
...@@ -15,7 +15,7 @@ import ObjectMapper ...@@ -15,7 +15,7 @@ import ObjectMapper
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可 /* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key( //params-key(
//user_token(验证token) //user_token(验证token)
page 页数 page 页数
keyword 搜索关键词 keyword 搜索关键词
*/ */
func accountsPayableList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) { func accountsPayableList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
...@@ -31,7 +31,7 @@ func accountsPayableList(_ params:[String:Any],success:@escaping (_ res:Any)->() ...@@ -31,7 +31,7 @@ func accountsPayableList(_ params:[String:Any],success:@escaping (_ res:Any)->()
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可 /* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key( //params-key(
//user_token(验证token) //user_token(验证token)
page 页数 page 页数
keyword 搜索关键词 keyword 搜索关键词
*/ */
func accountsPayableDetail(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) { func accountsPayableDetail(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
......
...@@ -25,7 +25,7 @@ class accountsPayableListModel: Mappable { ...@@ -25,7 +25,7 @@ class accountsPayableListModel: Mappable {
} }
class accountsPayableDataModel: Mappable { class accountsPayableDataModel: Mappable {
var vendor_res:Array<accountsPayableListDataModel>? var vendor_res:Array<accountsPayableListDataModel>?
var total_payable_money : Float? var total_payable_money : Float? //当前欠款金额总计
required init?( map: Map) { required init?( map: Map) {
...@@ -37,9 +37,9 @@ class accountsPayableDataModel: Mappable { ...@@ -37,9 +37,9 @@ class accountsPayableDataModel: Mappable {
} }
} }
class accountsPayableListDataModel: Mappable { class accountsPayableListDataModel: Mappable {
var ven_id:Int? var ven_id:Int? //供应商id
var ven_name : String? var ven_name : String?//供应商名
var payable_money : String? var payable_money : String? //欠款金额
required init?( map: Map) { required init?( map: Map) {
...@@ -70,8 +70,8 @@ class accountsPayableDetailModel: Mappable { ...@@ -70,8 +70,8 @@ class accountsPayableDetailModel: Mappable {
class accountsPayableDetailDataModel: Mappable { class accountsPayableDetailDataModel: Mappable {
var list:Array<accountsPayableDetailDataListModel>? var list:Array<accountsPayableDetailDataListModel>?
var payable :String? var payable :String? //当前应付款余额总计
var already :Float? var already :Float?//已付应付款
required init?( map: Map) { required init?( map: Map) {
...@@ -85,16 +85,16 @@ class accountsPayableDetailDataModel: Mappable { ...@@ -85,16 +85,16 @@ class accountsPayableDetailDataModel: Mappable {
class accountsPayableDetailDataListModel: Mappable { class accountsPayableDetailDataListModel: Mappable {
var ven_id_log:Int? var ven_id_log:Int?
var ven_id :Int? var ven_id :Int?//供应商id
var po_id :Int? var po_id :Int?//采购单id
var money:String? var money:String?//金额(根据类型应付已付决定)
var type :Int? var type :Int?//类型:1应付 2已付
var create_time :Double? var create_time :Double? //时间
var payable_money:String? var payable_money:String? //欠款额
var status :Int? var status :Int? //支付状态:1应付未付 2应付已付
var po_no :String? var po_no :String? //采购单号
required init?( map: Map) { required init?( map: Map) {
......
...@@ -21,7 +21,9 @@ class TitleAndTFCell: UITableViewCell { ...@@ -21,7 +21,9 @@ class TitleAndTFCell: UITableViewCell {
textTF.addTarget(self, action: #selector(textChange(textField:)), for: .allEditingEvents) textTF.addTarget(self, action: #selector(textChange(textField:)), for: .allEditingEvents)
} }
@objc func textChange(textField:UITextField){ @objc func textChange(textField:UITextField){
delegate?.textFieldContent?(content: textField.text!, cell: self) delegate?.textFieldContent?(content: textField.text!, cell: self)
} }
......
...@@ -25,14 +25,14 @@ ...@@ -25,14 +25,14 @@
<constraint firstAttribute="height" constant="1" id="qV8-4M-UFb"/> <constraint firstAttribute="height" constant="1" id="qV8-4M-UFb"/>
</constraints> </constraints>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="标题:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6wI-Bk-Hnz"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="标题:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6wI-Bk-Hnz">
<rect key="frame" x="15" y="17" width="40" height="16"/> <rect key="frame" x="15" y="15" width="40" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入内容" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Q6V-I9-aNd"> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入内容" textAlignment="right" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="Q6V-I9-aNd">
<rect key="frame" x="65" y="15.5" width="295" height="19"/> <rect key="frame" x="266.5" y="15.5" width="93.5" height="19"/>
<color key="textColor" name="标题字颜色"/> <color key="textColor" name="标题字颜色"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
...@@ -42,9 +42,8 @@ ...@@ -42,9 +42,8 @@
<constraint firstAttribute="trailing" secondItem="Q6V-I9-aNd" secondAttribute="trailing" constant="15" id="91e-XA-Iqf"/> <constraint firstAttribute="trailing" secondItem="Q6V-I9-aNd" secondAttribute="trailing" constant="15" id="91e-XA-Iqf"/>
<constraint firstAttribute="trailing" secondItem="zvz-cN-gmt" secondAttribute="trailing" id="91g-iJ-e2S"/> <constraint firstAttribute="trailing" secondItem="zvz-cN-gmt" secondAttribute="trailing" id="91g-iJ-e2S"/>
<constraint firstItem="zvz-cN-gmt" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Mua-VI-kn3"/> <constraint firstItem="zvz-cN-gmt" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Mua-VI-kn3"/>
<constraint firstItem="6wI-Bk-Hnz" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="OKy-c6-FsX"/> <constraint firstItem="6wI-Bk-Hnz" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="NXV-5U-lIO"/>
<constraint firstItem="Q6V-I9-aNd" firstAttribute="leading" secondItem="6wI-Bk-Hnz" secondAttribute="trailing" constant="10" id="RC6-xh-0Q7"/> <constraint firstItem="6wI-Bk-Hnz" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="PBH-Gt-wO7"/>
<constraint firstItem="6wI-Bk-Hnz" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="Z1h-nD-Y6S"/>
<constraint firstItem="Q6V-I9-aNd" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="lmF-E2-VqK"/> <constraint firstItem="Q6V-I9-aNd" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="lmF-E2-VqK"/>
<constraint firstAttribute="bottom" secondItem="zvz-cN-gmt" secondAttribute="bottom" id="oe1-RM-1UU"/> <constraint firstAttribute="bottom" secondItem="zvz-cN-gmt" secondAttribute="bottom" id="oe1-RM-1UU"/>
</constraints> </constraints>
...@@ -55,7 +54,7 @@ ...@@ -55,7 +54,7 @@
<outlet property="nameLbl" destination="6wI-Bk-Hnz" id="W9P-gn-wOa"/> <outlet property="nameLbl" destination="6wI-Bk-Hnz" id="W9P-gn-wOa"/>
<outlet property="textTF" destination="Q6V-I9-aNd" id="Qep-Os-9qk"/> <outlet property="textTF" destination="Q6V-I9-aNd" id="Qep-Os-9qk"/>
</connections> </connections>
<point key="canvasLocation" x="133" y="104"/> <point key="canvasLocation" x="132.60869565217394" y="103.79464285714285"/>
</tableViewCell> </tableViewCell>
</objects> </objects>
<resources> <resources>
......
...@@ -87,7 +87,7 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB ...@@ -87,7 +87,7 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB
let mo = dataArr[indexPath.row] let mo = dataArr[indexPath.row]
cell.nameLbl.text = mo.ven_name! cell.nameLbl.text = mo.ven_name!
if mo.payable_money != "0.00" { if mo.payable_money != "0.00" {
cell.priceLbl.text = -" + mo.payable_money! cell.priceLbl.text = "¥" + mo.payable_money!
}else{ }else{
cell.priceLbl.text = "¥0" cell.priceLbl.text = "¥0"
} }
...@@ -150,7 +150,7 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB ...@@ -150,7 +150,7 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB
model.data?.vendor_res?.forEach({ (model) in model.data?.vendor_res?.forEach({ (model) in
self.dataArr.append(model) self.dataArr.append(model)
}) })
self.totalPriceLbl.text = -\(model.data!.total_payable_money!)" self.totalPriceLbl.text = \(model.data!.total_payable_money!)"
self.listView.reloadData() self.listView.reloadData()
self.listView.mj_header?.endRefreshing() self.listView.mj_header?.endRefreshing()
self.page = 2 self.page = 2
......
...@@ -10,9 +10,6 @@ import UIKit ...@@ -10,9 +10,6 @@ import UIKit
class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource,YingFuZhangKuanXQCellDelegate,GLAlertSelectViewDelegate{ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDelegate,UITableViewDataSource,YingFuZhangKuanXQCellDelegate,GLAlertSelectViewDelegate{
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
var ven_id:Int? var ven_id:Int?
...@@ -24,10 +21,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea ...@@ -24,10 +21,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
glSelectView = nil glSelectView = nil
} }
func GLAlertSelectViewFinish(sender:UIButton,title:String,cellTag:Int) { func GLAlertSelectViewFinish(sender:UIButton,title:String,cellTag:Int) {
HUD.flash(.progress) HUD.flash(.progress)
var dict = ["user_token":UserToken as Any] var dict = ["user_token":UserToken as Any]
...@@ -40,9 +34,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea ...@@ -40,9 +34,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
payStatus(dict, success: { (data) in payStatus(dict, success: { (data) in
HUD.hide() HUD.hide()
self.listView.mj_header?.beginRefreshing() self.listView.mj_header?.beginRefreshing()
}) { (err) in }) { (err) in}
}
break break
case "设置未收款": case "设置未收款":
let model = dataArr[cellTag] let model = dataArr[cellTag]
...@@ -52,9 +44,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea ...@@ -52,9 +44,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
payStatus(dict, success: { (data) in payStatus(dict, success: { (data) in
HUD.hide() HUD.hide()
self.listView.mj_header?.beginRefreshing() self.listView.mj_header?.beginRefreshing()
}) { (err) in }) { (err) in}
}
break break
case "收款": case "收款":
break break
...@@ -68,7 +58,6 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea ...@@ -68,7 +58,6 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
} }
let payTypeArr = ["已付款","未付款"] let payTypeArr = ["已付款","未付款"]
let typeArr = ["现金","转账(私)","转账(公)","转账(微信)","转账(支付宝)"] let typeArr = ["现金","转账(私)","转账(公)","转账(微信)","转账(支付宝)"]
var glSelectView:GLAlertSelectView? var glSelectView:GLAlertSelectView?
var navTitle:String = "" var navTitle:String = ""
...@@ -130,7 +119,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea ...@@ -130,7 +119,7 @@ class YingFuZhangKuanXQViewController:BaseViewController,UISearchBarDelegate,Sea
make.width.equalTo(title.bounds.size.width) make.width.equalTo(title.bounds.size.width)
} }
let ti1 = UILabel() let ti1 = UILabel()
ti1.text = -\(first)" ti1.text = \(first)"
ti1.font = UIFont.boldSystemFont(ofSize: 13) ti1.font = UIFont.boldSystemFont(ofSize: 13)
ti1.textColor = UIColor(named: "#F57575") ti1.textColor = UIColor(named: "#F57575")
view.addSubview(ti1) view.addSubview(ti1)
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="XinCaiGouViewController" customModule="TestClass" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="XinCaiGouViewController" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="btmLbl" destination="0WX-TF-5sE" id="W9q-HT-jbp"/>
<outlet property="btmLine" destination="cSW-1R-48s" id="W3Q-FC-Bvs"/> <outlet property="btmLine" destination="cSW-1R-48s" id="W3Q-FC-Bvs"/>
<outlet property="listView" destination="Cs6-iU-pYN" id="3RO-hA-kcA"/> <outlet property="listView" destination="Cs6-iU-pYN" id="3RO-hA-kcA"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
...@@ -25,9 +26,12 @@ ...@@ -25,9 +26,12 @@
<rect key="frame" x="0.0" y="813" width="414" height="83"/> <rect key="frame" x="0.0" y="813" width="414" height="83"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="NO"/> <userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
<userDefinedRuntimeAttribute type="color" keyPath="bgColor"> <userDefinedRuntimeAttribute type="color" keyPath="gradientStartColor">
<color key="value" name="白色背景色"/> <color key="value" name="按钮渐变色上"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="gradientEndColor">
<color key="value" name="按钮渐变色下,字体颜色"/>
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
<connections> <connections>
...@@ -40,7 +44,7 @@ ...@@ -40,7 +44,7 @@
<constraint firstAttribute="height" constant="49" id="vbT-1r-JRY"/> <constraint firstAttribute="height" constant="49" id="vbT-1r-JRY"/>
</constraints> </constraints>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/> <fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="17"/>
<color key="textColor" name="蓝色字体颜色"/> <color key="textColor" name="白色背景色"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cSW-1R-48s"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cSW-1R-48s">
...@@ -81,14 +85,17 @@ ...@@ -81,14 +85,17 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<namedColor name="按钮渐变色上">
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线"> <namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="白色背景色"> <namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources> </resources>
</document> </document>
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
import UIKit import UIKit
import ViewAnimator //cell动效 import ViewAnimator //cell动效
class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource, GeliAlertViewDelegate,CGDListCellDelegate,CGDXQVcDelegate { class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource, GeliAlertViewDelegate,CGDListCellDelegate,CGDXQVcDelegate,XinCaiGouViewControllerDelegate {
func XinCaiGouViewControllerFinish() {
listView.mj_header?.beginRefreshing()
}
func sureGeliAlertViewAction(sender: UIButton) { func sureGeliAlertViewAction(sender: UIButton) {
let dict = ["user_token":UserToken as Any,"po_id":sender.tag as Any] let dict = ["user_token":UserToken as Any,"po_id":sender.tag as Any]
...@@ -121,7 +125,7 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource ...@@ -121,7 +125,7 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
case 1: case 1:
btnStr = ["修改信息","取消"] btnStr = ["修改信息","取消"]
break break
case 2://入库状态(1未入库,2部分入库,3已入库) case 2,5://入库状态(1未入库,2部分入库,3已入库)
switch model.push_status { switch model.push_status {
case 1: case 1:
btnStr = ["查看详情","入库",] btnStr = ["查看详情","入库",]
...@@ -138,26 +142,26 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource ...@@ -138,26 +142,26 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
btnStr = ["查看详情"] btnStr = ["查看详情"]
break break
default: default:
btnStr = ["查看详情"]
break break
} }
cell.delegate = self cell.delegate = self
cell.setCGDBtnUI(arr: btnStr, index: indexPath.row) cell.setCGDBtnUI(arr: btnStr, index: indexPath.row)
return cell return cell
} }
var isPowerful = false
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = datas[indexPath.row] let model = datas[indexPath.row]
let vc = CGDXQVc() let vc = CGDXQVc()
vc.po_id = model.po_id vc.po_id = model.po_id
vc.delegate = self vc.delegate = self
var btnStr:Array<String> = [] var btnStr:Array<String> = []
switch model.order_status { switch model.order_status {
//订单状态(1未审核,2审核通过,3审核不通过,4已撤销,5已完成) //订单状态(1未审核,2审核通过,3审核不通过,4已撤销,5已完成)
case 1: case 1:
// if 权限 { if isPowerful {
btnStr = ["不通过","通过"] btnStr = ["不通过","通过"]
// } }
break break
case 2://入库状态(1未入库,2部分入库,3已入库) case 2://入库状态(1未入库,2部分入库,3已入库)
switch model.push_status { switch model.push_status {
...@@ -200,7 +204,36 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource ...@@ -200,7 +204,36 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
break break
case "修改信息": case "修改信息":
let vc = XinCaiGouViewController()
vc.delegate = self
vc.cgName = model.purchaser!
vc.orderNum = model.po_no!
if model.ven_id != nil {
vc.ven_id = model.ven_id!
}
vc.ven_name = model.ven_name!
vc.dayTime = model.purchase_time!
vc.contentStr = model.remarks!
if model.type != nil {
vc.typeSelect = model.type! - 1
}
model.goods_res?.forEach({ (item) in
let dict = [
"goods_name":item.goods_name,
"goods_id":item.goods_id,
"sku_id":item.sku_id,
"spec_str":item.sku_name,
"unit":item.unit,
"price":item.price,
"target_Count":item.num,
"target_Price":item.amount
] as [String : Any]
let mo = GetGoodsInfoDataModel(JSON: dict)
vc.datas.append(mo!)
})
self.navigationController?.pushViewController(vc, animated: true)
break break
case "取消": case "取消":
...@@ -280,7 +313,7 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource ...@@ -280,7 +313,7 @@ class CGDListVC: BaseViewController , UITableViewDelegate, UITableViewDataSource
//MARK:--加载更多数据 //MARK:--加载更多数据
@objc func loadMoreData(){ @objc func loadMoreData(){
print("加载更多数据") print("加载更多数据")
let dic = ["user_token":UserToken as Any,"keyword":keyword as Any,"page":page as Any,"order_status":orderStatus as Any] let dic = ["user_token":UserToken as Any,"keyword":keyword as Any,"page":page as Any,"order_status":orderStatus as Any]
purchaseOrderList(dic, success: { (data) in purchaseOrderList(dic, success: { (data) in
let model = data as! PurchaseOrderListModel let model = data as! PurchaseOrderListModel
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<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"> <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> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CGDListVC" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CGDListVC" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="132" y="108"/>
</view> </view>
</objects> </objects>
</document> </document>
...@@ -9,7 +9,12 @@ ...@@ -9,7 +9,12 @@
import UIKit import UIKit
import Parchment import Parchment
class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBarViewDelegate, PagingViewControllerDelegate { class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBarViewDelegate, PagingViewControllerDelegate ,XinCaiGouViewControllerDelegate{
func XinCaiGouViewControllerFinish() {
let vc = viewControllers[selectIndex]
vc.listView.mj_header?.beginRefreshing()
}
@IBOutlet weak var contentView: UIView! @IBOutlet weak var contentView: UIView!
@IBOutlet weak var searchBg: UIView! @IBOutlet weak var searchBg: UIView!
func clearSearchAction() { func clearSearchAction() {
...@@ -38,6 +43,7 @@ class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBar ...@@ -38,6 +43,7 @@ class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBar
var searchV : SearchBarView? = nil var searchV : SearchBarView? = nil
func rightBtnClick() { func rightBtnClick() {
let vc = XinCaiGouViewController() let vc = XinCaiGouViewController()
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
override func viewDidLoad() { override func viewDidLoad() {
...@@ -77,26 +83,8 @@ class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBar ...@@ -77,26 +83,8 @@ class CGDListViewController: BaseViewController ,UISearchBarDelegate, SearchBar
contentView.constrainToEdges(pagingViewController.view) contentView.constrainToEdges(pagingViewController.view)
pagingViewController.didMove(toParent: self) pagingViewController.didMove(toParent: self)
pagingVC = pagingViewController pagingVC = pagingViewController
// //MARK:--添加个刷新通知
// NotificationCenter.default.addObserver(self, selector: #selector(refreshingByCGDHavChange), name: NSNotification.Name(rawValue: "cgdChange"), object: nil)
//
// //跳转对应的头部视图
// NotificationCenter.default.addObserver(self, selector: #selector(CgdNavChange), name: NSNotification.Name(rawValue: "cgdNavChange"), object: nil)
} }
// @objc func CgdNavChange(notion:Notification){
// let dic = notion.userInfo
// pagingVC!.select(index: dic!["tag"] as Any as! Int, animated: true)
// }
//
// @objc func refreshingByCGDHavChange(){
// viewControllers.forEach { (vc) in
// vc.isUpData = false
// }
// }
//MAKR:--调起搜索后添加个蒙版本 //MAKR:--调起搜索后添加个蒙版本
var blackBtnView:UIButton! = nil var blackBtnView:UIButton! = nil
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool { func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
......
...@@ -73,21 +73,21 @@ class CGDListCell: UITableViewCell { ...@@ -73,21 +73,21 @@ class CGDListCell: UITableViewCell {
rightBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13) rightBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
rightBtn.layer.cornerRadius = 2 rightBtn.layer.cornerRadius = 2
rightBtn.isUserInteractionEnabled = true rightBtn.isUserInteractionEnabled = true
if str as! String == "查看详情"{ if str == "查看详情"{
rightBtn.setTitle(str, for: .normal) rightBtn.setTitle(str, for: .normal)
rightBtn.isUserInteractionEnabled = false rightBtn.isUserInteractionEnabled = false
}else if str as! String == "修改信息"{ }else if str == "修改信息"{
rightBtn.setTitle(str, for: .normal) rightBtn.setTitle(str, for: .normal)
rightBtn.setTitleColor(UIColor.white, for: .normal) rightBtn.setTitleColor(UIColor.white, for: .normal)
rightBtn.backgroundColor = UIColor.init(named: "按钮渐变色上") rightBtn.backgroundColor = UIColor.init(named: "按钮渐变色上")
rightBtn.layer.borderColor = UIColor.init(named: "按钮渐变色上")?.cgColor rightBtn.layer.borderColor = UIColor.init(named: "按钮渐变色上")?.cgColor
}else if str as! String == "取消"{ }else if str == "取消"{
rightBtn.setTitle(str, for: .normal) rightBtn.setTitle(str, for: .normal)
}else if str as! String == "撤销入库"{ }else if str == "撤销入库"{
rightBtn.setTitle(str, for: .normal) rightBtn.setTitle(str, for: .normal)
}else if str as! String == "入库"{ }else if str == "入库"{
rightBtn.setTitle(str, for: .normal) rightBtn.setTitle(str, for: .normal)
}else if str as! String == "补录入库"{ }else if str == "补录入库"{
rightBtn.setTitle(str, for: .normal) rightBtn.setTitle(str, for: .normal)
} }
...@@ -132,16 +132,16 @@ class CGDListCell: UITableViewCell { ...@@ -132,16 +132,16 @@ class CGDListCell: UITableViewCell {
rightBtn.setTitleColor(UIColor.init(named: "按钮渐变色上"), for: .normal) rightBtn.setTitleColor(UIColor.init(named: "按钮渐变色上"), for: .normal)
rightBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13) rightBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
rightBtn.layer.cornerRadius = 2 rightBtn.layer.cornerRadius = 2
if str as! String == "查看详情"{ if str == "查看详情"{
rightBtn.setTitle("查看详情", for: .normal) rightBtn.setTitle("查看详情", for: .normal)
}else if str as! String == "确认订单"{ }else if str == "确认订单"{
rightBtn.setTitle("确认订单", for: .normal) rightBtn.setTitle("确认订单", for: .normal)
rightBtn.setTitleColor(UIColor.white, for: .normal) rightBtn.setTitleColor(UIColor.white, for: .normal)
rightBtn.backgroundColor = UIColor.init(named: "按钮渐变色上") rightBtn.backgroundColor = UIColor.init(named: "按钮渐变色上")
rightBtn.layer.borderColor = UIColor.init(named: "按钮渐变色上")?.cgColor rightBtn.layer.borderColor = UIColor.init(named: "按钮渐变色上")?.cgColor
}else if str as! String == "取消订单"{ }else if str == "取消订单"{
rightBtn.setTitle("取消订单", for: .normal) rightBtn.setTitle("取消订单", for: .normal)
}else if str as! String == "付款码"{ }else if str == "付款码"{
rightBtn.setTitle("付款码", for: .normal) rightBtn.setTitle("付款码", for: .normal)
} }
btnBgView.addSubview(rightBtn) btnBgView.addSubview(rightBtn)
......
...@@ -11,6 +11,7 @@ protocol CGDXQVcDelegate { ...@@ -11,6 +11,7 @@ protocol CGDXQVcDelegate {
func CGDXQVcFinishAction() func CGDXQVcFinishAction()
} }
class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAlertSelectViewDelegate,GeliAlertTextViewDelegate,GeliAlertViewDelegate { class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAlertSelectViewDelegate,GeliAlertTextViewDelegate,GeliAlertViewDelegate {
func sureGeliAlertViewAction(sender: UIButton) { func sureGeliAlertViewAction(sender: UIButton) {
let dict = ["user_token":UserToken as Any,"po_id":po_id as Any] let dict = ["user_token":UserToken as Any,"po_id":po_id as Any]
backOut(dict, success: { (data) in backOut(dict, success: { (data) in
...@@ -170,7 +171,12 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl ...@@ -170,7 +171,12 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
self.holderArr.insert("固定采购", at: 4) self.holderArr.insert("固定采购", at: 4)
self.holderArr.remove(at: 5) self.holderArr.remove(at: 5)
} }
self.payFs = mo!.pay_type!
self.payZt = mo!.pay_status! - 1
self.holderArr.insert(self.zfWayArr[self.payFs], at: 5)
self.holderArr.remove(at: 6)
self.holderArr.insert(self.zfTypeArr[self.payZt], at: 6)
self.holderArr.remove(at: 7)
if mo!.remarks!.count > 0 { if mo!.remarks!.count > 0 {
self.holderArr.insert(mo!.remarks!, at: 7) self.holderArr.insert(mo!.remarks!, at: 7)
self.holderArr.remove(at: 8) self.holderArr.remove(at: 8)
...@@ -218,7 +224,7 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl ...@@ -218,7 +224,7 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
return cell return cell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if model?.order_status != 2 { if model?.order_status != 2 && model?.order_status != 5{
return return
} }
if indexPath.section == 0 { if indexPath.section == 0 {
...@@ -228,8 +234,11 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl ...@@ -228,8 +234,11 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
view.tag = 100 view.tag = 100
view.delegate = self view.delegate = self
view.selectNum = payZt view.selectNum = payZt
view.isYsYf = true
view.tempNum = view.selectNum view.tempNum = view.selectNum
view.cellTag = payZt
view.titleLbl.text = "请选择支付状态" view.titleLbl.text = "请选择支付状态"
view.ysyfTitle = "请选择支付状态"
view.dataArr = zfTypeArr view.dataArr = zfTypeArr
if payFs != 0 { if payFs != 0 {
view.deSelectArr = [0,2,3] view.deSelectArr = [0,2,3]
...@@ -244,6 +253,9 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl ...@@ -244,6 +253,9 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
view.tag = 999 view.tag = 999
view.delegate = self view.delegate = self
view.selectNum = payFs view.selectNum = payFs
view.cellTag = payFs
view.isYsYf = true
view.ysyfTitle = "请选择支付方式"
view.tempNum = view.selectNum view.tempNum = view.selectNum
view.titleLbl.text = "请选择支付方式" view.titleLbl.text = "请选择支付方式"
view.dataArr = zfWayArr view.dataArr = zfWayArr
...@@ -288,6 +300,42 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl ...@@ -288,6 +300,42 @@ class CGDXQVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,GLAl
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 10 return 10
} }
func GLAlertSelectViewFinish(sender: UIButton, title: String, cellTag: Int) {
print("3",cellTag)
if title == "请选择支付状态" {
if payFs == 0 {
payZt = sender.tag
holderArr.insert(zfTypeArr[payZt], at: 6)
holderArr.remove(at: 7)
}
}
if title == "请选择支付方式" {
payFs = sender.tag
holderArr.insert(zfWayArr[payFs], at: 5)
holderArr.remove(at: 6)
if payFs != 0 {
payZt = 1
}else{
payZt = 0
}
holderArr.insert(zfTypeArr[payZt], at: 6)
holderArr.remove(at: 7)
}
let dict = [
"user_token":UserToken as Any,
"po_id":po_id as Any,
"pay_type":payFs as Any,
"pay_status":payZt + 1 as Any
]
payStatus(dict, success: { (data) in
self.listView.reloadData()
self.glSelectView?.removeFromSuperview()
self.glSelectView = nil
}) { (err) in
}
}
func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) { func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
if view.tag == 999 { if view.tag == 999 {
payFs = selectNum payFs = selectNum
......
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