Commit 4f2b9d53 authored by lujunye's avatar lujunye

修改新增商品

parent 0afe6076
......@@ -1500,7 +1500,7 @@
E02C88232456B23400925766 /* 物流跟踪 */,
E02FD9F3245578D800E10E27 /* 地址管理 */,
E02FD9EE2455704600E10E27 /* 出入库记录 */,
E0A2E82024553EC500D6DB34 /* 库存商品 */,
E0A2E82024553EC500D6DB34 /* 库存商品(库存商品的出库) */,
E0A2E81724552E1900D6DB34 /* 新增、编辑品牌 */,
E09F4C9F2452D13F00BE033D /* 增值服务 */,
E09F4C9A2452BEA000BE033D /* 寄派方式 */,
......@@ -1610,7 +1610,7 @@
path = "新增、编辑品牌";
sourceTree = "<group>";
};
E0A2E82024553EC500D6DB34 /* 库存商品 */ = {
E0A2E82024553EC500D6DB34 /* 库存商品(库存商品的出库) */ = {
isa = PBXGroup;
children = (
E0A2E82524555B4400D6DB34 /* KuCunShangPinCell.swift */,
......@@ -1622,7 +1622,7 @@
E00E48C42457C99900F16545 /* KuCunShangPinXQViewController.swift */,
E00E48C52457C99900F16545 /* KuCunShangPinXQViewController.xib */,
);
path = "库存商品";
path = "库存商品(库存商品的出库)";
sourceTree = "<group>";
};
E0A409C02463F2F400CFF109 /* 收支统计 */ = {
......
......@@ -7,28 +7,36 @@
//
import UIKit
@objc protocol WareHouseSpCellDelegate {
@objc optional func clickAction(sender:UIButton)
protocol WareHouseSpCellDelegate {
func clickAction(sender:UIButton)
func whTextChange(sender:String,cell:WareHouseSpCell)
func whSwitchChange(sender:UISwitch)
}
class WareHouseSpCell: UITableViewCell {
var delegate:WareHouseSpCellDelegate?
@IBOutlet weak var hiddenBtn: UIButton!
@IBOutlet weak var whSwitch: UISwitch!
@IBOutlet weak var clickBtn: UIButton!
@IBOutlet weak var titleLbl: UILabel!
@IBAction func btnAction(_ sender: UIButton) {
delegate?.clickAction?(sender: sender)
delegate?.clickAction(sender: sender)
}
@IBOutlet weak var btnImg: UIImageView!
@IBOutlet weak var detailTF: UITextField!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
whSwitch.addTarget(self, action: #selector(swValueChange(sender:)), for: .valueChanged)
whSwitch.transform = CGAffineTransform( scaleX: 0.8, y: 0.8)
detailTF.addTarget(self, action: #selector(textChange(sender:)), for: .allEditingEvents)
// Initialization code
}
@objc func swValueChange(sender:UISwitch){
delegate?.whSwitchChange(sender: sender)
}
@objc func textChange(sender:UITextField){
delegate?.whTextChange(sender: sender.text!, cell: self)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
......
......@@ -62,10 +62,17 @@
</constraints>
<color key="onTintColor" name="蓝色字体颜色"/>
</switch>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Ya-ff-0NB">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<connections>
<action selector="btnAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="0b7-xP-8hW"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="uEc-pe-iBV" firstAttribute="leading" secondItem="zsG-fB-Zeb" secondAttribute="trailing" constant="10" id="DaV-Au-Fbz"/>
<constraint firstAttribute="bottom" secondItem="uEc-pe-iBV" secondAttribute="bottom" id="JR4-Gh-Lso"/>
<constraint firstAttribute="trailing" secondItem="7Ya-ff-0NB" secondAttribute="trailing" id="LPq-wT-wK0"/>
<constraint firstItem="Nns-NP-fAD" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="O4l-xC-hak"/>
<constraint firstItem="6Eb-eL-RFq" firstAttribute="top" secondItem="zsG-fB-Zeb" secondAttribute="bottom" id="Ptu-ui-fcg"/>
<constraint firstAttribute="trailing" secondItem="3PL-vr-q2W" secondAttribute="trailing" constant="15" id="R0N-fj-Nf4"/>
......@@ -77,10 +84,13 @@
<constraint firstItem="Nns-NP-fAD" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="f18-iY-s23"/>
<constraint firstItem="3PL-vr-q2W" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="gzt-C3-0sQ"/>
<constraint firstAttribute="bottom" secondItem="6Eb-eL-RFq" secondAttribute="bottom" id="h6b-GE-I1H"/>
<constraint firstItem="7Ya-ff-0NB" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="i6c-K5-0nF"/>
<constraint firstAttribute="bottom" secondItem="Nns-NP-fAD" secondAttribute="bottom" id="jIE-bB-8ic"/>
<constraint firstItem="zsG-fB-Zeb" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="kT5-VR-Vqg"/>
<constraint firstItem="GUA-N4-Rgf" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="n0g-sO-UI3"/>
<constraint firstAttribute="trailing" secondItem="uEc-pe-iBV" secondAttribute="trailing" id="riL-Qy-yIc"/>
<constraint firstItem="7Ya-ff-0NB" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="uMQ-Vv-5ZN"/>
<constraint firstItem="6Eb-eL-RFq" firstAttribute="top" secondItem="7Ya-ff-0NB" secondAttribute="bottom" id="uoH-tq-oFM"/>
<constraint firstAttribute="trailing" secondItem="GUA-N4-Rgf" secondAttribute="trailing" constant="15" id="zP6-ZR-myY"/>
</constraints>
</tableViewCellContentView>
......@@ -89,6 +99,7 @@
<outlet property="btnImg" destination="3PL-vr-q2W" id="YM6-J5-D8z"/>
<outlet property="clickBtn" destination="uEc-pe-iBV" id="Ld9-MC-lkC"/>
<outlet property="detailTF" destination="zsG-fB-Zeb" id="XEU-3n-EoN"/>
<outlet property="hiddenBtn" destination="7Ya-ff-0NB" id="Afu-I3-OZ4"/>
<outlet property="titleLbl" destination="Nns-NP-fAD" id="qIo-DJ-djf"/>
<outlet property="whSwitch" destination="GUA-N4-Rgf" id="IZK-Bu-rZg"/>
</connections>
......
......@@ -82,7 +82,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
}
//是否为预售商品
isYuShouShangPin = true
isYuShouShangPin = false
navbar.title = "商品详情"
self.view.addSubview(navbar)
......@@ -111,7 +111,7 @@ class ProductDetailViewController: BaseViewController,UITableViewDelegate,UITabl
cell.nameLbl.text = spxxArr[indexPath.row]
//商家名称
switch cell.nameLbl.text {
case "商名称":
case "商名称":
cell.textTF.text = itemName
break
case "起卖数量":
......
......@@ -16,7 +16,7 @@ class ChuKuViewController: BaseViewController,UITableViewDelegate,UITableViewDat
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "出库"
navbar.title = "出库"//库存商品的出库
self.view.addSubview(navbar)
lietView.snp.makeConstraints { (make) in
......
......@@ -9,9 +9,15 @@
import UIKit
import ViewAnimator
import LGButton
import IQKeyboardManagerSwift
protocol ChangeGoodsPriceVCDelegate {
func ChangeGoodsPriceVCKeyboardDone(str:String)
}
class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableViewDataSource,UITextFieldDelegate {
var orderID:Int? = 0
var delegate:ChangeGoodsPriceVCDelegate?
var dataArr : Array<OrderDetailGoodsModel>? = []
override func viewDidLoad() {
super.viewDidLoad()
......@@ -36,7 +42,11 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
}
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
IQKeyboardManager.shared.resignFirstResponder()
delegate?.ChangeGoodsPriceVCKeyboardDone(str: textField.text!)
return true
}
var tableV :UITableView!
......@@ -65,7 +75,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "ChangePriceNormalCell") as! ChangePriceNormalCell
let rowModel = dataArr![indexPath.row]
// let rowModel = dataArr![indexPath.row]
//图片暂不处理
// cell.imageView?.kf.setImage(with: <#T##Resource?#>)
// cell.goodsNameLbl.text = rowModel.goods_name
......@@ -73,7 +83,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
// cell.priceTf.text = rowModel.goods_price
// cell.detailLbl.isHidden = true
cell.priceTf.delegate = self
cell.priceTf.returnKeyType = .done
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
......@@ -84,5 +94,7 @@ class ChangeGoodsPriceVC: BaseViewController , UITableViewDelegate, UITableView
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 120*glscale
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
IQKeyboardManager.shared.resignFirstResponder()
}
}
......@@ -8,7 +8,8 @@
import UIKit
class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GuanLianKehuVCDelegate,OrderDViewFooterViewDelegate,TitleAndTFCellDelegate,CommendCellDelegate,GeliAlertViewDelegate{
class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndBtnCellDelegate,GuanLianKehuVCDelegate,OrderDViewFooterViewDelegate,TitleAndTFCellDelegate,CommendCellDelegate,GeliAlertViewDelegate,GLAlertSelectViewDelegate{
var orderId:Int? //订单编号
var isYuShou:Bool = false //是否预售
......@@ -19,8 +20,18 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
let yuShouTitleArr = ["定金:","尾款:","商品合计:","物流费用:","其它费用:"]
let nonYuShouTitleArr = ["商品合计:","物流费用:","其它费用:"]
let YuShouPart3Arr = ["订单编号","下单时间","订单来源","提货方式","运单号","物流公司","支付方式","支付状态","买家留言","订单备注"]
let YuShouPart3Arr = ["订单编号","下单时间","订单来源","提货方式","物流公司","运单号","支付方式","支付状态","买家留言","订单备注"]
let nonYuShouPart3Arr = ["收货人","联系电话","地址"]
var glSelectView:GLAlertSelectView?
let zhiFuFangShiArr = ["未支付","现金","转账(私)","转账(公)","转账(微信)","转账(支付宝)"]
var zhiFuSelect:Int?//选择支付方式
var zhiFuStatus = ["未付款","欠款","月结","已付款"]
var zhiFuStatusSelect:Int?//付款状态
@IBOutlet weak var btmViewH: NSLayoutConstraint!
@IBOutlet weak var bottomView: UIView!
@IBOutlet weak var listView: UITableView!
......@@ -36,7 +47,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
func loadData() {
HUD.flash(.progress)
let UserToken = UserDefaults.standard.value(forKey: "user_token")
orderDetail(["user_token":UserToken as Any,"order_id":orderId as Any], success: { (data) in
orderDetail(["user_token":"RQdwz5QKpeg=","order_id":"11570"], success: { (data) in
HUD.hide(animated: true)
let dataM = data as! OrderDetailModel
self.dataMdoel = dataM.data
......@@ -337,7 +348,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
cell.tag = indexPath.row
cell.titleLbl.text = YuShouPart3Arr[indexPath.row]
switch indexPath.row {
case 4:
case 5:
cell.placeLbl.text = self.dataMdoel?.order_res?.lwb_no
if self.dataMdoel?.order_res?.lwb_no == nil {
cell.placeLbl.text = "-"
......@@ -345,12 +356,6 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
cell.placeLbl.text = "请输入物流单号"
}
break
case 5:
cell.placeLbl.text = self.dataMdoel?.order_res?.lc_name
if cell.placeLbl.text?.count == 0 {
cell.placeLbl.text = "请输入物流公司"
}
break
case 9:
cell.placeLbl.text = self.dataMdoel?.order_res?.order_postscript
......@@ -422,6 +427,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
let vc = ShowAlGoodsViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
//MARK:--选择的关联客户返回数据
var selectKeHuData:CusListAllDataModel? = nil
func GuanLianKehuSelect(keHuData: CusListAllDataModel) {
......@@ -444,16 +450,54 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
self.navigationController?.pushViewController(vc, animated: true)
break
case "支付方式":
print("abc")
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.tag = cell.tag
view.titleLbl.text = "请选择支付方式"
view.delegate = self
view.dataArr = zhiFuFangShiArr
if zhiFuSelect != nil {
view.selectNum = zhiFuSelect!
}
self.view.addSubview(view)
glSelectView = view
}
break
case "支付状态":
print("123")
if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds)
view.tag = cell.tag
view.titleLbl.text = "请选择支付状态"
view.delegate = self
view.dataArr = zhiFuStatus
if zhiFuStatusSelect != nil {
view.selectNum = zhiFuStatusSelect!
}
self.view.addSubview(view)
glSelectView = view
}
break
default:
break
}
}
func GLAlertSelectViewClick(selectNum: Int, view: GLAlertSelectView) {
if view.titleLbl.text == "请选择支付方式" {
zhiFuSelect = selectNum
}else{
zhiFuStatusSelect = selectNum
}
glSelectView?.removeFromSuperview()
glSelectView = nil
}
func GLAlertSelectViewClose(sender: UIButton) {
glSelectView?.removeFromSuperview()
glSelectView = nil
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
}
//MARK: - section delegate
func numberOfSections(in tableView: UITableView) -> Int {
if self.dataMdoel == nil {
......
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