Commit 47c7bcf3 authored by Steven杜宇's avatar Steven杜宇

// 原则批

parent 509a93e4
...@@ -73,7 +73,6 @@ extension YHPrincipleApprovedMailViewController { ...@@ -73,7 +73,6 @@ extension YHPrincipleApprovedMailViewController {
func requestData() { func requestData() {
let group = DispatchGroup() let group = DispatchGroup()
group.enter() group.enter()
let params: [String : Any] = ["order_id" : orderId, let params: [String : Any] = ["order_id" : orderId,
"search_type" : 1] "search_type" : 1]
......
...@@ -7,12 +7,13 @@ ...@@ -7,12 +7,13 @@
// //
import UIKit import UIKit
import SmartCodable
class YHPrincipleReviewListVC: YHBaseViewController { class YHPrincipleReviewListVC: YHBaseViewController {
var orderId: Int = 0 var orderId: Int = 0
var status: Int = 0 var status: Int = 0
var items: [YHPrincipleWaitResultModel] = [] var items: [SmartCodable] = []
let viewModel = YHPrincleViewModel() let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -26,8 +27,9 @@ class YHPrincipleReviewListVC: YHBaseViewController { ...@@ -26,8 +27,9 @@ class YHPrincipleReviewListVC: YHBaseViewController {
tableView.dataSource = self tableView.dataSource = self
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHPrinciplePhotoCollectCell.self, forCellReuseIdentifier: YHPrinciplePhotoCollectCell.cellReuseIdentifier) tableView.register(YHPrincipleUploadStatusCell.self, forCellReuseIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier)
tableView.register(YHPrincipleUnapprovedCell.self, forCellReuseIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier) tableView.register(YHPrincipleUnapprovedCell.self, forCellReuseIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier)
tableView.register(YHPrincipleEnvelopeCell.self, forCellReuseIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier)
return tableView return tableView
}() }()
...@@ -50,7 +52,7 @@ class YHPrincipleReviewListVC: YHBaseViewController { ...@@ -50,7 +52,7 @@ class YHPrincipleReviewListVC: YHBaseViewController {
gk_navigationBar.backgroundColor = .clear gk_navigationBar.backgroundColor = .clear
createUI() createUI()
items.removeAll() items.removeAll()
requestData()
} }
func createUI() { func createUI() {
...@@ -68,9 +70,69 @@ class YHPrincipleReviewListVC: YHBaseViewController { ...@@ -68,9 +70,69 @@ class YHPrincipleReviewListVC: YHBaseViewController {
func requestData() { func requestData() {
// viewModel.getPrincipleUploadDetail(orderId: orderId) { <#Bool#>, <#YHErrorModel?#> in let group = DispatchGroup()
// <#code#> group.enter()
// } // 请求上传信息(《赴港居留同意书》、申请人意见访问、其他证明材料)
viewModel.getPrincipleUploadDetail(orderId: orderId) { success, error in
// self.viewModel.uploadDetailModel
group.leave()
}
group.enter()
let params: [String : Any] = ["order_id" : orderId,
"search_type" : 1]
// 请求 入境处已认收受理 和 申请资料已递交港府留档
viewModel.getPrincipleWaitReviewResult(params: params) { success, error in
group.leave()
}
group.enter()
viewModel.getEnvelopeInfo(orderId: orderId) { success, error in
group.leave()
}
group.notify(queue: .main) {
self.updateData()
}
}
func updateData() {
self.items.removeAll()
// 赴港居留同意书
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
agreementModel.customType = YHPrincipleAgreementType.agreement.rawValue
agreementModel.title = "《赴港居留同意书》"
agreementModel.isMust = true
agreementModel.isNeedTemplate = true
self.items.append(agreementModel)
// 申请人意见访问
self.items.append(self.viewModel.uploadDetailModel.file_data.opinion)
// 其他证明条件
self.items.append(self.viewModel.uploadDetailModel.file_data.other)
// 已获得港府甄选名额
self.items.append(self.viewModel.envelopModel)
let waitResultModel = self.viewModel.waitResultModel
// 入境处已认收受理
let model2 = waitResultModel.copy()
model2.type = .entry
model2.title = "入境处已认收受理"
model2.subTitle = "申请确认通知书:(来自香港入境处)"
model2.isUnfold = false
self.items.append(model2)
// 申请资料已递交港府留档
let model3 = waitResultModel.copy()
model3.type = .profile
model3.title = "申请资料已递交港府留档"
model3.subTitle = "档案号:"
model3.isUnfold = false
self.items.append(model3)
self.tableView.reloadData()
} }
} }
...@@ -87,37 +149,53 @@ extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -87,37 +149,53 @@ extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// YHPrinciplePhotoCell let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) as! UITableViewCell
// YHPrincipleUnapprovedCell
// if indexPath.row%2 == 0 { if 0 <= indexPath.row && indexPath.row < items.count {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUnapprovedCell let m = items[indexPath.row]
if m is YHPrincipleWaitResultModel {
// 入境处已认收受理 和 申请资料已递交港府留档 cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUnapprovedCell
let model = m as! YHPrincipleWaitResultModel
cell.updateModel(model)
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
model.isUnfold = isUnfold
self.tableView.reloadData()
}
return cell
}
if 0 <= indexPath.row && indexPath.row < items.count { if m is YHPrincipleEnvelopeModel {
let model = items[indexPath.row] // 已获得港府甄选名额 信封cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell
let model = m as! YHPrincipleEnvelopeModel
cell.updateModel(model) cell.updateModel(model)
cell.expandClick = { cell.expandClick = {
[weak self] isExpand in [weak self] isUnfold in
guard let self = self else { return } guard let self = self else { return }
model.isUnfold = isExpand model.isUnfold = isUnfold
self.tableView.reloadData() self.tableView.reloadData()
} }
return cell
} }
// return cell
// } if m is YHPrincipleAgreementModel {
// 上传文件 cell
// let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
// let model = m as! YHPrincipleAgreementModel
// if 0 <= indexPath.row && indexPath.row < items.count { cell.updateModel(model)
// let model = items[indexPath.row] cell.expandClick = {
// cell.updateModel(model) [weak self] isUnfold in
// cell.expandClick = { guard let self = self else { return }
// [weak self] isExpand in model.isUnfold = isUnfold
// guard let self = self else { return } self.tableView.reloadData()
// model.isUnfold = isExpand }
// self.tableView.reloadData() return cell
// } }
// } }
return cell return cell
} }
......
...@@ -11,8 +11,8 @@ import AttributedString ...@@ -11,8 +11,8 @@ import AttributedString
class YHPrincipleWaitResultViewController: YHBaseViewController { class YHPrincipleWaitResultViewController: YHBaseViewController {
var orderId: Int = 0 var orderId: Int = -1
var status: Int = 11 var status: Int = -1
var items: [YHPrincipleWaitResultModel] = [] var items: [YHPrincipleWaitResultModel] = []
let viewModel = YHPrincleViewModel() let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -84,21 +84,25 @@ extension YHPrincipleWaitResultViewController { ...@@ -84,21 +84,25 @@ extension YHPrincipleWaitResultViewController {
} }
// 入境处已认收受理 // 入境处已认收受理
let model2 = waitResultModel.copy() if !waitResultModel.applicationFileNumberAttachment.isEmpty {
model2.type = .entry let model2 = waitResultModel.copy()
model2.title = "入境处已认收受理" model2.type = .entry
model2.subTitle = "申请确认通知书:(来自香港入境处)" model2.title = "入境处已认收受理"
model2.isUnfold = false model2.subTitle = "申请确认通知书:(来自香港入境处)"
self.items.append(model2) model2.isUnfold = true
self.items.append(model2)
}
// 申请资料已递交港府留档 // 申请资料已递交港府留档
let model3 = waitResultModel.copy() if waitResultModel.fileNumberList.count > 0 {
model3.type = .profile let model3 = waitResultModel.copy()
model3.title = "申请资料已递交港府留档" model3.type = .profile
model3.subTitle = "档案号:" model3.title = "申请资料已递交港府留档"
model3.isUnfold = false model3.subTitle = "档案号:"
self.items.append(model3) model3.isUnfold = true
self.items.append(model3)
}
self.tableView.reloadData() self.tableView.reloadData()
} }
} }
...@@ -175,7 +179,12 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD ...@@ -175,7 +179,12 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
var titleLabel = UILabel() var titleLabel = UILabel()
titleLabel.numberOfLines = 0 titleLabel.numberOfLines = 0
let title: ASAttributedString = .init("您好,\(self.viewModel.waitResultModel.applicant.userName)先生!", .font(UIFont.PFSC_M(ofSize: 24)),.foreground(UIColor.mainTextColor)) var name = self.viewModel.waitResultModel.applicant.userName
if name.count > 5 {
name = String(name.prefix(5)) + "..."
}
var callName = self.viewModel.waitResultModel.applicant.sex == 2 ? "女士" : "先生"
let title: ASAttributedString = .init("您好,\(name)\(callName)!", .font(UIFont.PFSC_M(ofSize: 24)),.foreground(UIColor.mainTextColor))
titleLabel.attributed.text = title titleLabel.attributed.text = title
view.addSubview(titleLabel) view.addSubview(titleLabel)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import SmartCodable import SmartCodable
import AttributedString
class YHPrincipleUploadDetailModel: SmartCodable { class YHPrincipleUploadDetailModel: SmartCodable {
...@@ -70,7 +71,15 @@ class YHPrincipleContentUrlModel: SmartCodable { ...@@ -70,7 +71,15 @@ class YHPrincipleContentUrlModel: SmartCodable {
} }
} }
enum YHPrincipleAgreementType: Int {
case none = 0
case agreement = 1 // 同意书
case opinion = 2 // 申请人意见访问
case other = 3 // 其他证明条件
}
class YHPrincipleAgreementModel: SmartCodable { class YHPrincipleAgreementModel: SmartCodable {
var id: Int = 0 var id: Int = 0
var order_id: Int = 0 var order_id: Int = 0
var plan_id: Int = 0 var plan_id: Int = 0
...@@ -145,6 +154,33 @@ class YHPrincipleAgreementModel: SmartCodable { ...@@ -145,6 +154,33 @@ class YHPrincipleAgreementModel: SmartCodable {
var handle_remark: String = "" var handle_remark: String = ""
var rejection_confirmation: Int = 0 var rejection_confirmation: Int = 0
// 自定义属性
var customType: Int = YHPrincipleAgreementType.none.rawValue
var isMust: Bool = false // 是否必须
var title: String = ""
var isNeedTemplate: Bool = true
var isNeedUploadBtn: Bool = true
// 灰色或红色提示语
var tips: String = ""
// 黑色或富文本
var tips1: String = ""
// 最底部红色提示语
var redTips: String = ""
// 是否展开
var isUnfold: Bool = false
//
var fileList:[String] = []
// static func getTips() -> ASAttributedString {
// let a: ASAttributedString = .init("请【下载模板】,填写信息,贵单位", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
// let b: ASAttributedString = .init("签字盖章", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x3570DC)))
// let c: ASAttributedString = .init("后,拍照or扫描上传", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
// return a + b + c
// }
required init() { required init() {
} }
......
...@@ -23,7 +23,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -23,7 +23,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
static let cellReuseIdentifier = "YHPrincipleUploadStatusCell" static let cellReuseIdentifier = "YHPrincipleUploadStatusCell"
var itemModel:YHPrincleGroupModel? var itemModel:YHPrincipleAgreementModel?
var items: [String] = [] var items: [String] = []
var expandClick:((Bool)->())? var expandClick:((Bool)->())?
...@@ -168,11 +168,11 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -168,11 +168,11 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
self.backgroundColor = .clear self.backgroundColor = .clear
} }
func updateModel(_ model:YHPrincleGroupModel) { func updateModel(_ model: YHPrincipleAgreementModel) {
itemModel = model itemModel = model
items.removeAll() items.removeAll()
items.append(contentsOf: model.fileList) // items.append(contentsOf: model.fileList)
contentView.removeSubviews() contentView.removeSubviews()
self.dotLineLayer.removeFromSuperlayer() self.dotLineLayer.removeFromSuperlayer()
...@@ -188,7 +188,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -188,7 +188,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
whiteView.addSubview(redTipsLabel) whiteView.addSubview(redTipsLabel)
grayLabel.text = model.tips grayLabel.text = model.tips
detailLabel.attributed.text = model.tips1 // detailLabel.attributed.text = model.tips1
templateButton.isHidden = !model.isNeedTemplate templateButton.isHidden = !model.isNeedTemplate
uploadBtn.isHidden = !model.isNeedUploadBtn uploadBtn.isHidden = !model.isNeedUploadBtn
if model.isNeedUploadBtn { if model.isNeedUploadBtn {
...@@ -236,10 +236,10 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -236,10 +236,10 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
} }
detailLabel.snp.remakeConstraints { make in detailLabel.snp.remakeConstraints { make in
make.top.equalTo(grayLabel.snp.bottom).offset(model.tips1.length <= 0 ? 0 : 16) make.top.equalTo(grayLabel.snp.bottom).offset(model.tips1.isEmpty ? 0 : 16)
make.left.equalTo(16) make.left.equalTo(16)
make.right.equalTo(-16) make.right.equalTo(-16)
if model.tips1.length <= 0 { if model.tips1.isEmpty {
make.height.equalTo(0) make.height.equalTo(0)
} }
} }
...@@ -275,25 +275,6 @@ class YHPrincipleUploadStatusCell: UITableViewCell { ...@@ -275,25 +275,6 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
} }
make.bottom.equalTo(-16) make.bottom.equalTo(-16)
} }
// if status == .preSubmit { // 待提交
//
//
// } else {
//
// self.titleLabel.attributed.text = mustTag + title + status
//
// if status == .review {
//
// } else if status == .rejected {
//
// } else if status == .pass {
//
// } else if status == .mail {
//
// }
// }
} }
func getUploadBgColor(status: YHPrincipleStatus) -> UIColor { func getUploadBgColor(status: YHPrincipleStatus) -> UIColor {
......
...@@ -380,8 +380,10 @@ class YHAllApiName { ...@@ -380,8 +380,10 @@ class YHAllApiName {
struct Principle { struct Principle {
// 原则批审批结果 // 原则批审批结果
static let getReviewResult = "super-app/order/approval/principle" static let getReviewResult = "super-app/order/approval/principle"
// ApprovalInfo 获取档案号 // 获取档案号列表
static let getProfileList = "super-app/order/approval/info" static let getProfileList = "super-app/order/approval/info"
// 原则批详情
static let getUploadDetail = "super-app/order/approval/uploadInfo"
} }
} }
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