Commit db561ca2 authored by pete谢兆麟's avatar pete谢兆麟

签字流程

parent 47c8d594
This diff is collapsed.
......@@ -24,6 +24,12 @@ class YHDocumentFileItemView: UIView {
}
}
var docDataSource: YHMySignedDocumentModel? {
didSet {
updateDocAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
......@@ -144,6 +150,36 @@ class YHDocumentFileItemView: UIView {
fileNameLabel.text = name + "\(index + 1)(已签章)"
}
func updateDocAllViews() {
guard let docDataSource = docDataSource else { return }
let suffix = docDataSource.url.pathExtension.lowercased()
var iconImgName = ""
if suffix == "jpeg" {
iconImgName = "my_cer_type_jpg"
} else if suffix == "jpg" {
iconImgName = "my_cer_type_jpg"
} else if suffix == "png" {
iconImgName = "my_cer_type_png"
} else if suffix == "pdf" {
iconImgName = "my_cer_type_pdf"
} else if suffix == "doc" || suffix == "docx" {
iconImgName = "my_cer_type_word"
} else if suffix == "ppt" || suffix == "pptx" {
iconImgName = "my_cer_type_ppt"
} else if suffix == "bmp" {
iconImgName = "my_cer_type_bmp"
} else if suffix == "tiff" {
iconImgName = "my_cer_type_tiff"
} else if suffix == "xls" || suffix == "xlsx" {
iconImgName = "my_cer_type_excel"
}
fileImageView.image = UIImage(named: iconImgName)
fileNameLabel.text = docDataSource.fileName
}
@objc func centerClick() {
if let block = itemBlock {
block(.look, index)
......
......@@ -21,6 +21,22 @@ class YHMySignatureDetailModel: SmartCodable {
var is_show_button: Bool = false
var status: Int = 0
var audit_opinion: String = ""
var docStatus: Int = 0
var signFileOrigin: String = ""
var signFile: String = ""
var docType: Int = 0
var signedDocument: [YHMySignedDocumentModel] = []
required init() {
}
}
class YHMySignedDocumentModel: SmartCodable {
var fileName: String = ""
var fileUrl: String = ""
var timestamp: String = ""
var url: String = ""
var name: String = ""
required init() {
}
}
......
......@@ -17,6 +17,7 @@ enum YHMyFileMethodType: Int {
case upload = 5 // 上传
case delete = 6 // 删除
case reUpload = 7 // 重传
case add = 8 //补充信息
}
class YHSignatureToActionTableViewCell: UITableViewCell {
......
......@@ -95,7 +95,7 @@ extension YHGCMySignatureListViewController {
YHHUD.flash(message: error?.errorMsg ?? "数据获取失败")
}
self.headSessionView.titleLable.text = self.viewModel.mainModel?.top_title
self.headSessionView.userInfoData = self.viewModel.mainModel?.user_info
self.headSessionView.canShowDownLoadBtnFlag = true
self.tableView.reloadData()
})
......@@ -342,6 +342,7 @@ extension YHGCMySignatureListViewController: UITableViewDelegate, UITableViewDat
vc.id = model.id
// vc.isAuth = viewModel.mainModel?.user_info.is_auth ?? true
vc.orderID = orderId
vc.mobile = mobile
self.navigationController?.pushViewController(vc)
}
}
......
//
// YHGCSignatureAddViewController.swift
// galaxy
//
// Created by EDY on 2024/12/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCSignatureAddViewController: YHBaseViewController {
var bottomView: YHBottomNextView!
var tableView: UITableView!
var viewModel: YHGCSignatureAddViewModel!
var baseDataSource: [YHSectionWorkExperienceModel]?
var workID: Int = 0
var orderID: Int = 0
var isMore: Bool = false
var isShowPrompt: Bool = false
var isShowMessageSelect: Bool = true
var isKeyboardShow: Bool = false
var selectReasonIndex: Int = 5
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHGCSignatureAddViewModel()
gk_navTitle = "信息补充"
gk_navBackgroundColor = .white
gk_navBarAlpha = 1.0
setView()
getData()
}
func getData() {
viewModel.requestDetail(orderID) {[weak self] success, error in
guard let self = self else { return }
if success ?? false {
updateDataSource()
} else {
self.viewModel.position.order_id = orderID
updateDataSource()
}
}
}
func updateDataSource() {
bottomView.nextButton.setTitle("提交", for: .normal)
self.baseDataSource = self.viewModel.getBaseDataSource(false)
self.tableView.reloadData()
}
func setView() {
tableView = {
let tableView = UITableView(frame: .zero, style: .grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.sectionHeaderHeight = 16
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHGCSignatureAddTableViewCell.self)
tableView.register(cellWithClass: YHGCDocumentPromptTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view)
}
bottomView = {
let bottom = YHBottomNextView()
bottom.saveButton.isHidden = true
bottom.nextButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(10)
make.height.equalTo(44)
make.left.equalTo(16)
}
bottom.nextblock = { [weak self] in
bottom.nextButton.isEnabled = false
guard let self = self else { return }
if self.viewModel.isCanNext() {
self.viewModel.saveGcSaveinfo(callBackBlock: {[weak self] flag, error in
guard let self = self else { return }
bottom.nextButton.isEnabled = true
if let error = error {
YHHUD.flash(message: error.errorMsg )
} else {
YHHUD.hideFlashMessage()
YHHUD.flash(message: "提交成功")
self.navigationController?.popViewController()
}
})
} else {
bottom.nextButton.isEnabled = true
self.isShowPrompt = true
self.updateDataSource()
YHHUD.flash(message: "您还有信息未填写")
}
}
return bottom
}()
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalTo(view)
make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64)
}
bottomView.layoutIfNeeded()
bottomView.nextButton.addYinHeGradualLayer()
}
}
extension YHGCSignatureAddViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHGCSignatureAddTableViewCell.self)
cell.dataSource = baseDataSource?[indexPath.row]
cell.workExperienceBlock = {[weak self] model in
guard let self = self else { return }
self.viewModel.updateModel(model)
let id = model.id
if id != .id1 && id != .id2 && id != .id3 && id != .id4 && id != .id5{
self.updateDataSource()
}
}
return cell
} else {
let cell = tableView.dequeueReusableCell(withClass: YHGCDocumentPromptTableViewCell.self)
cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear
return cell
}
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 1 {
let array = baseDataSource?[indexPath.row].models ?? []
var h = 0
for i in 0..<array.count {
let data = array[i]
let message = data.message ?? ""
let isShow = data.isShowPrompts ?? false
if data.id == .id6 {
h = h + 72
} else {
h = h + 52
}
if isShow && message.count == 0 {
h = h + 20
}
}
return CGFloat(h + 14)
} else {
return 104
}
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 7))
return view
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 16
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.01
}
}
......@@ -11,7 +11,7 @@ import SmartCodable
class YHGCMySignatureListModel: SmartCodable {
var renewal_manage_docs: [YHGCMySignatureModel] = []
var top_title: String = ""
var user_info: YHMyDocumentsUserModel = YHMyDocumentsUserModel()
required init() {
}
}
......@@ -28,7 +28,7 @@ class YHGCMySignatureModel: SmartCodable {
var is_second_page: Bool = false
var contract_id: String = ""
var doc_type_label: String = ""
var doc_type_text: String = ""
var isEditFlag : Bool = false //是否为编辑状态
var isSelectedFlag : Bool = true //是否被选择 默认全部全部选择
......
//
// YHGCSignatureAddModel.swift
// galaxy
//
// Created by EDY on 2024/12/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHGCSignatureAddModel: SmartCodable {
var id: Int = 0
var order_id: Int = 0
var archives_location: String = ""
var unit_name: String = ""
var unit_address: String = ""
var phone: String = ""
var email: String = ""
var date: String = ""
required init() {
}
}
......@@ -128,7 +128,7 @@ class YHGCDocListCell: UITableViewCell {
//签字状态
func updateAllViewsForSign() {
guard let dataSource = dataSourceForSign else { return }
titleLabel.text = dataSource.doc_type_name
titleLabel.text = dataSource.doc_type_text
if dataSource.isEditFlag {
checkButton.isHidden = false
statusHoldView.isHidden = true
......@@ -137,36 +137,56 @@ class YHGCDocListCell: UITableViewCell {
checkButton.isHidden = true
statusHoldView.isHidden = false
/*
statusOpt: {
3: '待签章',
4: '已签章',
5: '已完成',
6: '已驳回'
},
*/
var statusTxt = ""
var color : UIColor = .brandMainColor
let status = dataSource.doc_status
if status == 1003 && dataSource.doc_type == 1001{
statusTxt = "待签章"
color = UIColor.brandMainColor
} else if status == 1003 {
if dataSource.doc_type == 1000 {
if status == 1000 || status == 1001 || status == 1002 || status == 1003 {
statusTxt = "待签署"
color = UIColor.successColor
} else if status == 1000 || status == 1001 || status == 1002 {
statusTxt = "待补充"
color = UIColor.successColor
color = UIColor.brandMainColor
} else if status == 1004 || status == 1005 || status == 1006 {
statusTxt = "审核中"
color = UIColor.failColor
} else if status == 1007 {
statusTxt = "已完成"
color = UIColor.labelTextColor2
} else if status == 1005 || status == 1006 {
}
} else if dataSource.doc_type == 1001 {
if status == 1000 {
statusTxt = "待补充"
color = UIColor.brandMainColor
} else if status == 1000 || status == 1001 || status == 1002 {
statusTxt = "待签署"
color = UIColor.brandMainColor
} else if status == 1004 || status == 1005 || status == 1006 {
statusTxt = "审核中"
color = UIColor.failColor
} else {
statusTxt = "--"
} else if status == 1007 {
statusTxt = "已完成"
color = UIColor.labelTextColor2
} else if status == 1003 {
statusTxt = "待签署"
color = UIColor.successColor
}
} else if dataSource.doc_type == 1002 {
if status == 1000 || status == 1001 || status == 1002 || status == 1003 {
statusTxt = "待签署"
color = UIColor.brandMainColor
} else if status == 1004 || status == 1005 || status == 1006 {
statusTxt = "审核中"
color = UIColor.failColor
} else if status == 1007 {
statusTxt = "已完成"
color = UIColor.labelTextColor2
}
}
statusLabel.text = statusTxt
statusLabel.textColor = color
}
......
//
// YHGCDocumentPromptTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/12/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHGCDocumentPromptTableViewCell: UITableViewCell {
var centerView: UIImageView!
var promptImageView: UIImageView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var link: String = ""
var type: Int = 0 {
didSet {
updatePrompt()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIImageView()
view.image = UIImage(named: "document_prompt_bg")
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
view.isUserInteractionEnabled = true
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(8)
make.bottom.equalTo(-8)
}
promptImageView = {
let view = UIImageView()
view.image = UIImage(named: "tips_icon")
return view
}()
centerView.addSubview(promptImageView)
promptImageView.snp.makeConstraints { make in
make.width.height.equalTo(14)
make.left.equalTo(16)
make.top.equalTo(16)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 12)
label.textColor = UIColor.brandMainColor
label.text = "填写指引"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(38)
make.top.equalTo(16)
make.height.equalTo(17)
}
subTitleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.labelTextColor2
label.numberOfLines = 0
let a: ASAttributedString = .init("请如实填写,以下补充信息将使用于生成赴港同意书\n工作单位名称", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2))
let aa: ASAttributedString = .init("需要与盖章公司名称一致", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
label.attributed.text = a + aa
return label
}()
centerView.addSubview(subTitleLabel)
subTitleLabel.snp.makeConstraints { make in
make.left.equalTo(15)
make.right.equalTo(-15)
make.top.equalTo(38.5)
}
}
func updatePrompt() {
// 1000-代理委托书,1001-同意书,1002-声明书
if type == 1000 {
let a: ASAttributedString = .init("请主申请人", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2))
let aa: ASAttributedString = .init("点击签署或上传已签章文件", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
subTitleLabel.attributed.text = a + aa
} else if type == 1001 {
let a: ASAttributedString = .init("请主申请人", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2))
let aa: ASAttributedString = .init("点击签署或上传已签章文件", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
subTitleLabel.attributed.text = a + aa
} else {
let a: ASAttributedString = .init("请您尽快核对文本内容,如需修改,可进行在线编辑\n如内容无误,请主申请人", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2))
let aa: ASAttributedString = .init("点击签署或上传已签署文件", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
subTitleLabel.attributed.text = a + aa
}
}
}
//
// YHGCSignatureAddTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/12/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCSignatureAddTableViewCell: UITableViewCell {
typealias WorkExperienceBlock = (_ model: YHWorkExperienceModel) -> ()
typealias CompanyBlock = (_ model: YHCompanyModelListModel) -> ()
var companyBlock: CompanyBlock?
var workExperienceBlock: WorkExperienceBlock?
var centerView: UIView!
var mainItemView: UIView!
var country: String = ""
var dataSource: YHSectionWorkExperienceModel?{
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(7)
make.bottom.equalTo(-7)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.top.left.right.bottom.equalToSuperview()
}
}
func updateAllViews() {
mainItemView.removeSubviews()
var y = 0
for i in 0 ..< (dataSource?.models?.count ?? 0) {
let line = UIView()
line.backgroundColor = UIColor.separatorColor
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(y)
make.height.equalTo(1)
make.right.equalTo(-18)
}
y = y + 1
let data = dataSource?.models?[i]
let isShow = data?.isShowPrompts ?? false
let message = data?.message ?? ""
var h = 51
if data?.id == .id7 {
h = 71
}
if isShow && message.count == 0 {
h = h + 20
}
let itemView = YHWorkExperienceItemView()
itemView.dataSource = data
itemView.country = country
itemView.block = {[weak self] model in
guard let self = self else { return }
if let block = self.workExperienceBlock {
block(model)
}
}
itemView.companyBlock = {[weak self] model in
guard let self = self else { return }
if let block = self.companyBlock {
block(model)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(y)
make.height.equalTo(h)
make.right.equalTo(-18)
}
y = y + h
}
}
}
//
// YHGCSignatureUploadTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/12/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCSignatureUploadTableViewCell: UITableViewCell {
typealias Block = (YHMyFileMethodType, Int) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var topLineView: UIView!
var promptLabel: UILabel!
var mainItemView: UIView!
var bottomView: YHWorkItemAddView!
var dataSource: YHMySignatureDetailModel? {
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
let width = (KScreenWidth - 32)/3.0
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(8)
make.bottom.equalTo(-8)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.textColor = UIColor.mainTextColor
label.text = "上传已签章件"
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(16)
make.height.equalTo(24)
}
promptLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.labelTextColor2
label.numberOfLines = 0
label.text = "注意:1.支持PDF、JPEG、JPG、PNG、BMP、TIFF文件格式,文件大小不限制;2.上传成功后会自动更新文件名;3.最多上传10张图片或文件,若有问题可联系文案"
return label
}()
centerView.addSubview(promptLabel)
promptLabel.snp.makeConstraints { make in
make.right.equalTo(-16)
make.left.equalTo(16)
make.height.equalTo(60)
make.bottom.equalTo(-16)
}
bottomView = {
let view = YHWorkItemAddView()
view.addBtn.setTitle("上传已签章件".local, for: .normal)
view.addBtn.setImage(UIImage(named: "document_upload"), for: .normal)
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.block {
block(.upload, 0)
}
}
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.bottom.equalTo(-92)
make.left.equalTo(18)
make.right.equalTo(-18)
make.height.equalTo(45)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-153)
make.top.equalTo(52)
}
let line = UIView()
line.backgroundColor = UIColor.separatorColor
centerView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(52)
make.height.equalTo(1)
make.right.equalTo(-18)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
mainItemView.removeSubviews()
if dataSource.doc_return_manual.count != 0 {
bottomView.addBtn.setTitle("继续上传".local, for: .normal)
} else {
bottomView.addBtn.setTitle("上传已签章件".local, for: .normal)
}
var y = 0
for i in 0 ..< (dataSource.signedDocument.count) {
let line = UIView()
line.backgroundColor = UIColor.separatorColor
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(y)
make.height.equalTo(1)
make.right.equalTo(-18)
}
y = y + 1
let data = dataSource.signedDocument[i]
let h = 70
let itemView = YHDocumentFileItemView()
itemView.index = i
itemView.docDataSource = data
itemView.itemBlock = {[weak self] type, index in
guard let self = self else { return }
if let block = block {
block(type, index)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(y)
make.height.equalTo(h)
make.right.equalTo(-18)
}
y = y + h
}
updateAddView()
}
func updateAddView() {
guard let dataSource = dataSource else { return }
if dataSource.docStatus == 1005 {
self.bottomView.alpha = 0.4
self.bottomView.addBtn.isEnabled = false
}
if dataSource.docStatus == 1007 {
self.bottomView.isHidden = true
mainItemView.snp.remakeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-92)
make.top.equalTo(52)
}
}
}
}
......@@ -19,8 +19,8 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
func requestSignatureDetail(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.detail
let params: [String : Any] = ["doc_id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.gcdetail
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
......@@ -42,13 +42,14 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
func requestSignaturePageURL(_ id: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.pageUrl
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
let params: [String : Any] = ["doc_id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.gcpageUrl
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
self.pageUrl = json.data?.peel as? String
let data = json.data?.peel as? [String: String]
self.pageUrl = data?["url"]
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
......@@ -121,24 +122,6 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
}
}
func requestSignatureLook(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.look
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
self.pageUrl = json.data?.peel as? String
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func requestSignatureDownload(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.download
......@@ -161,10 +144,16 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
}
}
func requestSignConfirm(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
func requestSignConfirm(_ id: String, orderID: Int, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.confirm
var array: [[String: String]] = []
let dataSource = mainModel?.signedDocument ?? []
for item in dataSource {
let param: [String: String] = ["name": item.name, "url": item.url]
array.append(param)
}
let params: [String : Any] = ["id": orderID, "doc_id":id, "signed_docs": array]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.gcinfo
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
......@@ -179,31 +168,6 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
}
}
func requestFileAction(_ id: String, _ type: Int, _ newArray: [String], _ oldUrl: String,callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["id": id,
"op_type": type,
"new_url": newArray,
"old_url": oldUrl]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.upload
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
// guard let dic = json.data?.peel as? [String : Any], let result = YHMySignatureURLModel.deserialize(from: dic) else {
// callBackBlock(false,nil)
// return
// }
// self.pageUrl = result.url
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
func sendEmailForDocs(_ params : [String : Any], callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.sendMail
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
......@@ -240,12 +204,4 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
callBackBlock(false, err)
}
}
func requestCheckPersonalStatus(_ id: String) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.personal
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { json, code in
} failBlock: { err in
}
}
}
//
// YHGCSignatureAddViewModel.swift
// galaxy
//
// Created by EDY on 2024/12/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCSignatureAddViewModel: YHBaseViewModel {
var position: YHGCSignatureAddModel = YHGCSignatureAddModel()
override init() {
super.init()
}
func getBaseDataSource(_ isShowPrompt: Bool) -> [YHSectionWorkExperienceModel] {
let item = YHWorkExperienceModel(id: .id1, isNeed: true, title: "档案所在单位", isUserKeyBoard: true, prompts: "请输入", message: position.archives_location, isShowPrompts: isShowPrompt, alertMessage:"请输入")
let item1 = YHWorkExperienceModel(id: .id2, isNeed: true, title: "工作单位名称", isUserKeyBoard: true, prompts: "请选择", message: position.unit_name, isShowPrompts: isShowPrompt, alertMessage:"请选择")
let item2 = YHWorkExperienceModel(id: .id3, isNeed: true, title: "工作单位地址", isUserKeyBoard: true, prompts: "请选择", message: position.unit_address, isShowPrompts: isShowPrompt, alertMessage:"请输入")
let item3 = YHWorkExperienceModel(id: .id4, isNeed: true, title: "负责人电话", isUserKeyBoard: true, prompts: "请输入", message: position.phone, isShowPrompts: isShowPrompt, alertMessage:"请输入")
let item4 = YHWorkExperienceModel(id: .id5, isNeed: false, title: "公司邮箱", isUserKeyBoard: true, prompts: "请输入", message: position.email, isShowPrompts: isShowPrompt, alertMessage:"请输入")
var section = YHSectionWorkExperienceModel(title: "企业信息", models: [item, item1, item2, item3, item4])
return [section]
}
func updateModel(_ item: YHWorkExperienceModel) {
guard let type = item.id else { return }
switch type {
case .id1: // 用人单位
position.archives_location = item.message ?? ""
case .id2: // 用人单位性质
position.unit_name = item.message ?? ""
case .id3:
position.unit_address = item.message ?? ""
case .id4:
position.phone = item.message ?? ""
case .id5:
position.email = item.message ?? ""
default: break
}
}
func isCanNext() -> Bool {
let archives_location = position.archives_location
let unit_name = position.unit_name
let unit_address = position.unit_address
let phone = position.phone
guard archives_location.count > 0 else { return false }
guard unit_name.count > 0 else { return false }
guard unit_address.count > 0 else { return false }
guard phone.count > 0 else { return false }
return true
}
func requestDetail(_ orderID: Int ,callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) {
let param: [String: Any] = ["order_id": orderID]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.gcinfo
let _ = YHNetRequest.getRequest(url: strUrl, params: param) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let result = YHGCSignatureAddModel.deserialize(from: dic) else {
callBackBlock(false,nil)
return
}
self.position = result
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
func saveGcSaveinfo(callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) {
let params: [String : Any] = ["id": position.id,
"order_id": position.order_id,
"archives_location":position.archives_location,
"unit_name": position.unit_name,
"phone": position.phone,
"unit_address": position.unit_address,
"email": position.email]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.gcSaveinfo
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return }
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let result = YHWorkExperiencePositionModel.deserialize(from: dic) else {
callBackBlock(false,nil)
return
}
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
}
......@@ -182,16 +182,11 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
if self.dataSource?.count == 10 {
YHHUD.flash(message: "新增工作经历不能超过10条")
} else {
self.viewModel?.requestCreateNewWork(self.orderId, callBackBlock: {[weak self] success, error in
guard let self = self else { return }
if success != 0 {
let vc = YHGCWorkExperienceViewController()
vc.orderID = self.orderId
vc.workID = success
vc.workID = 0
self.navigationController?.pushViewController(vc, animated: true)
}
})
}
}
cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear
......
......@@ -78,6 +78,13 @@ class YHGCWorkExperienceViewController: YHBaseViewController {
bottomView = {
let bottom = YHBottomNextView()
bottom.saveButton.isHidden = true
bottom.nextButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(10)
make.height.equalTo(44)
make.left.equalTo(16)
}
bottom.nextblock = { [weak self] in
bottom.nextButton.isEnabled = false
guard let self = self else { return }
......@@ -100,17 +107,6 @@ class YHGCWorkExperienceViewController: YHBaseViewController {
YHHUD.flash(message: "您还有信息未填写")
}
}
bottom.saveBlock = { [weak self] in
guard let self = self else { return }
self.viewModel.saveWorkPosition(callBackBlock: {[weak self] flag, error in
guard let _ = self else { return }
if let error = error {
YHHUD.flash(message: error.errorMsg )
} else {
YHHUD.flash(message: "保存成功")
}
})
}
return bottom
}()
view.addSubview(bottomView)
......
......@@ -187,6 +187,13 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel {
"country": position.location.country,
"details": position.location.details,
"foreign": position.location.foreign] as [String : Any]
let country = position.location.country
var location_aboard = 0
if country.contains("中国") {
location_aboard = 0
} else {
location_aboard = 1
}
let params: [String : Any] = ["id": position.id,
"order_id": position.order_id,
"company_name":position.company_name,
......@@ -196,7 +203,8 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel {
"has_work_certificate": position.has_work_certificate,
"company_type": position.company_type,
"company_type_other": position.company_type_other,
"location": address]
"location": address,
"location_aboard": location_aboard]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.gcWorkSave
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return }
......
......@@ -117,7 +117,7 @@ class YHGCWorkItemListViewModel: YHBaseViewModel {
"why_work_time_overlap": self.mainModel.why_work_time_overlap,
"has_work_experience": self.mainModel.has_work_experience,
"is_submit": true]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.saveWorkTimeRemark
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.saveAll
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
......
......@@ -364,6 +364,14 @@ class YHAllApiName {
static let personal = "infoflow/sign/check-personal-status"
static let signUrl = "infoflow/get-sign-url"
static let gclist = "super-app/gc/signature/doc/list"
// 高才签字详情
static let gcdetail = "super-app/gc/sign-detail"
static let gcpageUrl = "super-app/gc/signature"
static let gcinfo = "super-app/gc/hk-consent-info"
static let gcSaveinfo = "super-app/gc/edit-hk-consent-info"
static let gcconfirm = "super-app/gc/upload-sign-file"
}
//我的文书
......
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