Commit 5ede5b74 authored by Steven杜宇's avatar Steven杜宇

// 续签

parent 959f39ea
......@@ -157,6 +157,7 @@
0449EEEB2C8EF2B700A397FD /* YHResignMaterialListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0449EEEA2C8EF2B700A397FD /* YHResignMaterialListVC.swift */; };
0449EEEE2C8EF8CB00A397FD /* YHResignMaterialCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0449EEED2C8EF8CB00A397FD /* YHResignMaterialCell.swift */; };
0449EEF02C902A4100A397FD /* YHResignMaterialUploadVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0449EEEF2C902A4100A397FD /* YHResignMaterialUploadVC.swift */; };
0449EEF32C903A4100A397FD /* YHMaterialListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0449EEF22C903A4100A397FD /* YHMaterialListModel.swift */; };
044BACC72BCFA58E00184C64 /* YHNoDataTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044BACC62BCFA58E00184C64 /* YHNoDataTipsView.swift */; };
044CF8D42BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */; };
044CF8D62BBA57DC00008CE8 /* YHFailPromptView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 044CF8D52BBA57DC00008CE8 /* YHFailPromptView.swift */; };
......@@ -517,6 +518,7 @@
04EA376F2BEA071600DBAF64 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376E2BEA070500DBAF64 /* libc++.tbd */; };
04EA37742BEA0A3400DBAF64 /* YHShareManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04EA37732BEA0A3400DBAF64 /* YHShareManager.swift */; };
04EC2F812C22888E002907D7 /* YHFriendRequestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04EC2F802C22888E002907D7 /* YHFriendRequestView.swift */; };
04EFC8E92C903F1100FC680F /* YHResignMaterialViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04EFC8E82C903F1100FC680F /* YHResignMaterialViewModel.swift */; };
04F0ABF32C364F9400518C30 /* home.json in Resources */ = {isa = PBXBuildFile; fileRef = 04F0ABF02C364F9400518C30 /* home.json */; };
04F0ABF42C364F9400518C30 /* my.json in Resources */ = {isa = PBXBuildFile; fileRef = 04F0ABF12C364F9400518C30 /* my.json */; };
04F0ABF52C364F9400518C30 /* community.json in Resources */ = {isa = PBXBuildFile; fileRef = 04F0ABF22C364F9400518C30 /* community.json */; };
......@@ -927,6 +929,7 @@
0449EEEA2C8EF2B700A397FD /* YHResignMaterialListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignMaterialListVC.swift; sourceTree = "<group>"; };
0449EEED2C8EF8CB00A397FD /* YHResignMaterialCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignMaterialCell.swift; sourceTree = "<group>"; };
0449EEEF2C902A4100A397FD /* YHResignMaterialUploadVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignMaterialUploadVC.swift; sourceTree = "<group>"; };
0449EEF22C903A4100A397FD /* YHMaterialListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMaterialListModel.swift; sourceTree = "<group>"; };
044BACC62BCFA58E00184C64 /* YHNoDataTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNoDataTipsView.swift; sourceTree = "<group>"; };
044CF8D32BB6BCF700008CE8 /* YHSignatureUploadTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSignatureUploadTableViewCell.swift; sourceTree = "<group>"; };
044CF8D52BBA57DC00008CE8 /* YHFailPromptView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFailPromptView.swift; sourceTree = "<group>"; };
......@@ -1290,6 +1293,7 @@
04EA376E2BEA070500DBAF64 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
04EA37732BEA0A3400DBAF64 /* YHShareManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHShareManager.swift; sourceTree = "<group>"; };
04EC2F802C22888E002907D7 /* YHFriendRequestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFriendRequestView.swift; sourceTree = "<group>"; };
04EFC8E82C903F1100FC680F /* YHResignMaterialViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignMaterialViewModel.swift; sourceTree = "<group>"; };
04F0ABF02C364F9400518C30 /* home.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = home.json; sourceTree = "<group>"; };
04F0ABF12C364F9400518C30 /* my.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = my.json; sourceTree = "<group>"; };
04F0ABF22C364F9400518C30 /* community.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = community.json; sourceTree = "<group>"; };
......@@ -1945,6 +1949,8 @@
0449EEE62C8EEA2B00A397FD /* ResignMaterialManage(续期资料管理) */ = {
isa = PBXGroup;
children = (
04EFC8E72C903EEC00FC680F /* VM */,
0449EEF12C9039F000A397FD /* M */,
0449EEEC2C8EF7BA00A397FD /* V */,
0449EEE72C8EEA8A00A397FD /* C */,
);
......@@ -1969,6 +1975,14 @@
path = V;
sourceTree = "<group>";
};
0449EEF12C9039F000A397FD /* M */ = {
isa = PBXGroup;
children = (
0449EEF22C903A4100A397FD /* YHMaterialListModel.swift */,
);
path = M;
sourceTree = "<group>";
};
044D0BE82C2019AC00C5CF5E /* Community(社区) */ = {
isa = PBXGroup;
children = (
......@@ -3185,6 +3199,14 @@
path = Server;
sourceTree = "<group>";
};
04EFC8E72C903EEC00FC680F /* VM */ = {
isa = PBXGroup;
children = (
04EFC8E82C903F1100FC680F /* YHResignMaterialViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
};
04F957492C2032A0003C631C /* V */ = {
isa = PBXGroup;
children = (
......@@ -4641,6 +4663,7 @@
044D0C1C2C22C30B00C5CF5E /* YHEditSchoolViewController.swift in Sources */,
A5CA3F562C74850200EB22F5 /* YHUploadCertificateDetailVC.swift in Sources */,
A5ACE9532B4564F7002C94D2 /* YHBaseViewController.swift in Sources */,
04EFC8E92C903F1100FC680F /* YHResignMaterialViewModel.swift in Sources */,
04256DE82C7314B500A37BA4 /* YHSelectApplicantCell.swift in Sources */,
045EEE9D2B9F171A0022A143 /* YHWorkItemListViewModel.swift in Sources */,
A5ACE9392B4564F7002C94D2 /* UIDevice+Extension.swift in Sources */,
......@@ -4870,6 +4893,7 @@
045EEEDD2B9F171A0022A143 /* YHCollegeNameCell.swift in Sources */,
04256DFA2C742A1500A37BA4 /* YHFamilyGroupModel.swift in Sources */,
045EEF162B9F171A0022A143 /* YHMainApplicantInformationViewController.swift in Sources */,
0449EEF32C903A4100A397FD /* YHMaterialListModel.swift in Sources */,
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */,
04256E172C75BD2700A37BA4 /* YHVisaPaymentTipsCell.swift in Sources */,
045EEEAA2B9F171A0022A143 /* YHWorkExampleViewController.swift in Sources */,
......
......@@ -11,7 +11,11 @@ import JXSegmentedView
class YHResignMaterialListVC: YHBaseViewController {
var items:[[YHSupplementInfo]] = []
var items:[YHResignMaterialInfo] = [] {
didSet {
self.tableView.reloadData()
}
}
// 列表是否是展开
var isUnfold = true
......@@ -61,17 +65,7 @@ class YHResignMaterialListVC: YHBaseViewController {
func getData() {
let arr1 = [YHSupplementInfo(checkStatus:1),
YHSupplementInfo(checkStatus:2),
YHSupplementInfo(checkStatus:3),
YHSupplementInfo(checkStatus:4),]
let arr2 = [YHSupplementInfo(checkStatus:1),
YHSupplementInfo(checkStatus:2),
YHSupplementInfo(checkStatus:3),
YHSupplementInfo(checkStatus:4),]
items.append(contentsOf: [arr1, arr2])
self.tableView.reloadData()
}
}
......@@ -84,8 +78,8 @@ extension YHResignMaterialListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if 0 <= section && section < items.count {
let arr = items[section]
return arr.count
let list = items[section]
return list.materials.count
}
return 0
}
......@@ -95,14 +89,15 @@ extension YHResignMaterialListVC: UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignMaterialCell.cellReuseIdentifier, for: indexPath) as! YHResignMaterialCell
if 0 <= indexPath.section && indexPath.section < items.count {
let arr = items[indexPath.section]
if 0 <= indexPath.row, indexPath.row < arr.count {
let item = arr[indexPath.row]
let list = items[indexPath.section]
if 0 <= indexPath.row, indexPath.row < list.materials.count {
let item = list.materials[indexPath.row]
cell.updateModel(item)
cell.templateBlock = {
[weak self] in
guard let self = self else { return }
let view = YHCertificateTemplateSheetView.templateView(item.templateInfo)
let model = YHTemplateInfo()
let view = YHCertificateTemplateSheetView.templateView(model)
view.scanTemplateBlock = {
[weak self] path in
guard let self = self else { return }
......@@ -158,9 +153,13 @@ extension YHResignMaterialListVC: UITableViewDelegate, UITableViewDataSource {
let titleLabel = UILabel()
titleLabel.font = UIFont.PFSC_R(ofSize: 15)
titleLabel.textColor = .mainTextColor
titleLabel.text = section == 0 ? "工作资料" : "生活资料"
view.addSubview(titleLabel)
if 0 <= section && section < items.count {
let info = items[section]
titleLabel.text = info.title
}
let img = isUnfold ? "resign_material_list_unfold" : "resign_material_list_fold"
let arrowImgV = UIImageView(image: UIImage(named: img))
view.addSubview(arrowImgV)
......
......@@ -15,16 +15,4 @@ class YHResignMaterialUploadVC: YHBaseViewController {
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
......@@ -12,8 +12,13 @@ import JXSegmentedView
class YHResinMaterialManageContainerVC: YHBaseViewController {
static let segmentHeight = 40.0
let viewModel = YHResignMaterialViewModel()
var titles = ["全部", "待上传(0)", "已驳回(0)", "审核中(0)", "已完成(0)"]
var itemVCs:[YHResignMaterialListVC] = []
let itemVCs:[YHResignMaterialListVC] = [YHResignMaterialListVC(),
YHResignMaterialListVC(),
YHResignMaterialListVC(),
YHResignMaterialListVC(),
YHResignMaterialListVC()]
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
......@@ -63,6 +68,11 @@ class YHResinMaterialManageContainerVC: YHBaseViewController {
createUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
requestData()
}
func createUI() {
self.gk_navTitle = "续签资料管理"
......@@ -91,6 +101,38 @@ class YHResinMaterialManageContainerVC: YHBaseViewController {
make.bottom.equalToSuperview()
}
}
func requestData() {
let params: [String : Any] = ["order_id" : 151336,
"id" : 351]
viewModel.getMaterialList(param: params) { success, error in
for (index, vc) in self.itemVCs.enumerated() {
if index == 0 {
vc.items = self.viewModel.allGroup.getDataArr()
} else if index == 1 {
vc.items = self.viewModel.preuploadGroup.getDataArr()
} else if index == 2 {
vc.items = self.viewModel.rejectedGroup.getDataArr()
} else if index == 3 {
vc.items = self.viewModel.reviewGroup.getDataArr()
} else if index == 4 {
vc.items = self.viewModel.finishGroup.getDataArr()
}
}
self.titles = ["全部",
"带上传(\(self.viewModel.preuploadGroup.getTotalCount()))",
"已驳回(\(self.viewModel.rejectedGroup.getTotalCount()))",
"审核中(\(self.viewModel.reviewGroup.getTotalCount()))",
"已完成(\(self.viewModel.finishGroup.getTotalCount()))",]
self.segmentedDataSource.titles = self.titles
self.segmentedView.reloadDataWithoutListContainer()
}
}
}
extension YHResinMaterialManageContainerVC: JXSegmentedListContainerViewDataSource {
......
//
// YHMaterialListModel.swift
// galaxy
//
// Created by edy on 2024/9/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
enum YHMaterialType: String {
// 资料类型(CERT=证件资料 WORK=工作资料 LIVE=生活资料)
case cer = "CERT"
case work = "WORK"
case live = "LIVE"
}
enum YHMaterialStatus: String {
case all = "ALL" // 自定义
// (未开始=NOT_OPEN 待上传=TO_BE_UPLOAD 待审核= PENDING_AUDIT 已驳回=REJECTED 已完成= COMPLETED)
case unOpen = "NOT_OPEN"
case preUpload = "TO_BE_UPLOAD"
case review = "PENDING_AUDIT"
case rejected = "REJECTED"
case completed = "COMPLETED"
}
class YHMaterialListModel: SmartCodable {
var id: Int = 0
var order_sn: String = ""
var status: String = ""
var stay_deadline: String = ""
var material: [YHMaterialModel] = []
var members: [YHMembersModel] = []
required init() {
}
}
class YHMaterialModel: SmartCodable {
var id: Int = 0
var renewal_id: Int = 0
var order_id: Int = 0
var subset_id: Int = 0
var information_id: Int = 0
var template_id: Int = 0
var relation: Int = 0
// 资料类型(CERT=证件资料 WORK=工作资料 LIVE=生活资料)
var mtype: String = ""
var name: String = ""
var info: String = ""
var upload_require: String = ""
var audit_at: String = ""
var audit_uid: Int = 0
// 状态(待上传=TO_BE_UPLOAD 待审核= PENDING_AUDIT 已驳回=REJECTED 已完成= COMPLETED)
var status: String = ""
var remark: String = ""
var audit_remark: String = ""
var created_at: String = ""
var updated_at: String = ""
var deleted_at: String = ""
required init() {
}
}
class YHMembersModel: SmartCodable {
var id: Int = 0
var renewal_number: Int = 0
var apply_name: String = ""
var apply_relation: Int = 0
var apply_relation_text: String = ""
required init() {
}
}
......@@ -28,7 +28,7 @@ class YHResignMaterialCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignMaterialCell"
var model: YHSupplementInfo = YHSupplementInfo()
var model: YHMaterialModel = YHMaterialModel()
var status : YHCertificateUploadStatus = .preUpload
var templateBlock:(()->())?
var whiteView: UIView!
......@@ -52,9 +52,6 @@ class YHResignMaterialCell: UITableViewCell {
}()
@objc func didTemplateBtnClicked() {
if self.model.isNeedDealt { // 银河代办
return
}
if let templateBlock = templateBlock {
templateBlock()
}
......@@ -69,32 +66,34 @@ class YHResignMaterialCell: UITableViewCell {
setupUI()
}
func updateModel(_ model: YHSupplementInfo) {
func updateModel(_ model: YHMaterialModel) {
self.model = model
if let status = YHMaterialUploadStatus(rawValue: model.checkStatus) {
var titleColor: UIColor = .labelTextColor2
var title = ""
switch status {
case .unStarted:
if model.status == YHMaterialStatus.unOpen.rawValue {
titleColor = .mainTextColor(alpha: 0.5)
title = "未开始".local
case .preUpload:
} else if model.status == YHMaterialStatus.preUpload.rawValue {
titleColor = .brandMainColor
title = "待上传".local
case .rejected:
} else if model.status == YHMaterialStatus.rejected.rawValue {
titleColor = .failColor
title = "已驳回".local
case .review:
} else if model.status == YHMaterialStatus.review.rawValue {
titleColor = .init(hex: 0xFF8000)
title = "审核中".local
case .finish:
} else if model.status == YHMaterialStatus.completed.rawValue {
titleColor = .init(hex: 0x3CC694)
title = "已完成".local
case .all:
titleColor = .labelTextColor2
}
statusLabel.text = title
statusLabel.textColor = titleColor
......@@ -102,20 +101,18 @@ class YHResignMaterialCell: UITableViewCell {
self.rightArrowImgV.image = img
self.rightArrowImgV.tintColor = titleColor
}
var result:ASAttributedString = .init(string:"", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor))
var name = "其他证明" //model.name
var name = model.name
let cerName: ASAttributedString = .init(string:name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
var template: ASAttributedString = " \(.view(templateButton, .original(.center)))"
// 是否展示右边的模版按钮
var showTemplateBtn = true
if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty {
showTemplateBtn = false
}
// if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty {
//
// showTemplateBtn = false
// }
if true {
result += mustTag
......
//
// YHResignMaterialViewModel.swift
// galaxy
//
// Created by edy on 2024/9/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignMaterialInfo {
var title: String = ""
var materials: [YHMaterialModel] = []
init(title: String, materials: [YHMaterialModel]) {
self.title = title
self.materials = materials
}
}
class YHResignMaterialGroup {
var status: YHMaterialStatus = .all
// 工作资料
var works:[YHMaterialModel] = []
// 生活资料
var lifes:[YHMaterialModel] = []
// 证件资料
var cers: [YHMaterialModel] = []
func getTotalCount() -> Int {
return works.count + lifes.count + cers.count
}
func clear() {
works.removeAll()
lifes.removeAll()
cers.removeAll()
}
func getDataArr()-> [YHResignMaterialInfo] {
var arr:[YHResignMaterialInfo] = []
if works.count > 0 {
let work = YHResignMaterialInfo(title: "工作资料", materials: works)
arr.append(work)
}
if lifes.count > 0 {
let life = YHResignMaterialInfo(title: "生活资料", materials: lifes)
arr.append(life)
}
if cers.count > 0 {
let cer = YHResignMaterialInfo(title: "证件资料", materials: cers)
arr.append(cer)
}
return arr
}
}
class YHResignMaterialViewModel: NSObject {
// 全部
var allGroup: YHResignMaterialGroup = YHResignMaterialGroup()
// 待上传
var preuploadGroup: YHResignMaterialGroup = YHResignMaterialGroup()
// 已驳回
var rejectedGroup: YHResignMaterialGroup = YHResignMaterialGroup()
// 审核中
var reviewGroup: YHResignMaterialGroup = YHResignMaterialGroup()
// 已完成
var finishGroup: YHResignMaterialGroup = YHResignMaterialGroup()
func clear() {
self.allGroup.clear()
self.preuploadGroup.clear()
self.rejectedGroup.clear()
self.reviewGroup.clear()
self.finishGroup.clear()
}
func getMaterialList(param:[String : Any], callback:((_ success: Bool,_ error:YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignMaterial.resignMaterialList
let _ = YHNetRequest.getRequest(url: strUrl,params: param) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
let dic = json.data
guard let resultModel = YHMaterialListModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
self.clear()
callback?(false, err)
return
}
let materials = resultModel.material
self.allGroup = self.generateGroup(status: .all, materials:materials)
self.preuploadGroup = self.generateGroup(status: .preUpload, materials:materials)
self.rejectedGroup = self.generateGroup(status: .rejected, materials:materials)
self.reviewGroup = self.generateGroup(status: .review, materials:materials)
self.finishGroup = self.generateGroup(status: .completed, materials:materials)
callback?(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
self.clear()
callback?(false, err)
}
} failBlock: { err in
self.clear()
callback?(false, err)
}
}
func generateGroup(status: YHMaterialStatus, materials:[YHMaterialModel]) -> YHResignMaterialGroup {
let group = YHResignMaterialGroup()
group.status = status
for material in materials {
let condition: Bool = (status == .all ? true : material.status == status.rawValue)
if condition {
if material.mtype == YHMaterialType.work.rawValue {
group.works.append(material)
}
if material.mtype == YHMaterialType.live.rawValue {
group.lifes.append(material)
}
if material.mtype == YHMaterialType.cer.rawValue {
group.cers.append(material)
}
}
}
return group
}
}
......@@ -338,6 +338,13 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
return
}
// if true {
// TEST DY
// let vc = YHResinMaterialManageContainerVC()
// self.navigationController?.pushViewController(vc)
// return
// }
let item: PersonalModuleItem = items[indexPath.row]
switch item.type {
case .myCard://我的名片
......
......@@ -510,4 +510,10 @@ class YHAllApiName {
static let dependentsCheck = "super-app/order/information/dependents/check"
}
// 续签资料
struct ResignMaterial {
static let resignMaterialList = "super-app/identity-renewal/renewal-batch-list"
}
}
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