Commit f205fe2b authored by lujunye's avatar lujunye

供应商列表系列基本完成

parent 4e1eac1a
...@@ -156,5 +156,9 @@ ...@@ -156,5 +156,9 @@
<string>Purchase/backOut</string> <string>Purchase/backOut</string>
<key>采购单修改支付状态</key> <key>采购单修改支付状态</key>
<string>Purchase/payStatus</string> <string>Purchase/payStatus</string>
<key>供应商编辑</key>
<string>Vender/vendorEdit</string>
<key>新增供应商</key>
<string>Vender/vendorAdd</string>
</dict> </dict>
</plist> </plist>
...@@ -20,6 +20,7 @@ func login(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@esc ...@@ -20,6 +20,7 @@ func login(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@esc
failture(error) failture(error)
} }
} }
//MARK:--发送验证码 //MARK:--发送验证码
//params-key(phone(手机号),type( 验证类型,1注册,2修改密码,3登录,4格利商家绑定(修改绑定)格利支付,5格利支付绑定格利商家)) //params-key(phone(手机号),type( 验证类型,1注册,2修改密码,3登录,4格利商家绑定(修改绑定)格利支付,5格利支付绑定格利商家))
func sendSmsCaptcha(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) { func sendSmsCaptcha(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import Foundation import Foundation
import ObjectMapper import ObjectMapper
//发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态 //发送验证码,验证短信验证码,修改登录密码,绑定、更换绑定格利支付账号,简单通用操作接口,普通订单发货,预售订单发货,订单绑定/更换绑定客户,确认订单,订单取消,修改订单商品价格,订单退款,普通订单退货,预售订单退货,修改订单支付方式(状态),商家仓库添加,商家仓库修改,商家仓库删除,提交下单,商品入库审核,商品入库,商品入库申请,商品出库,商品申请出库,商品审核出库,出库入库审核不通过,编辑地址,删除地址,新增采购单,审核采购单,撤销入库,采购单修改支付状态,供应商编辑,新增供应商
class UpDataModel: Mappable { class UpDataModel: Mappable {
var code:Int? var code:Int?
......
...@@ -24,3 +24,52 @@ func vendorList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture ...@@ -24,3 +24,52 @@ func vendorList(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture
failture(error) failture(error)
} }
} }
//MARK:--供应商编辑
//- 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
/*
//user_token(验证token)
ven_id 供应商id
ven_name 供应商名
province 省id
city 市id
district 区id
address 详细地址
contacts_name 联系人
contacts_phone 联系电话
contacts_mobile 联系手机号
zhizhao 营业执照
food_production_license 食品流通许可证
*/
func vendorEdit(_ 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)
}
}
//MARK:--新增供应商
//- 说明:供应商信息在列表中已经全部列出,详情功能拿列表数据即可
/*
//user_token(验证token)
ven_name 供应商名
province 省id
city 市id
district 区id
address 详细地址
contacts_name 联系人
contacts_phone 联系电话
contacts_mobile 联系手机号
zhizhao 营业执照
food_production_license 食品流通许可证
*/
func vendorAdd(_ 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)
}
}
<?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"/>
...@@ -10,7 +11,7 @@ ...@@ -10,7 +11,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="92" id="KGk-i7-Jjw" customClass="TitleAndOnlyBtnCell" customModule="GeliBusinessPlatform" customModuleProvider="target"> <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="92" id="KGk-i7-Jjw" customClass="TitleAndOnlyBtnCell" customModule="TestClass" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/> <rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <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"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
...@@ -127,7 +128,7 @@ ...@@ -127,7 +128,7 @@
<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="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
</resources> </resources>
</document> </document>
<?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="retina4_7" orientation="portrait" appearance="light"/> <device id="retina4_7" 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="GYSGLViewController" customModule="GeliBusinessPlatform" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GYSGLViewController" customModule="TestClass" customModuleProvider="target">
<connections> <connections>
<outlet property="btmBtn" destination="UDG-2C-6uA" id="B0W-e7-mba"/> <outlet property="btmBtn" destination="UDG-2C-6uA" id="B0W-e7-mba"/>
<outlet property="listView" destination="dCx-Vv-3aF" id="OCD-Y1-cx8"/> <outlet property="listView" destination="dCx-Vv-3aF" id="OCD-Y1-cx8"/>
...@@ -32,6 +33,9 @@ ...@@ -32,6 +33,9 @@
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/> <userDefinedRuntimeAttribute type="boolean" keyPath="gradientHorizontal" value="YES"/>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
<connections>
<action selector="submitAction:" destination="-1" eventType="touchUpInside" id="Vr9-L7-cxd"/>
</connections>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wSI-pD-gTn"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wSI-pD-gTn">
<rect key="frame" x="0.0" y="618" width="375" height="49"/> <rect key="frame" x="0.0" y="618" width="375" height="49"/>
......
...@@ -10,7 +10,11 @@ import UIKit ...@@ -10,7 +10,11 @@ import UIKit
protocol GYSListViewControllerDelegate { protocol GYSListViewControllerDelegate {
func GYSListViewControllerGetGYS(sender:VendorListDataModel) func GYSListViewControllerGetGYS(sender:VendorListDataModel)
} }
class GYSListViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,UISearchBarDelegate,SearchBarViewDelegate{ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,UISearchBarDelegate,SearchBarViewDelegate,GYSGLViewControllerDelegate{
func GYSGLViewControllerFinish() {
listView.mj_header?.beginRefreshing()
}
var delegate:GYSListViewControllerDelegate? var delegate:GYSListViewControllerDelegate?
var searchV : SearchBarView? = nil var searchV : SearchBarView? = nil
var selectTarget:VendorListDataModel? var selectTarget:VendorListDataModel?
...@@ -25,7 +29,6 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie ...@@ -25,7 +29,6 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
@objc func loadData(){ @objc func loadData(){
print("加载数据") print("加载数据")
page = 1 page = 1
let dict = [ let dict = [
"user_token":UserToken as Any, "user_token":UserToken as Any,
"keyword":keyWord as Any, "keyword":keyWord as Any,
...@@ -52,7 +55,7 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie ...@@ -52,7 +55,7 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
//MARK:--加载更多数据 //MARK:--加载更多数据
@objc func loadMoreData(){ @objc func loadMoreData(){
print("加载更多数据") print("加载更多数据")
let dict = [ let dict = [
"user_token":UserToken as Any, "user_token":UserToken as Any,
"keyword":keyWord as Any, "keyword":keyWord as Any,
...@@ -123,63 +126,84 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie ...@@ -123,63 +126,84 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
} }
}else{ }else{
let vc = GYSGLViewController() let vc = GYSGLViewController()
vc.barT = "新增供应商信息"
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
} }
//MARK:--搜索模块 //MARK:--搜索模块
//MAKR:--调起搜索后添加个蒙版本 //MAKR:--调起搜索后添加个蒙版本
var blackBtnView:UIButton! = nil var blackBtnView:UIButton! = nil
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool { func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
print("调起搜索后添加个蒙版本") print("调起搜索后添加个蒙版本")
blackBtnView = UIButton () blackBtnView = UIButton ()
blackBtnView.backgroundColor = UIColor.init(named: "提示视图背景色") blackBtnView.backgroundColor = UIColor.init(named: "提示视图背景色")
view.addSubview(blackBtnView) view.addSubview(blackBtnView)
blackBtnView.snp.makeConstraints { (make) in blackBtnView.snp.makeConstraints { (make) in
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
make.top.equalTo(topView.snp_bottom) make.top.equalTo(topView.snp_bottom)
} }
blackBtnView.addTarget(self, action: #selector(removeBlackBtnView), for: .touchUpInside) blackBtnView.addTarget(self, action: #selector(removeBlackBtnView), for: .touchUpInside)
return true return true
} }
@objc func removeBlackBtnView(){ @objc func removeBlackBtnView(){
if blackBtnView != nil { if blackBtnView != nil {
blackBtnView.removeFromSuperview() blackBtnView.removeFromSuperview()
searchV!.resignFirstResponder() searchV!.resignFirstResponder()
} }
} }
//MARK:--搜索按钮代理 //MARK:--搜索按钮代理
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("点击搜索关键字进行--\(searchBar.text)") print("点击搜索关键字进行--\(searchBar.text)")
searchBar.resignFirstResponder() searchBar.resignFirstResponder()
if blackBtnView != nil { if blackBtnView != nil {
blackBtnView.removeFromSuperview() blackBtnView.removeFromSuperview()
} }
keyWord = searchBar.text! keyWord = searchBar.text!
listView.mj_header?.beginRefreshing() listView.mj_header?.beginRefreshing()
} }
//MARK:--清空搜索代理 //MARK:--清空搜索代理
func clearSearchAction() { func clearSearchAction() {
} }
//MARK:--编辑即将结束 //MARK:--编辑即将结束
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) { func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
print("编辑即将结束了--") print("编辑即将结束了--")
removeBlackBtnView() removeBlackBtnView()
if keyWord.count > 0 { if keyWord.count > 0 {
keyWord = searchBar.text! keyWord = searchBar.text!
if keyWord.count == 0 { if keyWord.count == 0 {
listView.mj_header?.beginRefreshing() listView.mj_header?.beginRefreshing()
} }
} }
} }
//MARK: - CELL DELEGATE //MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if barTitle == "供应商管理" { if barTitle == "供应商管理" {
let data = datas[indexPath.row]
let vc = GYSGLViewController() let vc = GYSGLViewController()
self.navigationController?.pushViewController(vc, animated: true) vc.delegate = self
vc.barT = "编辑供应商信息"
vc.gysName = data.ven_name!
vc.provinceIndex = data.province!
vc.cityIndex = data.city!
vc.areaIndex = data.district!
vc.detailDzStr = data.address!
if data.contacts_phone != nil {
vc.telNum = data.contacts_phone!
}
vc.ven_id = data.ven_id!
vc.nameStr = data.contacts_name!
vc.phoneNum = data.contacts_mobile!
vc.zhizhao = data.zhizhao!
vc.food_production_license = data.food_production_license!
vc.img1.sd_setImage(with: URL(string: SERVERCE_ImageHost + data.zhizhao!), placeholderImage: UIImage(named: "worktest1"))
print("img = ",SERVERCE_ImageHost + data.zhizhao!)
vc.img2.sd_setImage(with: URL(string: SERVERCE_ImageHost + data.food_production_license!), placeholderImage: UIImage(named: "worktest1"))
self.navigationController!.pushViewController(vc, animated: true)
}else{ }else{
selectTarget = datas[indexPath.row] selectTarget = datas[indexPath.row]
listView.reloadData() listView.reloadData()
...@@ -206,7 +230,7 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie ...@@ -206,7 +230,7 @@ class GYSListViewController: BaseViewController,UITableViewDataSource,UITableVie
}else{ }else{
cell.selectTypeView.isHidden = true cell.selectTypeView.isHidden = true
} }
cell.Lbl1.text = model.ven_name! cell.Lbl1.text = model.ven_name!
cell.Lbl2.text = model.contacts_name! + " " + model.contacts_phone! cell.Lbl2.text = model.contacts_name! + " " + model.contacts_phone!
......
...@@ -525,6 +525,7 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD ...@@ -525,6 +525,7 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
case 93: //供应商管理 case 93: //供应商管理
// HUD.flash(.label("敬请期待"),delay: 1.2) // HUD.flash(.label("敬请期待"),delay: 1.2)
let vc = GYSListViewController() let vc = GYSListViewController()
vc.barTitle = "供应商管理"
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
return return
case 113: //管理员列表 case 113: //管理员列表
......
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