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

// 原则批

parent 509a93e4
......@@ -73,7 +73,6 @@ extension YHPrincipleApprovedMailViewController {
func requestData() {
let group = DispatchGroup()
group.enter()
let params: [String : Any] = ["order_id" : orderId,
"search_type" : 1]
......
......@@ -7,12 +7,13 @@
//
import UIKit
import SmartCodable
class YHPrincipleReviewListVC: YHBaseViewController {
var orderId: Int = 0
var status: Int = 0
var items: [YHPrincipleWaitResultModel] = []
var items: [SmartCodable] = []
let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = {
......@@ -26,8 +27,9 @@ class YHPrincipleReviewListVC: YHBaseViewController {
tableView.dataSource = self
tableView.backgroundColor = .clear
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(YHPrincipleEnvelopeCell.self, forCellReuseIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier)
return tableView
}()
......@@ -50,7 +52,7 @@ class YHPrincipleReviewListVC: YHBaseViewController {
gk_navigationBar.backgroundColor = .clear
createUI()
items.removeAll()
requestData()
}
func createUI() {
......@@ -68,9 +70,69 @@ class YHPrincipleReviewListVC: YHBaseViewController {
func requestData() {
// viewModel.getPrincipleUploadDetail(orderId: orderId) { <#Bool#>, <#YHErrorModel?#> in
// <#code#>
// }
let group = DispatchGroup()
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 {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// YHPrinciplePhotoCell
// YHPrincipleUnapprovedCell
let cell = tableView.dequeueReusableCell(withIdentifier: "UITableViewCell", for: indexPath) as! UITableViewCell
// if indexPath.row%2 == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUnapprovedCell
if 0 <= indexPath.row && indexPath.row < items.count {
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 {
let model = items[indexPath.row]
if m is YHPrincipleEnvelopeModel {
// 已获得港府甄选名额 信封cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell
let model = m as! YHPrincipleEnvelopeModel
cell.updateModel(model)
cell.expandClick = {
[weak self] isExpand in
[weak self] isUnfold in
guard let self = self else { return }
model.isUnfold = isExpand
model.isUnfold = isUnfold
self.tableView.reloadData()
}
return cell
}
// return cell
// }
// let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
//
// if 0 <= indexPath.row && indexPath.row < items.count {
// let model = items[indexPath.row]
// cell.updateModel(model)
// cell.expandClick = {
// [weak self] isExpand in
// guard let self = self else { return }
// model.isUnfold = isExpand
// self.tableView.reloadData()
// }
// }
if m is YHPrincipleAgreementModel {
// 上传文件 cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
let model = m as! YHPrincipleAgreementModel
cell.updateModel(model)
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
model.isUnfold = isUnfold
self.tableView.reloadData()
}
return cell
}
}
return cell
}
......
......@@ -11,8 +11,8 @@ import AttributedString
class YHPrincipleWaitResultViewController: YHBaseViewController {
var orderId: Int = 0
var status: Int = 11
var orderId: Int = -1
var status: Int = -1
var items: [YHPrincipleWaitResultModel] = []
let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = {
......@@ -84,21 +84,25 @@ extension YHPrincipleWaitResultViewController {
}
// 入境处已认收受理
let model2 = waitResultModel.copy()
model2.type = .entry
model2.title = "入境处已认收受理"
model2.subTitle = "申请确认通知书:(来自香港入境处)"
model2.isUnfold = false
self.items.append(model2)
if !waitResultModel.applicationFileNumberAttachment.isEmpty {
let model2 = waitResultModel.copy()
model2.type = .entry
model2.title = "入境处已认收受理"
model2.subTitle = "申请确认通知书:(来自香港入境处)"
model2.isUnfold = true
self.items.append(model2)
}
// 申请资料已递交港府留档
let model3 = waitResultModel.copy()
model3.type = .profile
model3.title = "申请资料已递交港府留档"
model3.subTitle = "档案号:"
model3.isUnfold = false
self.items.append(model3)
if waitResultModel.fileNumberList.count > 0 {
let model3 = waitResultModel.copy()
model3.type = .profile
model3.title = "申请资料已递交港府留档"
model3.subTitle = "档案号:"
model3.isUnfold = true
self.items.append(model3)
}
self.tableView.reloadData()
}
}
......@@ -175,7 +179,12 @@ extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewD
var titleLabel = UILabel()
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
view.addSubview(titleLabel)
......
......@@ -8,6 +8,7 @@
import UIKit
import SmartCodable
import AttributedString
class YHPrincipleUploadDetailModel: 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 {
var id: Int = 0
var order_id: Int = 0
var plan_id: Int = 0
......@@ -145,6 +154,33 @@ class YHPrincipleAgreementModel: SmartCodable {
var handle_remark: String = ""
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() {
}
......
......@@ -23,7 +23,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
static let cellReuseIdentifier = "YHPrincipleUploadStatusCell"
var itemModel:YHPrincleGroupModel?
var itemModel:YHPrincipleAgreementModel?
var items: [String] = []
var expandClick:((Bool)->())?
......@@ -168,11 +168,11 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
self.backgroundColor = .clear
}
func updateModel(_ model:YHPrincleGroupModel) {
func updateModel(_ model: YHPrincipleAgreementModel) {
itemModel = model
items.removeAll()
items.append(contentsOf: model.fileList)
// items.append(contentsOf: model.fileList)
contentView.removeSubviews()
self.dotLineLayer.removeFromSuperlayer()
......@@ -188,7 +188,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
whiteView.addSubview(redTipsLabel)
grayLabel.text = model.tips
detailLabel.attributed.text = model.tips1
// detailLabel.attributed.text = model.tips1
templateButton.isHidden = !model.isNeedTemplate
uploadBtn.isHidden = !model.isNeedUploadBtn
if model.isNeedUploadBtn {
......@@ -236,10 +236,10 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
}
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.right.equalTo(-16)
if model.tips1.length <= 0 {
if model.tips1.isEmpty {
make.height.equalTo(0)
}
}
......@@ -275,25 +275,6 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
}
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 {
......
......@@ -380,8 +380,10 @@ class YHAllApiName {
struct Principle {
// 原则批审批结果
static let getReviewResult = "super-app/order/approval/principle"
// ApprovalInfo 获取档案号
// 获取档案号列表
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