Commit 8da510de authored by lujunye's avatar lujunye

应付账款

parent 8eb63132
...@@ -142,6 +142,8 @@ ...@@ -142,6 +142,8 @@
E0516F832448086700E373CE /* MsgCenterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0516F812448086700E373CE /* MsgCenterCell.xib */; }; E0516F832448086700E373CE /* MsgCenterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0516F812448086700E373CE /* MsgCenterCell.xib */; };
E0571C6C248DC60000E85711 /* AddressListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0571C6B248DC60000E85711 /* AddressListModel.swift */; }; E0571C6C248DC60000E85711 /* AddressListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0571C6B248DC60000E85711 /* AddressListModel.swift */; };
E0571C6E248DD4DE00E85711 /* AdressInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0571C6D248DD4DE00E85711 /* AdressInterface.swift */; }; E0571C6E248DD4DE00E85711 /* AdressInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0571C6D248DD4DE00E85711 /* AdressInterface.swift */; };
E05FAD272498A5E500D8C90D /* accountsPayableInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = E05FAD262498A5E500D8C90D /* accountsPayableInterface.swift */; };
E05FAD2A2498A5F200D8C90D /* accountsPayableListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E05FAD292498A5F200D8C90D /* accountsPayableListModel.swift */; };
E06524ED2458008900CA22E2 /* RuKuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E06524EB2458008900CA22E2 /* RuKuViewController.swift */; }; E06524ED2458008900CA22E2 /* RuKuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E06524EB2458008900CA22E2 /* RuKuViewController.swift */; };
E06524EE2458008900CA22E2 /* RuKuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E06524EC2458008900CA22E2 /* RuKuViewController.xib */; }; E06524EE2458008900CA22E2 /* RuKuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E06524EC2458008900CA22E2 /* RuKuViewController.xib */; };
E06524F124580AAC00CA22E2 /* RuKuJiaGeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E06524EF24580AAC00CA22E2 /* RuKuJiaGeCell.swift */; }; E06524F124580AAC00CA22E2 /* RuKuJiaGeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E06524EF24580AAC00CA22E2 /* RuKuJiaGeCell.swift */; };
...@@ -688,6 +690,8 @@ ...@@ -688,6 +690,8 @@
E0516F812448086700E373CE /* MsgCenterCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MsgCenterCell.xib; sourceTree = "<group>"; }; E0516F812448086700E373CE /* MsgCenterCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MsgCenterCell.xib; sourceTree = "<group>"; };
E0571C6B248DC60000E85711 /* AddressListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressListModel.swift; sourceTree = "<group>"; }; E0571C6B248DC60000E85711 /* AddressListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressListModel.swift; sourceTree = "<group>"; };
E0571C6D248DD4DE00E85711 /* AdressInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdressInterface.swift; sourceTree = "<group>"; }; E0571C6D248DD4DE00E85711 /* AdressInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdressInterface.swift; sourceTree = "<group>"; };
E05FAD262498A5E500D8C90D /* accountsPayableInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = accountsPayableInterface.swift; sourceTree = "<group>"; };
E05FAD292498A5F200D8C90D /* accountsPayableListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = accountsPayableListModel.swift; sourceTree = "<group>"; };
E06524EB2458008900CA22E2 /* RuKuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuKuViewController.swift; sourceTree = "<group>"; }; E06524EB2458008900CA22E2 /* RuKuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuKuViewController.swift; sourceTree = "<group>"; };
E06524EC2458008900CA22E2 /* RuKuViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RuKuViewController.xib; sourceTree = "<group>"; }; E06524EC2458008900CA22E2 /* RuKuViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RuKuViewController.xib; sourceTree = "<group>"; };
E06524EF24580AAC00CA22E2 /* RuKuJiaGeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuKuJiaGeCell.swift; sourceTree = "<group>"; }; E06524EF24580AAC00CA22E2 /* RuKuJiaGeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuKuJiaGeCell.swift; sourceTree = "<group>"; };
...@@ -1552,6 +1556,14 @@ ...@@ -1552,6 +1556,14 @@
path = AdrModel; path = AdrModel;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
E05FAD282498A5E800D8C90D /* yfzkModel */ = {
isa = PBXGroup;
children = (
E05FAD292498A5F200D8C90D /* accountsPayableListModel.swift */,
);
path = yfzkModel;
sourceTree = "<group>";
};
E06524EA2458006600CA22E2 /* 入库 */ = { E06524EA2458006600CA22E2 /* 入库 */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1689,6 +1701,7 @@ ...@@ -1689,6 +1701,7 @@
E09B03A92445B09200211A51 /* Model */ = { E09B03A92445B09200211A51 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E05FAD282498A5E800D8C90D /* yfzkModel */,
F924B38E24971BB600A913CD /* CustomerModel */, F924B38E24971BB600A913CD /* CustomerModel */,
E0EFB9CC24931877005FB0CD /* PurchaseModel */, E0EFB9CC24931877005FB0CD /* PurchaseModel */,
F9697240248F6F550010D39B /* VendorModel */, F9697240248F6F550010D39B /* VendorModel */,
...@@ -1701,6 +1714,7 @@ ...@@ -1701,6 +1714,7 @@
F956D5BD246A3629003FF510 /* PersonCenterModel */, F956D5BD246A3629003FF510 /* PersonCenterModel */,
F956D5BC246A35DB003FF510 /* GoodsManageMoel */, F956D5BC246A35DB003FF510 /* GoodsManageMoel */,
F9171EFB245128B200359C2B /* Interface.swift */, F9171EFB245128B200359C2B /* Interface.swift */,
E05FAD262498A5E500D8C90D /* accountsPayableInterface.swift */,
E007B1DA248F8F57004D14CC /* PurchaseInterface.swift */, E007B1DA248F8F57004D14CC /* PurchaseInterface.swift */,
F9697243248F70C00010D39B /* VendorInterface.swift */, F9697243248F70C00010D39B /* VendorInterface.swift */,
E0AA3A88248F3E1400CBFC27 /* StatisticsInterface.swift */, E0AA3A88248F3E1400CBFC27 /* StatisticsInterface.swift */,
...@@ -3072,6 +3086,7 @@ ...@@ -3072,6 +3086,7 @@
E02D586D2477A2D90065A9EB /* EditFtNumberModel.swift in Sources */, E02D586D2477A2D90065A9EB /* EditFtNumberModel.swift in Sources */,
F95A9EE924558B8800867849 /* ShowAlGoodsViewController.swift in Sources */, F95A9EE924558B8800867849 /* ShowAlGoodsViewController.swift in Sources */,
E0190A2D2487696F00B1E067 /* NewSelectItemVc.swift in Sources */, E0190A2D2487696F00B1E067 /* NewSelectItemVc.swift in Sources */,
E05FAD2A2498A5F200D8C90D /* accountsPayableListModel.swift in Sources */,
E09B03C32445BD9500211A51 /* NavViewController.swift in Sources */, E09B03C32445BD9500211A51 /* NavViewController.swift in Sources */,
F950FDD924518B9500C40530 /* FSCalendarDelegationFactory.m in Sources */, F950FDD924518B9500C40530 /* FSCalendarDelegationFactory.m in Sources */,
E0571C6C248DC60000E85711 /* AddressListModel.swift in Sources */, E0571C6C248DC60000E85711 /* AddressListModel.swift in Sources */,
...@@ -3281,6 +3296,7 @@ ...@@ -3281,6 +3296,7 @@
E042F730245272FF00CDFA12 /* XiaYunDanViewController.swift in Sources */, E042F730245272FF00CDFA12 /* XiaYunDanViewController.swift in Sources */,
E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */, E09B03A72445B04E00211A51 /* BaseViewController.swift in Sources */,
E02DDD9924501A5B00ABB707 /* DelGuiGeCell.swift in Sources */, E02DDD9924501A5B00ABB707 /* DelGuiGeCell.swift in Sources */,
E05FAD272498A5E500D8C90D /* accountsPayableInterface.swift in Sources */,
E0CC847E24823602009B1FE9 /* WarehouseIoListModel.swift in Sources */, E0CC847E24823602009B1FE9 /* WarehouseIoListModel.swift in Sources */,
E088CC932447124D000DAA8A /* BindViewController.swift in Sources */, E088CC932447124D000DAA8A /* BindViewController.swift in Sources */,
E0EFB9CA24930DD5005FB0CD /* CGDListVC.swift in Sources */, E0EFB9CA24930DD5005FB0CD /* CGDListVC.swift in Sources */,
......
...@@ -170,5 +170,9 @@ ...@@ -170,5 +170,9 @@
<string>Customer/cusEdit</string> <string>Customer/cusEdit</string>
<key>获取绑定用户的用户信息</key> <key>获取绑定用户的用户信息</key>
<string>Customer/getBindUser</string> <string>Customer/getBindUser</string>
<key>应付账款列表</key>
<string>Finance/accountsPayableList</string>
<key>应付账款详情</key>
<string>Finance/accountsPayableDetail</string>
</dict> </dict>
</plist> </plist>
//
// accountsPayableInterface.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/16.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import Alamofire
import SwiftyJSON
import ObjectMapper
//MARK:--应付账款列表
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key(
//user_token(验证token)
page 页数
keyword 搜索关键词
*/
func accountsPayableList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("应付账款列表", params, { (rep:DataResponse<accountsPayableListModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
//MARK:--应付账款详情
/* 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
//params-key(
//user_token(验证token)
page 页数
keyword 搜索关键词
*/
func accountsPayableDetail(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("应付账款详情", params, { (rep:DataResponse<accountsPayableDetailModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
//
// accountsPayableListModel.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/6/16.
// Copyright © 2020 junye lu. All rights reserved.
//
import Foundation
import ObjectMapper
//MARK: - 应付账款列表
class accountsPayableListModel: Mappable {
var code:Int?
var message : String?
var data :accountsPayableDataModel?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class accountsPayableDataModel: Mappable {
var vendor_res:Array<accountsPayableListDataModel>?
var total_payable_money : Float?
required init?( map: Map) {
}
func mapping(map: Map) {
vendor_res <- map["vendor_res"]
total_payable_money <- map["total_payable_money"]
}
}
class accountsPayableListDataModel: Mappable {
var ven_id:Int?
var ven_name : String?
var payable_money : String?
required init?( map: Map) {
}
func mapping(map: Map) {
ven_id <- map["ven_id"]
ven_name <- map["ven_name"]
payable_money <- map["payable_money"]
}
}
//MARK: - 应付账款详情
class accountsPayableDetailModel: Mappable {
var code:Int?
var message : String?
var data :accountsPayableDetailDataModel?
required init?( map: Map) {
}
func mapping(map: Map) {
code <- map["code"]
message <- map["message"]
data <- map["data"]
}
}
class accountsPayableDetailDataModel: Mappable {
var list:Array<accountsPayableDetailDataListModel>?
var payable :String?
var already :Float?
required init?( map: Map) {
}
func mapping(map: Map) {
list <- map["list"]
payable <- map["payable"]
already <- map["already"]
}
}
class accountsPayableDetailDataListModel: Mappable {
var ven_id_log:Int?
var ven_id :Int?
var po_id :Int?
var money:String?
var type :Int?
var create_time :Double?
var payable_money:String?
var status :Int?
var po_no :String?
required init?( map: Map) {
}
func mapping(map: Map) {
ven_id_log <- map["ven_id_log"]
ven_id <- map["ven_id"]
po_id <- map["po_id"]
money <- map["money"]
type <- map["type"]
create_time <- map["create_time"]
payable_money <- map["payable_money"]
status <- map["status"]
po_no <- map["po_no"]
}
}
...@@ -10,6 +10,7 @@ import UIKit ...@@ -10,6 +10,7 @@ import UIKit
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
@objc protocol GLAlertSelectViewDelegate { @objc protocol GLAlertSelectViewDelegate {
@objc optional func GLAlertSelectViewFinish(sender:UIButton,title:String,cellTag:Int)
//普通状态(单多选) //普通状态(单多选)
@objc optional func GLAlertSelectViewClick(selectNum:Int,view:GLAlertSelectView)//单选 @objc optional func GLAlertSelectViewClick(selectNum:Int,view:GLAlertSelectView)//单选
@objc optional func GLAlertMoreSelectViewClick(sender:Array<Int>,view:UIView)//多选 @objc optional func GLAlertMoreSelectViewClick(sender:Array<Int>,view:UIView)//多选
...@@ -24,7 +25,14 @@ import IQKeyboardManagerSwift ...@@ -24,7 +25,14 @@ import IQKeyboardManagerSwift
@objc optional func KuWeiDataArr(sender:Array<Any>) @objc optional func KuWeiDataArr(sender:Array<Any>)
} }
class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleAndSelectCellDelegate,KuWeiCellCellDelegate,UITextFieldDelegate{ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleAndSelectCellDelegate,KuWeiCellCellDelegate,UITextFieldDelegate,GeliAlertViewDelegate{
func sureGeliAlertViewAction(sender: UIButton) {
delegate?.GLAlertSelectViewFinish?(sender:sender,title: ysyfTitle,cellTag: cellTag!)
}
var cellTag:Int?
var isYsYf = false
var ysyfTitle = ""
var deSelectArr:Array<Int> = [] var deSelectArr:Array<Int> = []
var isOnlySelectKuWei = false var isOnlySelectKuWei = false
...@@ -141,7 +149,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -141,7 +149,7 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
selectTbv.isScrollEnabled = false selectTbv.isScrollEnabled = false
ipdVHeight.constant = 0.001 ipdVHeight.constant = 0.001
} }
func setKuWeiView(){ func setKuWeiView(){
IQKeyboardManager.shared.resignFirstResponder() IQKeyboardManager.shared.resignFirstResponder()
...@@ -264,8 +272,17 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA ...@@ -264,8 +272,17 @@ class GLAlertSelectView: UIView,UITableViewDelegate,UITableViewDataSource,TitleA
HUD.flash(.label("\(titleLbl.text!)"), delay: 1.2) HUD.flash(.label("\(titleLbl.text!)"), delay: 1.2)
return return
} }
if isYsYf {
delegate?.GLAlertSelectViewClick?(selectNum: selectNum!,view: self) let alertView = GeliAlertView(frame: self.window!.bounds)
alertView.delegate = self;
alertView.tishiLbl.text = ""
alertView.titileLbl.text = "确定设为\(dataArr[selectNum!])?"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "确定"), for: .normal)
alertView.rightBtn.tag = selectNum!
self.window?.addSubview(alertView)
}else{
delegate?.GLAlertSelectViewClick?(selectNum: selectNum!,view: self)
}
}else{ }else{
if selectArray == [99,99,99,99] { if selectArray == [99,99,99,99] {
HUD.flash(.label("\(titleLbl.text!)"), delay: 1.2) HUD.flash(.label("\(titleLbl.text!)"), delay: 1.2)
......
...@@ -9,9 +9,11 @@ ...@@ -9,9 +9,11 @@
import UIKit import UIKit
class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDataSource,UITableViewDelegate { class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchBarViewDelegate,UITableViewDataSource,UITableViewDelegate {
let UserToken = UserDefaults.standard.value(forKey: "user_token")
var page : Int = 0
var keyword: String = ""
var dataArr:Array<accountsPayableListDataModel> = []//应付
var datas:Array<Any> = []//应收
@IBOutlet weak var titleLbl: UILabel! @IBOutlet weak var titleLbl: UILabel!
@IBOutlet weak var totalPriceLbl: UILabel! @IBOutlet weak var totalPriceLbl: UILabel!
@IBOutlet weak var topView: UIView! @IBOutlet weak var topView: UIView!
...@@ -38,35 +40,157 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB ...@@ -38,35 +40,157 @@ class YingFuZKListViewController: BaseViewController,UISearchBarDelegate,SearchB
make.height.equalTo(30) make.height.equalTo(30)
} }
searchV = searchBr searchV = searchBr
searchBr.placeholderStr = "请输入品牌名称/商品编码" searchBr.placeholderStr = "请输入单号"
searchBr.cornerRadius = 35/2.0 searchBr.cornerRadius = 35/2.0
searchBr.delegate = self searchBr.delegate = self
searchBr.delegateL = self searchBr.delegateL = self
listView.register(UINib(nibName: "YingFuZhangKuanCell", bundle: nil), forCellReuseIdentifier: "YingFuZhangKuanCell") listView.register(UINib(nibName: "YingFuZhangKuanCell", bundle: nil), forCellReuseIdentifier: "YingFuZhangKuanCell")
//下拉刷新相关设置
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
listView.mj_header = headerMJ
//上拉加载相关设置
footerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadMoreData))
listView.mj_footer = footerMJ
listView.mj_header?.beginRefreshing()
} }
//MARK: - CELL DELEGATE
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YingFuZhangKuanXQViewController() let vc = YingFuZhangKuanXQViewController()
vc.navTitle = "\(barTitle!)详情" vc.navTitle = "\(barTitle!)详情"
if (barTitle?.contains("应付"))!{
let model = dataArr[indexPath.row]
vc.ven_id = model.ven_id!
}
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49 return 49
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3 if (barTitle?.contains("应付"))!{
} return dataArr.count
}else{
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { return datas.count
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "YingFuZhangKuanCell") as! YingFuZhangKuanCell let cell = tableView.dequeueReusableCell(withIdentifier: "YingFuZhangKuanCell") as! YingFuZhangKuanCell
if (barTitle?.contains("应付"))!{
let mo = dataArr[indexPath.row]
cell.nameLbl.text = mo.ven_name!
if mo.payable_money != "0.00" {
cell.priceLbl.text = "¥-" + mo.payable_money!
}else{
cell.priceLbl.text = "¥0"
}
}else{
}
return cell return cell
} }
//MARK: - 自定义DELEGATE //MAKR:--调起搜索后添加个蒙版本
func clearSearchAction() { var blackBtnView:UIButton! = nil
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
} print("点击搜索进行--")
searchBar.resignFirstResponder()
keyword = searchBar.text!
listView.mj_header?.beginRefreshing()
}
//MARK:--取消搜索代理
func clearSearchAction() {
print("取消搜索代理了--")
}
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
print("编辑即将结束了--")
removeBlackBtnView()
if searchBar.text?.count == 0 && keyword.count != 0{
keyword = searchBar.text!
listView.mj_header?.beginRefreshing()
}
}
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
print("调起搜索后添加个蒙版本")
blackBtnView = UIButton ()
blackBtnView.backgroundColor = UIColor.init(named: "提示视图背景色")
self.view.addSubview(blackBtnView)
blackBtnView.snp.makeConstraints { (make) in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(topView!.snp_bottom)
}
blackBtnView.addTarget(self, action: #selector(removeBlackBtnView), for: .touchUpInside)
return true
}
@objc func removeBlackBtnView(){
if blackBtnView != nil {
blackBtnView.removeFromSuperview()
searchV!.resignFirstResponder()
}
}
//MARK:--加载数据
@objc func loadData(){
print("加载数据")
page = 1
let dic = ["user_token":UserToken as Any,"keyword":keyword as Any,"page":page as Any]
if (barTitle?.contains("应付"))!{
accountsPayableList(dic, success: { (data) in
let model = (data as! accountsPayableListModel)
self.dataArr.removeAll()
model.data?.vendor_res?.forEach({ (model) in
self.dataArr.append(model)
})
self.totalPriceLbl.text = "¥-\(model.data!.total_payable_money!)"
self.listView.reloadData()
self.listView.mj_header?.endRefreshing()
self.page = 2
if model.data?.vendor_res?.count == 0 {
self.listView.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.listView.mj_footer?.endRefreshing()
}
}) { (error) in
self.listView.mj_header?.endRefreshing()
}
}else{//应收
}
}
//MARK:--加载更多数据
@objc func loadMoreData(){
print("加载更多数据")
let dic = ["user_token":UserToken as Any,"keyword":keyword as Any,"page":page as Any]
if (barTitle?.contains("应付"))!{
accountsPayableList(dic, success: { (data) in
let dataM = data as! accountsPayableListModel
if dataM.data?.vendor_res?.count == 0 {
self.listView.mj_footer?.endRefreshingWithNoMoreData()
}else{
self.page += 1
dataM.data?.vendor_res?.forEach({ (model) in
self.dataArr.append(model)
})
self.listView.reloadData()
self.listView.mj_footer?.endRefreshing()
}
}) { (error) in
self.listView.mj_footer?.endRefreshing()
}
}else{//应收
}
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <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="Named colors" minToolsVersion="9.0"/>
<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="YingFuZKListViewController" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="YingFuZKListViewController" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="listView" destination="csq-EP-8sj" id="vI5-tf-5NB"/> <outlet property="listView" destination="csq-EP-8sj" id="vI5-tf-5NB"/>
<outlet property="titleLbl" destination="BV0-0O-Gee" id="Cag-EP-rpB"/> <outlet property="titleLbl" destination="BV0-0O-Gee" id="Cag-EP-rpB"/>
......
...@@ -10,6 +10,8 @@ import UIKit ...@@ -10,6 +10,8 @@ import UIKit
class YingFuZhangKuanCell: UITableViewCell { class YingFuZhangKuanCell: UITableViewCell {
@IBOutlet weak var priceLbl: UILabel!
@IBOutlet weak var nameLbl: UILabel!
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
self.selectionStyle = .none self.selectionStyle = .none
......
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="nameLbl" destination="MMT-eN-xhE" id="EUJ-GO-Vwb"/>
<outlet property="priceLbl" destination="LNJ-Lj-fmP" id="RjD-pD-TWW"/>
</connections>
<point key="canvasLocation" x="132" y="122"/> <point key="canvasLocation" x="132" y="122"/>
</tableViewCell> </tableViewCell>
</objects> </objects>
......
...@@ -15,7 +15,7 @@ class YingFuZhangKuanXQCell: UITableViewCell { ...@@ -15,7 +15,7 @@ class YingFuZhangKuanXQCell: UITableViewCell {
@IBAction func submitAction(_ sender: UIButton) { @IBAction func submitAction(_ sender: UIButton) {
delegate?.YingFuZhangKuanXQCellBtnClick?(cell: self,sender:sender) delegate?.YingFuZhangKuanXQCellBtnClick?(cell: self,sender:sender)
} }
var isFirst = false
@IBOutlet weak var p3Title: UILabel! @IBOutlet weak var p3Title: UILabel!
@IBOutlet weak var p2Title: UILabel! @IBOutlet weak var p2Title: UILabel!
@IBOutlet weak var p1Title: UILabel! @IBOutlet weak var p1Title: UILabel!
...@@ -25,6 +25,7 @@ class YingFuZhangKuanXQCell: UITableViewCell { ...@@ -25,6 +25,7 @@ class YingFuZhangKuanXQCell: UITableViewCell {
@IBOutlet weak var priceLbl1: UILabel! @IBOutlet weak var priceLbl1: UILabel!
@IBOutlet weak var nameLbl: UILabel! @IBOutlet weak var nameLbl: UILabel!
@IBOutlet weak var dateLbl: UILabel! @IBOutlet weak var dateLbl: UILabel!
var model:accountsPayableDetailDataListModel?
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
self.selectionStyle = .none self.selectionStyle = .none
...@@ -35,14 +36,28 @@ class YingFuZhangKuanXQCell: UITableViewCell { ...@@ -35,14 +36,28 @@ class YingFuZhangKuanXQCell: UITableViewCell {
super.layoutIfNeeded() super.layoutIfNeeded()
submitBtn.layer.cornerRadius = 3 submitBtn.layer.cornerRadius = 3
submitBtn.layer.masksToBounds = true submitBtn.layer.masksToBounds = true
if isFirst { priceLbl1.text = "-"
submitBtn.backgroundColor = UIColor(named: "按钮渐变色下,字体颜色") priceLbl2.text = "-"
submitBtn.setTitleColor(UIColor.white, for: .normal) priceLbl3.text = "-"
submitBtn.layer.borderWidth = 0 if model != nil {
}else{ nameLbl.text = model?.po_no!
dateLbl.text = dayAndTimeByDouble(sender: (model?.create_time!)!)
if model?.type == 1 {//应付
priceLbl1.text = model?.money
}else{//已付
priceLbl2.text = model?.money
}
priceLbl3.text = model?.payable_money
submitBtn.backgroundColor = UIColor.clear submitBtn.backgroundColor = UIColor.clear
submitBtn.setTitleColor(UIColor(named: "灰色字体颜色"), for: .normal) submitBtn.setTitleColor(UIColor(named: "灰色字体颜色"), for: .normal)
submitBtn.setTitle("设置未收款", for: .normal)
submitBtn.layer.borderWidth = 1 submitBtn.layer.borderWidth = 1
if model?.status == 1 {
submitBtn.backgroundColor = UIColor(named: "按钮渐变色下,字体颜色")
submitBtn.setTitle("付款", for: .normal)
submitBtn.setTitleColor(UIColor.white, for: .normal)
submitBtn.layer.borderWidth = 0
}
} }
} }
......
...@@ -83,9 +83,8 @@ ...@@ -83,9 +83,8 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="一" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GK8-LK-p2U"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="一" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GK8-LK-p2U">
<rect key="frame" x="36" y="100.5" width="42" height="18.5"/> <rect key="frame" x="50.5" y="100.5" width="13.5" height="18.5"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="42" id="9ic-Hz-j5h"/>
<constraint firstAttribute="height" constant="18.5" id="aDS-2o-EEP"/> <constraint firstAttribute="height" constant="18.5" id="aDS-2o-EEP"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
...@@ -101,7 +100,6 @@ ...@@ -101,7 +100,6 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥654156" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yzg-sO-UiV"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥654156" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yzg-sO-UiV">
<rect key="frame" x="274" y="102" width="55" height="16"/> <rect key="frame" x="274" y="102" width="55" height="16"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="55" id="M82-JN-Yxd"/>
<constraint firstAttribute="height" constant="16" id="dST-8e-7Vb"/> <constraint firstAttribute="height" constant="16" id="dST-8e-7Vb"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
......
<?xml version="1.0" encoding="UTF-8"?> <?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"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <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="Named colors" minToolsVersion="9.0"/>
<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="YingFuZhangKuanXQViewController" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="YingFuZhangKuanXQViewController" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="listView" destination="7VX-Hn-lfa" id="MWv-pp-tI2"/> <outlet property="listView" destination="7VX-Hn-lfa" id="MWv-pp-tI2"/>
<outlet property="searchBGView" destination="fQf-mJ-t0V" id="Flu-qf-wdv"/> <outlet property="searchBGView" destination="fQf-mJ-t0V" id="Flu-qf-wdv"/>
......
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