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

签字流程

parent 47c8d594
...@@ -24,6 +24,13 @@ ...@@ -24,6 +24,13 @@
0411CF042D1A815100644D35 /* YHGCMySignatureDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF032D1A815100644D35 /* YHGCMySignatureDetailViewModel.swift */; }; 0411CF042D1A815100644D35 /* YHGCMySignatureDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF032D1A815100644D35 /* YHGCMySignatureDetailViewModel.swift */; };
0411CF062D1A88EA00644D35 /* YHGCDocListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF052D1A88EA00644D35 /* YHGCDocListCell.swift */; }; 0411CF062D1A88EA00644D35 /* YHGCDocListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF052D1A88EA00644D35 /* YHGCDocListCell.swift */; };
0411CF082D1A896800644D35 /* YHGCMySignatureListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF072D1A896800644D35 /* YHGCMySignatureListModel.swift */; }; 0411CF082D1A896800644D35 /* YHGCMySignatureListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF072D1A896800644D35 /* YHGCMySignatureListModel.swift */; };
0411CF0A2D1BD4DC00644D35 /* YHGCDocumentPromptTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF092D1BD4DC00644D35 /* YHGCDocumentPromptTableViewCell.swift */; };
0411CF0C2D1BD8C300644D35 /* YHGCSignatureToActionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF0B2D1BD8C300644D35 /* YHGCSignatureToActionTableViewCell.swift */; };
0411CF0E2D1BD91800644D35 /* YHGCSignatureUploadTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF0D2D1BD91800644D35 /* YHGCSignatureUploadTableViewCell.swift */; };
0411CF102D1C055100644D35 /* YHGCSignatureAddViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF0F2D1C055100644D35 /* YHGCSignatureAddViewController.swift */; };
0411CF122D1C065300644D35 /* YHGCSignatureAddViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF112D1C065300644D35 /* YHGCSignatureAddViewModel.swift */; };
0411CF142D1C0B0700644D35 /* YHGCSignatureAddModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */; };
0411CF162D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */; };
04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; }; 04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; };
04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */; }; 04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */; };
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; }; 04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; };
...@@ -1203,6 +1210,13 @@ ...@@ -1203,6 +1210,13 @@
0411CF032D1A815100644D35 /* YHGCMySignatureDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySignatureDetailViewModel.swift; sourceTree = "<group>"; }; 0411CF032D1A815100644D35 /* YHGCMySignatureDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySignatureDetailViewModel.swift; sourceTree = "<group>"; };
0411CF052D1A88EA00644D35 /* YHGCDocListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCDocListCell.swift; sourceTree = "<group>"; }; 0411CF052D1A88EA00644D35 /* YHGCDocListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCDocListCell.swift; sourceTree = "<group>"; };
0411CF072D1A896800644D35 /* YHGCMySignatureListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySignatureListModel.swift; sourceTree = "<group>"; }; 0411CF072D1A896800644D35 /* YHGCMySignatureListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCMySignatureListModel.swift; sourceTree = "<group>"; };
0411CF092D1BD4DC00644D35 /* YHGCDocumentPromptTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCDocumentPromptTableViewCell.swift; sourceTree = "<group>"; };
0411CF0B2D1BD8C300644D35 /* YHGCSignatureToActionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureToActionTableViewCell.swift; sourceTree = "<group>"; };
0411CF0D2D1BD91800644D35 /* YHGCSignatureUploadTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureUploadTableViewCell.swift; sourceTree = "<group>"; };
0411CF0F2D1C055100644D35 /* YHGCSignatureAddViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddViewController.swift; sourceTree = "<group>"; };
0411CF112D1C065300644D35 /* YHGCSignatureAddViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddViewModel.swift; sourceTree = "<group>"; };
0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddModel.swift; sourceTree = "<group>"; };
0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddTableViewCell.swift; sourceTree = "<group>"; };
04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; }; 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; };
04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoEditCell.swift; sourceTree = "<group>"; }; 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoEditCell.swift; sourceTree = "<group>"; };
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; }; 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; };
...@@ -2475,6 +2489,7 @@ ...@@ -2475,6 +2489,7 @@
children = ( children = (
0411CEFF2D1A805A00644D35 /* YHGCMySignatureListViewModel.swift */, 0411CEFF2D1A805A00644D35 /* YHGCMySignatureListViewModel.swift */,
0411CF032D1A815100644D35 /* YHGCMySignatureDetailViewModel.swift */, 0411CF032D1A815100644D35 /* YHGCMySignatureDetailViewModel.swift */,
0411CF112D1C065300644D35 /* YHGCSignatureAddViewModel.swift */,
); );
path = VM; path = VM;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2484,6 +2499,7 @@ ...@@ -2484,6 +2499,7 @@
children = ( children = (
0411CEFD2D1A7FFD00644D35 /* YHGCMySignatureListViewController.swift */, 0411CEFD2D1A7FFD00644D35 /* YHGCMySignatureListViewController.swift */,
0411CF012D1A80F500644D35 /* YHGCMySignatureDetailViewController.swift */, 0411CF012D1A80F500644D35 /* YHGCMySignatureDetailViewController.swift */,
0411CF0F2D1C055100644D35 /* YHGCSignatureAddViewController.swift */,
); );
path = C; path = C;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2492,6 +2508,7 @@ ...@@ -2492,6 +2508,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
0411CF072D1A896800644D35 /* YHGCMySignatureListModel.swift */, 0411CF072D1A896800644D35 /* YHGCMySignatureListModel.swift */,
0411CF132D1C0B0700644D35 /* YHGCSignatureAddModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2500,6 +2517,10 @@ ...@@ -2500,6 +2517,10 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
0411CF052D1A88EA00644D35 /* YHGCDocListCell.swift */, 0411CF052D1A88EA00644D35 /* YHGCDocListCell.swift */,
0411CF092D1BD4DC00644D35 /* YHGCDocumentPromptTableViewCell.swift */,
0411CF0B2D1BD8C300644D35 /* YHGCSignatureToActionTableViewCell.swift */,
0411CF0D2D1BD91800644D35 /* YHGCSignatureUploadTableViewCell.swift */,
0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -6679,6 +6700,7 @@ ...@@ -6679,6 +6700,7 @@
045C0FE12D12CA5F00BD2DC0 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */, 045C0FE12D12CA5F00BD2DC0 /* YHFormItemOnlyDoubleChoiceCell.swift in Sources */,
045C0FE22D12CA5F00BD2DC0 /* YHEditInterestViewController.swift in Sources */, 045C0FE22D12CA5F00BD2DC0 /* YHEditInterestViewController.swift in Sources */,
045C0FE32D12CA5F00BD2DC0 /* YHResignConfirmInfoListViewController.swift in Sources */, 045C0FE32D12CA5F00BD2DC0 /* YHResignConfirmInfoListViewController.swift in Sources */,
0411CF0E2D1BD91800644D35 /* YHGCSignatureUploadTableViewCell.swift in Sources */,
045C0FE42D12CA5F00BD2DC0 /* YHMediaProtocolUtils.swift in Sources */, 045C0FE42D12CA5F00BD2DC0 /* YHMediaProtocolUtils.swift in Sources */,
045C0FE52D12CA5F00BD2DC0 /* YHStatusAdvantageBottomView.swift in Sources */, 045C0FE52D12CA5F00BD2DC0 /* YHStatusAdvantageBottomView.swift in Sources */,
045C0FE62D12CA5F00BD2DC0 /* YHLifeItemTableViewCell.swift in Sources */, 045C0FE62D12CA5F00BD2DC0 /* YHLifeItemTableViewCell.swift in Sources */,
...@@ -6812,6 +6834,7 @@ ...@@ -6812,6 +6834,7 @@
045C10612D12CA5F00BD2DC0 /* YHUploadCertificateDateItem.swift in Sources */, 045C10612D12CA5F00BD2DC0 /* YHUploadCertificateDateItem.swift in Sources */,
045C10622D12CA5F00BD2DC0 /* YHNameCardInfoView.swift in Sources */, 045C10622D12CA5F00BD2DC0 /* YHNameCardInfoView.swift in Sources */,
045C10632D12CA5F00BD2DC0 /* YHVisaPaymentTipsCell.swift in Sources */, 045C10632D12CA5F00BD2DC0 /* YHVisaPaymentTipsCell.swift in Sources */,
0411CF122D1C065300644D35 /* YHGCSignatureAddViewModel.swift in Sources */,
045C10642D12CA5F00BD2DC0 /* YHTravelDocsPreparationDetailModel.swift in Sources */, 045C10642D12CA5F00BD2DC0 /* YHTravelDocsPreparationDetailModel.swift in Sources */,
045C10652D12CA5F00BD2DC0 /* YHLiveStateViewController.swift in Sources */, 045C10652D12CA5F00BD2DC0 /* YHLiveStateViewController.swift in Sources */,
045C10662D12CA5F00BD2DC0 /* YHIMHelper.swift in Sources */, 045C10662D12CA5F00BD2DC0 /* YHIMHelper.swift in Sources */,
...@@ -7154,6 +7177,7 @@ ...@@ -7154,6 +7177,7 @@
045C119D2D12CA5F00BD2DC0 /* UIColor+Extension.swift in Sources */, 045C119D2D12CA5F00BD2DC0 /* UIColor+Extension.swift in Sources */,
045C119E2D12CA5F00BD2DC0 /* YHCustomTextView.swift in Sources */, 045C119E2D12CA5F00BD2DC0 /* YHCustomTextView.swift in Sources */,
045C119F2D12CA5F00BD2DC0 /* YHEditBaseUserInfoViewController.swift in Sources */, 045C119F2D12CA5F00BD2DC0 /* YHEditBaseUserInfoViewController.swift in Sources */,
0411CF162D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift in Sources */,
045C11A02D12CA5F00BD2DC0 /* YHCertificateSearchBar.swift in Sources */, 045C11A02D12CA5F00BD2DC0 /* YHCertificateSearchBar.swift in Sources */,
045C11A12D12CA5F00BD2DC0 /* YHFileListItemsView2.swift in Sources */, 045C11A12D12CA5F00BD2DC0 /* YHFileListItemsView2.swift in Sources */,
045C11A22D12CA5F00BD2DC0 /* YHResignLeaveHKSwitchItemView.swift in Sources */, 045C11A22D12CA5F00BD2DC0 /* YHResignLeaveHKSwitchItemView.swift in Sources */,
...@@ -7311,6 +7335,7 @@ ...@@ -7311,6 +7335,7 @@
045C12352D12CA5F00BD2DC0 /* YHPreviewInfoSessionModel.swift in Sources */, 045C12352D12CA5F00BD2DC0 /* YHPreviewInfoSessionModel.swift in Sources */,
045C12362D12CA5F00BD2DC0 /* YHCertificateViewModel.swift in Sources */, 045C12362D12CA5F00BD2DC0 /* YHCertificateViewModel.swift in Sources */,
045C12372D12CA5F00BD2DC0 /* YHInvitationWithGiftsSecondTableViewCell.swift in Sources */, 045C12372D12CA5F00BD2DC0 /* YHInvitationWithGiftsSecondTableViewCell.swift in Sources */,
0411CF0C2D1BD8C300644D35 /* YHGCSignatureToActionTableViewCell.swift in Sources */,
045C12382D12CA5F00BD2DC0 /* YHPreviewViewModel.swift in Sources */, 045C12382D12CA5F00BD2DC0 /* YHPreviewViewModel.swift in Sources */,
045C12392D12CA5F00BD2DC0 /* YHIFamilyInfoListCell.swift in Sources */, 045C12392D12CA5F00BD2DC0 /* YHIFamilyInfoListCell.swift in Sources */,
045C123B2D12CA5F00BD2DC0 /* YHOneKeyLoginViewModel.swift in Sources */, 045C123B2D12CA5F00BD2DC0 /* YHOneKeyLoginViewModel.swift in Sources */,
...@@ -7330,6 +7355,7 @@ ...@@ -7330,6 +7355,7 @@
045C12482D12CA5F00BD2DC0 /* YHResignUploadDetailModel.swift in Sources */, 045C12482D12CA5F00BD2DC0 /* YHResignUploadDetailModel.swift in Sources */,
045C12492D12CA5F00BD2DC0 /* UIApplication+Extension.swift in Sources */, 045C12492D12CA5F00BD2DC0 /* UIApplication+Extension.swift in Sources */,
045C124A2D12CA5F00BD2DC0 /* YHAIChatBannerCollectionCell.swift in Sources */, 045C124A2D12CA5F00BD2DC0 /* YHAIChatBannerCollectionCell.swift in Sources */,
0411CF0A2D1BD4DC00644D35 /* YHGCDocumentPromptTableViewCell.swift in Sources */,
045C124B2D12CA5F00BD2DC0 /* YHFamilyWarmTipsCell.swift in Sources */, 045C124B2D12CA5F00BD2DC0 /* YHFamilyWarmTipsCell.swift in Sources */,
045C124C2D12CA5F00BD2DC0 /* YHServiceOrderAlertView.swift in Sources */, 045C124C2D12CA5F00BD2DC0 /* YHServiceOrderAlertView.swift in Sources */,
045C124D2D12CA5F00BD2DC0 /* YHVideoProgressControl.swift in Sources */, 045C124D2D12CA5F00BD2DC0 /* YHVideoProgressControl.swift in Sources */,
...@@ -7416,6 +7442,7 @@ ...@@ -7416,6 +7442,7 @@
045C129A2D12CA5F00BD2DC0 /* YHOtherMultipleChoiceItemView.swift in Sources */, 045C129A2D12CA5F00BD2DC0 /* YHOtherMultipleChoiceItemView.swift in Sources */,
045C129B2D12CA5F00BD2DC0 /* YHSignatureUploadTableViewCell.swift in Sources */, 045C129B2D12CA5F00BD2DC0 /* YHSignatureUploadTableViewCell.swift in Sources */,
045C129C2D12CA5F00BD2DC0 /* YHResignCertificateHKTableViewCell.swift in Sources */, 045C129C2D12CA5F00BD2DC0 /* YHResignCertificateHKTableViewCell.swift in Sources */,
0411CF142D1C0B0700644D35 /* YHGCSignatureAddModel.swift in Sources */,
045C129D2D12CA5F00BD2DC0 /* YHTravelCertificateTipsView.swift in Sources */, 045C129D2D12CA5F00BD2DC0 /* YHTravelCertificateTipsView.swift in Sources */,
045C129E2D12CA5F00BD2DC0 /* YHResignDocumentUploadActionCell.swift in Sources */, 045C129E2D12CA5F00BD2DC0 /* YHResignDocumentUploadActionCell.swift in Sources */,
045C129F2D12CA5F00BD2DC0 /* YHMatchUserViewController.swift in Sources */, 045C129F2D12CA5F00BD2DC0 /* YHMatchUserViewController.swift in Sources */,
...@@ -7519,6 +7546,7 @@ ...@@ -7519,6 +7546,7 @@
045C12FF2D12CA5F00BD2DC0 /* YHWorkActionView.swift in Sources */, 045C12FF2D12CA5F00BD2DC0 /* YHWorkActionView.swift in Sources */,
045C13002D12CA5F00BD2DC0 /* YHImproveTargetCell.swift in Sources */, 045C13002D12CA5F00BD2DC0 /* YHImproveTargetCell.swift in Sources */,
045C13012D12CA5F00BD2DC0 /* YHPreviewFamilyMemberViewController.swift in Sources */, 045C13012D12CA5F00BD2DC0 /* YHPreviewFamilyMemberViewController.swift in Sources */,
0411CF102D1C055100644D35 /* YHGCSignatureAddViewController.swift in Sources */,
045C13022D12CA5F00BD2DC0 /* YHPictureReviewManager.swift in Sources */, 045C13022D12CA5F00BD2DC0 /* YHPictureReviewManager.swift in Sources */,
045C13032D12CA5F00BD2DC0 /* YHBasicInfoFillViewController.swift in Sources */, 045C13032D12CA5F00BD2DC0 /* YHBasicInfoFillViewController.swift in Sources */,
045C13042D12CA5F00BD2DC0 /* YHImproveSchemeTemplateListCell.swift in Sources */, 045C13042D12CA5F00BD2DC0 /* YHImproveSchemeTemplateListCell.swift in Sources */,
......
...@@ -24,6 +24,12 @@ class YHDocumentFileItemView: UIView { ...@@ -24,6 +24,12 @@ class YHDocumentFileItemView: UIView {
} }
} }
var docDataSource: YHMySignedDocumentModel? {
didSet {
updateDocAllViews()
}
}
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
backgroundColor = .white backgroundColor = .white
...@@ -144,6 +150,36 @@ class YHDocumentFileItemView: UIView { ...@@ -144,6 +150,36 @@ class YHDocumentFileItemView: UIView {
fileNameLabel.text = name + "\(index + 1)(已签章)" 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() { @objc func centerClick() {
if let block = itemBlock { if let block = itemBlock {
block(.look, index) block(.look, index)
......
...@@ -115,7 +115,7 @@ class YHDocumentPromptTableViewCell: UITableViewCell { ...@@ -115,7 +115,7 @@ class YHDocumentPromptTableViewCell: UITableViewCell {
func updatePrompt() { func updatePrompt() {
// 1-代理委托书,2-受养人声明,3-工作经验补充表,4-声明书,5-人才清单声明书,6-个人陈述书,7-推荐信,8-组织架构图 // 1-代理委托书,2-受养人声明,3-工作经验补充表,4-声明书,5-人才清单声明书,6-个人陈述书,7-推荐信,8-组织架构图
if type == 7 || type == 8 { if type == 7 || type == 8 {
let a: ASAttributedString = .init("您可以", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.subTextColor2)) 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)) let aa: ASAttributedString = .init("转发给需签署的人签字,若需要盖章,则先确认文书是否已签完,然后下载打印去盖章,扫描签章件上传", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
......
...@@ -21,6 +21,22 @@ class YHMySignatureDetailModel: SmartCodable { ...@@ -21,6 +21,22 @@ class YHMySignatureDetailModel: SmartCodable {
var is_show_button: Bool = false var is_show_button: Bool = false
var status: Int = 0 var status: Int = 0
var audit_opinion: String = "" 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() { required init() {
} }
} }
......
...@@ -17,6 +17,7 @@ enum YHMyFileMethodType: Int { ...@@ -17,6 +17,7 @@ enum YHMyFileMethodType: Int {
case upload = 5 // 上传 case upload = 5 // 上传
case delete = 6 // 删除 case delete = 6 // 删除
case reUpload = 7 // 重传 case reUpload = 7 // 重传
case add = 8 //补充信息
} }
class YHSignatureToActionTableViewCell: UITableViewCell { class YHSignatureToActionTableViewCell: UITableViewCell {
......
...@@ -19,10 +19,10 @@ class YHGCMySignatureDetailViewController: YHBaseViewController { ...@@ -19,10 +19,10 @@ class YHGCMySignatureDetailViewController: YHBaseViewController {
var viewModel: YHGCMySignatureDetailViewModel! var viewModel: YHGCMySignatureDetailViewModel!
var id: Int = 0 var id: Int = 0
var oldUrl: String? var oldUrl: String?
var type: Int = 0
var isSign: Bool = false var isSign: Bool = false
var isAuth: Bool = true //小程序分享字段 var isAuth: Bool = true //小程序分享字段
var orderID: Int = 0 var orderID: Int = 0
var mobile: String = ""
lazy var previewFileTool:YHFilePreviewTool = { lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self) let tool = YHFilePreviewTool(targetVC: self)
return tool return tool
...@@ -55,11 +55,6 @@ class YHGCMySignatureDetailViewController: YHBaseViewController { ...@@ -55,11 +55,6 @@ class YHGCMySignatureDetailViewController: YHBaseViewController {
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
viewModel.requestSignBack("\(id)") {[weak self] success, error in
guard let self = self else { return }
self.getData()
}
viewModel.requestCheckPersonalStatus("\(id)")
getData() getData()
} }
...@@ -68,57 +63,44 @@ class YHGCMySignatureDetailViewController: YHBaseViewController { ...@@ -68,57 +63,44 @@ class YHGCMySignatureDetailViewController: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
if success { if success {
let state = self.viewModel.mainModel?.status ?? 0 let state = self.viewModel.mainModel?.status ?? 0
// 0-待上传,1-未发送, 2-发送中,3-已发送,4-已签收,5-审核通过,6-驳回 // 1000 1001 1002 1003-待签署; 1004-已签署; 1005-待审核; 1006-已驳回; 1007-已完成
self.type = state
} else { if state == 1000 || state == 1001 || state == 1002 || state == 1003 {
YHHUD.flash(message: error?.errorMsg ?? "") self.promptView.isHidden = true
} self.bottomButton.isEnabled = true
self.checkSign() self.bottomView.isHidden = false
}) self.bottomButton.alpha = 1
} self.bottomButton.setTitle("确定已签章,提交", for: .normal)
} else if state == 1004 || state == 1005 {
func checkSign() { self.promptView.isHidden = true
viewModel?.requestSignCallBack("\(self.id)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
self.isSign = success
let state = self.type
if state == 0 || state == 1 || state == 2 || state == 3 {
self.promptView.isHidden = true
self.bottomButton.isEnabled = true
self.bottomView.isHidden = false
self.bottomButton.alpha = 1
self.bottomButton.setTitle("确定已签章,提交", for: .normal)
if self.type == 3 && self.viewModel.mainModel?.doc_return_manual.count == 0 && !success {
self.bottomButton.isEnabled = false self.bottomButton.isEnabled = false
self.bottomView.isHidden = false
self.bottomButton.alpha = 0.4 self.bottomButton.alpha = 0.4
self.bottomButton.setTitle("提交成功", for: .normal)
} else if state == 1007 {
self.promptView.isHidden = true
self.bottomView.isHidden = true
self.bottomButton.isEnabled = true
self.bottomButton.alpha = 1
self.bottomButton.setTitle("确定已签章,提交", for: .normal)
} else if state == 1006 {
self.promptView.isHidden = false
self.promptView.setPrompt(self.viewModel.mainModel?.audit_opinion ?? "")
self.bottomButton.isEnabled = true
self.bottomView.isHidden = false
self.bottomButton.alpha = 1
self.bottomButton.setTitle("确定已签章,提交", for: .normal)
let height = self.getPromptHeight(self.viewModel.mainModel?.audit_opinion ?? "")
self.promptView.snp.remakeConstraints { make in
make.height.equalTo(height)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.equalTo(self.view)
}
} }
} else if state == 4 { self.tableView.reloadData()
self.promptView.isHidden = true
self.bottomButton.isEnabled = false
self.bottomView.isHidden = false
self.bottomButton.alpha = 0.4
self.bottomButton.setTitle("提交成功", for: .normal)
} else if state == 5 {
self.promptView.isHidden = true
self.bottomView.isHidden = true
self.bottomButton.isEnabled = true
self.bottomButton.alpha = 1
self.bottomButton.setTitle("确定已签章,提交", for: .normal)
} else { } else {
self.promptView.isHidden = false YHHUD.flash(message: error?.errorMsg ?? "")
self.promptView.setPrompt(self.viewModel.mainModel?.audit_opinion ?? "")
self.bottomButton.isEnabled = true
self.bottomView.isHidden = false
self.bottomButton.alpha = 1
self.bottomButton.setTitle("确定已签章,提交", for: .normal)
let height = self.getPromptHeight(self.viewModel.mainModel?.audit_opinion ?? "")
self.promptView.snp.remakeConstraints { make in
make.height.equalTo(height)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.equalTo(self.view)
}
} }
self.tableView.reloadData()
}) })
} }
...@@ -153,9 +135,9 @@ class YHGCMySignatureDetailViewController: YHBaseViewController { ...@@ -153,9 +135,9 @@ class YHGCMySignatureDetailViewController: YHBaseViewController {
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.register(cellWithClass: YHDocumentPromptTableViewCell.self) tableView.register(cellWithClass: YHGCDocumentPromptTableViewCell.self)
tableView.register(cellWithClass: YHSignatureToActionTableViewCell.self) tableView.register(cellWithClass: YHGCSignatureToActionTableViewCell.self)
tableView.register(cellWithClass: YHSignatureUploadTableViewCell.self) tableView.register(cellWithClass: YHGCSignatureUploadTableViewCell.self)
return tableView return tableView
}() }()
view.addSubview(tableView) view.addSubview(tableView)
...@@ -251,7 +233,7 @@ class YHGCMySignatureDetailViewController: YHBaseViewController { ...@@ -251,7 +233,7 @@ class YHGCMySignatureDetailViewController: YHBaseViewController {
} }
@objc func submit() { @objc func submit() {
viewModel.requestSignConfirm("\(self.id)") {[weak self] success, error in viewModel.requestSignConfirm("\(self.id)", orderID: orderID) {[weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if success { if success {
self.getData() self.getData()
...@@ -285,29 +267,13 @@ class YHGCMySignatureDetailViewController: YHBaseViewController { ...@@ -285,29 +267,13 @@ class YHGCMySignatureDetailViewController: YHBaseViewController {
fileName = successUrl.lastPathComponent fileName = successUrl.lastPathComponent
} }
let suffixName = successUrl.pathExtension.lowercased() let suffixName = successUrl.pathExtension.lowercased()
let model = YHContentUrl() let model = YHMySignedDocumentModel()
model.fileName = fileName
model.name = fileName model.name = fileName
model.fileUrl = successUrl
model.url = successUrl model.url = successUrl
model.suffix = suffixName self.viewModel.mainModel?.signedDocument.append(model)
// YHHUD.show(.progress(message: "上传中...")) self.tableView.reloadData()
var action = 1
if self.oldUrl?.count != 0 {
action = 2
}
self.viewModel.requestFileAction("\(self.id)", action, [successUrl], self.oldUrl ?? "") {[weak self] success, error in
guard let self = self else { return }
// YHHUD.hide()
if success {
YHHUD.flash(message: "上传成功")
} else {
var msg = "上传失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg
}
YHHUD.flash(message:msg)
}
self.getData()
}
return return
} }
var msg = "上传图片失败" var msg = "上传图片失败"
...@@ -334,17 +300,6 @@ class YHGCMySignatureDetailViewController: YHBaseViewController { ...@@ -334,17 +300,6 @@ class YHGCMySignatureDetailViewController: YHBaseViewController {
} }
} }
func getMiniPath() -> String {
var isAuthString = ""
if isAuth {
isAuthString = "true"
} else {
isAuthString = "false"
}
let path = "/serviceHousekeeper/pages/documentEdit/documentEdit?id=\(self.id)&docType=sign&signId=\(self.id)&auth=\(isAuthString)&order_id=\(orderID)&source_from=app"
return path
}
deinit { deinit {
removeNotify() removeNotify()
} }
...@@ -357,92 +312,25 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -357,92 +312,25 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 { if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHDocumentPromptTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHGCDocumentPromptTableViewCell.self)
cell.type = self.viewModel.mainModel?.doc_type ?? 0 cell.type = self.viewModel.mainModel?.doc_type ?? 0
cell.backgroundColor = .clear cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear cell.contentView.backgroundColor = .clear
return cell return cell
} else if indexPath.row == 1 { } else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withClass: YHSignatureToActionTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHGCSignatureToActionTableViewCell.self)
cell.dataSource = self.viewModel.mainModel cell.dataSource = self.viewModel.mainModel
cell.isSign = self.isSign
cell.miniPath = getMiniPath()
if self.type == 5 || self.type == 4 {
cell.isSign = true
}
cell.backgroundColor = .clear cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear cell.contentView.backgroundColor = .clear
cell.block = { [weak self] type in cell.block = { [weak self] type in
guard let self = self else { return } guard let self = self else { return }
if type == .sign { if type == .sign {
if self.isSign {
YHHUD.show(.progress(message: ""))
self.viewModel.requestSignatureLook("\(self.id)") {[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
let url = URL(string: self.viewModel.pageUrl) ?? URL(fileURLWithPath: "")
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
safariViewController.modalPresentationStyle = .fullScreen
present(safariViewController, animated: true, completion: nil)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
} else {
YHHUD.show(.progress(message: ""))
self.viewModel.requestSignaturePageURL("\(self.id)", callBackBlock: {[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if error?.errorCode == 1008611 {
YHCommonAlertView.show("实名认证", "为保证签署有效,请先实名认证", "取消", "去认证") {
self.viewModel.requestSignaturePersonalURL(callBackBlock: {[weak self] success, error in
guard let self = self else { return }
let url = URL(string: self.viewModel.personalUrl) ?? URL(fileURLWithPath: "")
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
safariViewController.modalPresentationStyle = .fullScreen
present(safariViewController, animated: true, completion: nil)
})
}
} else if error?.errorCode == 1008612 {
YHSignAppendStepView.show {[weak self] name, phone in
guard let self = self else { return }
self.viewModel.requestSignaturePersonalWithNameAndPhoneURL(name: name, phone: phone, callBackBlock: {[weak self] success, error in
guard let self = self else { return }
let url = URL(string: self.viewModel.personalUrl) ?? URL(fileURLWithPath: "")
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
safariViewController.modalPresentationStyle = .fullScreen
present(safariViewController, animated: true, completion: nil)
})
}
} else {
if success ?? false {
let url = URL(string: self.viewModel.pageUrl) ?? URL(fileURLWithPath: "")
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
safariViewController.modalPresentationStyle = .fullScreen
present(safariViewController, animated: true, completion: nil)
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
}
}
})
}
}
if type == .look {
YHHUD.show(.progress(message: "")) YHHUD.show(.progress(message: ""))
self.viewModel.requestSignatureLook("\(self.id)") {[weak self] success, error in self.viewModel.requestSignaturePageURL("\(self.id)", callBackBlock: {[weak self] success, error in
YHHUD.hide() YHHUD.hide()
guard let self = self else { return } guard let self = self else { return }
if success { if success ?? false {
let url = URL(string: self.viewModel.pageUrl) ?? URL(fileURLWithPath: "") let url = URL(string: self.viewModel.pageUrl) ?? URL(fileURLWithPath: "")
let safariViewController = SFSafariViewController(url: url) let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close safariViewController.dismissButtonStyle = .close
...@@ -452,6 +340,24 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -452,6 +340,24 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
} else { } else {
YHHUD.flash(message: error?.errorMsg ?? "") YHHUD.flash(message: error?.errorMsg ?? "")
} }
})
}
if type == .look {
if self.viewModel.mainModel?.docStatus == 1007 {
let url = URL(string: self.viewModel.mainModel?.signFile) ?? URL(fileURLWithPath: "")
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
safariViewController.modalPresentationStyle = .fullScreen
present(safariViewController, animated: true, completion: nil)
} else {
let url = URL(string: self.viewModel.mainModel?.signFileOrigin) ?? URL(fileURLWithPath: "")
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.delegate = self
safariViewController.modalPresentationStyle = .fullScreen
present(safariViewController, animated: true, completion: nil)
} }
} }
...@@ -470,11 +376,17 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -470,11 +376,17 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
} }
}.show() }.show()
} }
if type == .add {
//跳转补充详情
let vc = YHGCSignatureAddViewController()
vc.orderID = orderID
self.navigationController?.pushViewController(vc)
}
} }
return cell return cell
} else { } else {
let cell = tableView.dequeueReusableCell(withClass: YHSignatureUploadTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHGCSignatureUploadTableViewCell.self)
cell.type = self.type
cell.dataSource = self.viewModel.mainModel cell.dataSource = self.viewModel.mainModel
cell.backgroundColor = .clear cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear cell.contentView.backgroundColor = .clear
...@@ -503,7 +415,7 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -503,7 +415,7 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
[weak self] imgArr in [weak self] imgArr in
guard let self = self else { return } guard let self = self else { return }
let group = DispatchGroup() let group = DispatchGroup()
var successArr:[String] = [] var successArr:[YHMySignedDocumentModel] = []
var failArr:[YHSelectImageItem] = [] var failArr:[YHSelectImageItem] = []
YHHUD.show(.progress(message: "上传中...")) YHHUD.show(.progress(message: "上传中..."))
...@@ -513,7 +425,12 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -513,7 +425,12 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
uploadImage(image, imageName:item.name) { uploadImage(image, imageName:item.name) {
success, url in success, url in
if success { if success {
successArr.append(url) let model = YHMySignedDocumentModel()
model.fileUrl = url
model.fileName = item.name
model.name = item.name
model.url = url
successArr.append(model)
} else { } else {
failArr.append(item) failArr.append(item)
} }
...@@ -532,22 +449,16 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -532,22 +449,16 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
} else { } else {
YHHUD.flash(message: "\(successArr.count)张照片上传成功\n\(failArr.count)张照片上传失败") YHHUD.flash(message: "\(successArr.count)张照片上传成功\n\(failArr.count)张照片上传失败")
} }
var action = 1 for item in successArr {
if self.oldUrl?.count != 0 { self.viewModel.mainModel?.signedDocument.append(item)
action = 2
}
//sleep(1) 后端性能问题 不能并发调用接口
self.viewModel.requestFileAction("\(self.id)", action, successArr, self.oldUrl ?? "") {[weak self] success, error in
guard let self = self else { return }
self.getData()
} }
self.tableView.reloadData()
} }
} }
sheetView.show() sheetView.show()
} }
if type == .reUpload { if type == .reUpload {
self.oldUrl = self.viewModel.mainModel?.doc_return_manual[index]
let count = self.viewModel.mainModel?.doc_return_manual.count ?? 0 let count = self.viewModel.mainModel?.doc_return_manual.count ?? 0
var maxCount = 10 - count var maxCount = 10 - count
if maxCount > 9 { if maxCount > 9 {
...@@ -565,7 +476,7 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -565,7 +476,7 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
[weak self] imgArr in [weak self] imgArr in
guard let self = self else { return } guard let self = self else { return }
let group = DispatchGroup() let group = DispatchGroup()
var successArr:[String] = [] var successArr:[YHMySignedDocumentModel] = []
var failArr:[YHSelectImageItem] = [] var failArr:[YHSelectImageItem] = []
YHHUD.show(.progress(message: "上传中...")) YHHUD.show(.progress(message: "上传中..."))
...@@ -575,7 +486,12 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -575,7 +486,12 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
uploadImage(image, imageName:item.name) { uploadImage(image, imageName:item.name) {
success, url in success, url in
if success { if success {
successArr.append(url) let model = YHMySignedDocumentModel()
model.fileUrl = url
model.fileName = item.name
model.name = item.name
model.url = url
successArr.append(model)
} else { } else {
failArr.append(item) failArr.append(item)
} }
...@@ -594,14 +510,11 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -594,14 +510,11 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
} else { } else {
YHHUD.flash(message: "\(successArr.count)张照片上传成功\n\(failArr.count)张照片上传失败") YHHUD.flash(message: "\(successArr.count)张照片上传成功\n\(failArr.count)张照片上传失败")
} }
var action = 1 self.viewModel.mainModel?.signedDocument.remove(at: index)
if self.oldUrl?.count != 0 { for item in successArr {
action = 2 self.viewModel.mainModel?.signedDocument.append(item)
}
self.viewModel.requestFileAction("\(self.id)", action, successArr, self.oldUrl ?? "") {[weak self] success, error in
guard let self = self else { return }
self.getData()
} }
self.tableView.reloadData()
} }
} }
sheetView.show() sheetView.show()
...@@ -609,7 +522,7 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -609,7 +522,7 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
if type == .look { if type == .look {
YHHUD.show(.progress(message: "")) YHHUD.show(.progress(message: ""))
self.oldUrl = self.viewModel.mainModel?.doc_return_manual[index] self.oldUrl = self.viewModel.mainModel?.signedDocument[index].url
self.viewModel.getPublicImageUrl(self.oldUrl ?? "") { success, error in self.viewModel.getPublicImageUrl(self.oldUrl ?? "") { success, error in
YHHUD.hide() YHHUD.hide()
if let success = success { if let success = success {
...@@ -619,16 +532,8 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -619,16 +532,8 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
} }
if type == .delete { if type == .delete {
self.oldUrl = self.viewModel.mainModel?.doc_return_manual[index] self.viewModel.mainModel?.signedDocument.remove(at: index)
self.viewModel.requestFileAction("\(self.id)", 3, [], self.oldUrl ?? "") {[weak self] success, error in self.tableView.reloadData()
guard let self = self else { return }
if success {
YHHUD.flash(message: "删除成功")
} else {
YHHUD.flash(message: error?.errorMsg ?? "")
}
self.getData()
}
} }
} }
return cell return cell
...@@ -642,12 +547,8 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD ...@@ -642,12 +547,8 @@ extension YHGCMySignatureDetailViewController: UITableViewDelegate, UITableViewD
} else if indexPath.row == 1 { } else if indexPath.row == 1 {
return 180 return 180
} else { } else {
guard let count = self.viewModel.mainModel?.doc_return_manual.count else { return CGFloat(221) } guard let count = self.viewModel.mainModel?.signedDocument.count else { return CGFloat(221) }
if self.type == 5 { return CGFloat(221 + count * 71)
return CGFloat(176 + count * 71)
} else {
return CGFloat(221 + count * 71)
}
} }
} }
......
...@@ -95,7 +95,7 @@ extension YHGCMySignatureListViewController { ...@@ -95,7 +95,7 @@ extension YHGCMySignatureListViewController {
YHHUD.flash(message: error?.errorMsg ?? "数据获取失败") 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.headSessionView.canShowDownLoadBtnFlag = true
self.tableView.reloadData() self.tableView.reloadData()
}) })
...@@ -342,6 +342,7 @@ extension YHGCMySignatureListViewController: UITableViewDelegate, UITableViewDat ...@@ -342,6 +342,7 @@ extension YHGCMySignatureListViewController: UITableViewDelegate, UITableViewDat
vc.id = model.id vc.id = model.id
// vc.isAuth = viewModel.mainModel?.user_info.is_auth ?? true // vc.isAuth = viewModel.mainModel?.user_info.is_auth ?? true
vc.orderID = orderId vc.orderID = orderId
vc.mobile = mobile
self.navigationController?.pushViewController(vc) 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 ...@@ -11,7 +11,7 @@ import SmartCodable
class YHGCMySignatureListModel: SmartCodable { class YHGCMySignatureListModel: SmartCodable {
var renewal_manage_docs: [YHGCMySignatureModel] = [] var renewal_manage_docs: [YHGCMySignatureModel] = []
var top_title: String = "" var user_info: YHMyDocumentsUserModel = YHMyDocumentsUserModel()
required init() { required init() {
} }
} }
...@@ -28,7 +28,7 @@ class YHGCMySignatureModel: SmartCodable { ...@@ -28,7 +28,7 @@ class YHGCMySignatureModel: SmartCodable {
var is_second_page: Bool = false var is_second_page: Bool = false
var contract_id: String = "" var contract_id: String = ""
var doc_type_label: String = "" var doc_type_label: String = ""
var doc_type_text: String = ""
var isEditFlag : Bool = false //是否为编辑状态 var isEditFlag : Bool = false //是否为编辑状态
var isSelectedFlag : Bool = true //是否被选择 默认全部全部选择 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 { ...@@ -128,7 +128,7 @@ class YHGCDocListCell: UITableViewCell {
//签字状态 //签字状态
func updateAllViewsForSign() { func updateAllViewsForSign() {
guard let dataSource = dataSourceForSign else { return } guard let dataSource = dataSourceForSign else { return }
titleLabel.text = dataSource.doc_type_name titleLabel.text = dataSource.doc_type_text
if dataSource.isEditFlag { if dataSource.isEditFlag {
checkButton.isHidden = false checkButton.isHidden = false
statusHoldView.isHidden = true statusHoldView.isHidden = true
...@@ -137,36 +137,56 @@ class YHGCDocListCell: UITableViewCell { ...@@ -137,36 +137,56 @@ class YHGCDocListCell: UITableViewCell {
checkButton.isHidden = true checkButton.isHidden = true
statusHoldView.isHidden = false statusHoldView.isHidden = false
/* /*
statusOpt: { 3: '待签章',
3: '待签章', 4: '已签章',
4: '已签章', 5: '已完成',
5: '已完成', 6: '已驳回'
6: '已驳回'
},
*/ */
var statusTxt = "" var statusTxt = ""
var color : UIColor = .brandMainColor var color : UIColor = .brandMainColor
let status = dataSource.doc_status let status = dataSource.doc_status
if status == 1003 && dataSource.doc_type == 1001{ if dataSource.doc_type == 1000 {
statusTxt = "待签章" if status == 1000 || status == 1001 || status == 1002 || status == 1003 {
color = UIColor.brandMainColor statusTxt = "待签署"
} else if status == 1003 { color = UIColor.brandMainColor
statusTxt = "待签署" } else if status == 1004 || status == 1005 || status == 1006 {
color = UIColor.successColor statusTxt = "审核中"
} else if status == 1000 || status == 1001 || status == 1002 { color = UIColor.failColor
statusTxt = "待补充" } else if status == 1007 {
color = UIColor.successColor statusTxt = "已完成"
} else if status == 1007 { color = UIColor.labelTextColor2
statusTxt = "已完成" }
color = UIColor.labelTextColor2 } else if dataSource.doc_type == 1001 {
} else if status == 1005 || status == 1006 { if status == 1000 {
statusTxt = "审核中" statusTxt = "待补充"
color = UIColor.failColor color = UIColor.brandMainColor
} else { } else if status == 1000 || status == 1001 || status == 1002 {
statusTxt = "--" statusTxt = "待签署"
color = UIColor.failColor 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 == 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.text = statusTxt
statusLabel.textColor = color 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
}
}
}
//
// YHGCSignatureToActionTableViewCell.swift
// galaxy
//
// Created by EDY on 2024/12/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCSignatureToActionTableViewCell: UITableViewCell {
typealias Block = (YHMyFileMethodType) -> ()
var block: Block?
var centerView: UIView!
var titleLabel: UILabel!
var topLineView: UIView!
var bottomView: UIView!
var bottomLeftLineView: UIView!
var bottomRightLineView: UIView!
var fileImageView: UIImageView!
var fileNameLabel: UILabel!
var shareButton: UIButton!
var editButton: UIButton!
var submitButton: UIButton!
var lookButton: UIButton!
var miniPath: String = ""
var flagLabel: UILabel!
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)/2.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)
}
flagLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 10)
label.textColor = UIColor.brandMainColor
label.text = "待签署"
label.textAlignment = .center
label.backgroundColor = UIColor(hex: 0xebf0f9)
return label
}()
centerView.addSubview(flagLabel)
flagLabel.snp.makeConstraints { make in
make.left.equalTo(titleLabel.snp.right).offset(4)
make.centerY.equalTo(titleLabel.snp.centerY)
make.height.equalTo(18)
make.width.equalTo(38)
}
topLineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(topLineView)
topLineView.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(18)
make.height.equalTo(1)
make.top.equalTo(52)
}
// shareButton = {
// let button = UIButton(type: .custom)
// button.setBackgroundImage(UIImage(named: "share_mini_program"), for: .normal)
// button.addTarget(self, action: #selector(shareButtonClick), for: .touchUpInside)
// button.isHidden = true
// return button
// }()
// centerView.addSubview(shareButton)
// shareButton.snp.makeConstraints { make in
// make.top.equalTo(18)
// make.right.equalTo(-24)
// make.height.equalTo(20)
// make.width.equalTo(80)
// }
bottomView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.right.left.equalToSuperview()
make.height.equalTo(1)
make.top.equalTo(115)
}
editButton = {
let button = UIButton(type: .custom)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
button.setTitle("签署", for: .normal)
button.addTarget(self, action: #selector(editButtonClick), for: .touchUpInside)
return button
}()
centerView.addSubview(editButton)
editButton.snp.makeConstraints { make in
make.left.bottom.equalToSuperview()
make.top.equalTo(bottomView.snp.bottom)
make.width.equalToSuperview()
}
submitButton = {
let button = UIButton(type: .custom)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
button.setTitle("查看", for: .normal)
button.addTarget(self, action: #selector(submitButtonClick), for: .touchUpInside)
return button
}()
centerView.addSubview(submitButton)
submitButton.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.top.equalTo(bottomView.snp.bottom)
make.left.equalToSuperview()
make.width.equalTo(width)
}
lookButton = {
let button = UIButton(type: .custom)
button.setTitleColor(UIColor.brandMainColor, for: .normal)
button.titleLabel?.font = UIFont.PFSC_R(ofSize: 14)
button.setTitle("下载", for: .normal)
button.addTarget(self, action: #selector(lookButtonClick), for: .touchUpInside)
return button
}()
centerView.addSubview(lookButton)
lookButton.snp.makeConstraints { make in
make.right.bottom.equalToSuperview()
make.top.equalTo(bottomView.snp.bottom)
make.width.equalTo(width)
}
fileImageView = {
let view = UIImageView()
view.image = UIImage(named: "")
return view
}()
centerView.addSubview(fileImageView)
fileImageView.snp.makeConstraints { make in
make.left.equalTo(24)
make.centerY.equalToSuperview()
make.width.height.equalTo(31)
}
fileNameLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.numberOfLines = 0
label.text = "雇主的推荐信(仅签字)华为科技有限公司.doc"
return label
}()
centerView.addSubview(fileNameLabel)
fileNameLabel.snp.makeConstraints { make in
make.right.equalTo(-18)
make.left.equalTo(67)
make.height.equalTo(40)
make.centerY.equalToSuperview()
}
bottomLeftLineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(bottomLeftLineView)
bottomLeftLineView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.width.equalTo(1)
make.centerY.equalTo(editButton.snp.centerY)
make.height.equalTo(16)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
let suffix = dataSource.signFileOrigin.pathExtension.lowercased()
var iconImgName = "my_cer_type_pdf"
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)
var name = ""
if dataSource.docType == 1000 {
name = "代理委托书"
} else if dataSource.docType == 1001 {
name = "赴港同意书"
} else if dataSource.docType == 1002 {
name = "声明书"
}
fileNameLabel.text = name
// 1003-待签署; 1004-已签署; 1005-待审核; 1006-已驳回; 1007-已完成
if dataSource.docStatus == 1000 || dataSource.docStatus == 1001 || dataSource.docStatus == 1002 {
bottomLeftLineView.isHidden = true
editButton.isHidden = false
submitButton.isHidden = true
lookButton.isHidden = true
flagLabel.textColor = UIColor.brandMainColor
flagLabel.text = "待补充"
flagLabel.backgroundColor = UIColor(hex: 0xebf0f9)
editButton.setTitle("补充信息", for: .normal)
} else if dataSource.docStatus == 1003 {
bottomLeftLineView.isHidden = true
editButton.isHidden = false
submitButton.isHidden = true
lookButton.isHidden = true
flagLabel.textColor = UIColor.brandMainColor
flagLabel.text = "待签署"
flagLabel.backgroundColor = UIColor(hex: 0xebf0f9)
} else if dataSource.docStatus == 1004 {
bottomLeftLineView.isHidden = true
editButton.isHidden = true
submitButton.isHidden = false
lookButton.isHidden = true
submitButton.snp.remakeConstraints { make in
make.bottom.equalToSuperview()
make.top.equalTo(bottomView.snp.bottom)
make.left.equalToSuperview()
make.right.equalToSuperview()
}
flagLabel.textColor = UIColor(hex: 0xff8000)
flagLabel.text = "审核中"
flagLabel.backgroundColor = UIColor(hex: 0xfff5eb)
} else if dataSource.docStatus == 1005 {
bottomLeftLineView.isHidden = true
editButton.isHidden = true
submitButton.isHidden = false
lookButton.isHidden = true
flagLabel.textColor = UIColor(hex: 0xff8000)
flagLabel.text = "审核中"
flagLabel.backgroundColor = UIColor(hex: 0xfff5eb)
} else if dataSource.docStatus == 1006 {
bottomLeftLineView.isHidden = true
editButton.isHidden = false
submitButton.isHidden = true
lookButton.isHidden = true
flagLabel.textColor = UIColor.failColor
flagLabel.text = "已驳回"
flagLabel.backgroundColor = UIColor.failColor.withAlphaComponent(0.3)
} else if dataSource.docStatus == 1007 {
bottomLeftLineView.isHidden = false
editButton.isHidden = true
submitButton.isHidden = false
lookButton.isHidden = false
submitButton.snp.remakeConstraints { make in
make.bottom.equalToSuperview()
make.top.equalTo(bottomView.snp.bottom)
make.left.equalToSuperview()
make.right.equalTo((KScreenWidth - 32)/2.0)
}
flagLabel.textColor = UIColor(hex: 0x3cc694)
flagLabel.text = "已完成"
flagLabel.backgroundColor = UIColor(hex: 0xf0fbf7)
}
}
@objc func editButtonClick() {
if dataSource?.docStatus == 1000 || dataSource?.docStatus == 1001 || dataSource?.docStatus == 1002 {
if let block = block {
block(.add)
}
} else {
if let block = block {
block(.sign)
}
}
}
@objc func lookButtonClick() {
if let block = block {
block(.downLoad)
}
}
@objc func submitButtonClick() {
if let block = block {
block(.look)
}
}
@objc func shareButtonClick() {
let title = "您的朋友邀请您点击小程序,协作签署" + (dataSource?.doc_type_name ?? "")
YHShareManager.shared.shareToMiniProgram(path: miniPath, shareTitle: title)
}
}
//
// 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 { ...@@ -19,8 +19,8 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
func requestSignatureDetail(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) { func requestSignatureDetail(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId] // let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id] let params: [String : Any] = ["doc_id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.detail let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.gcdetail
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
...@@ -42,13 +42,14 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel { ...@@ -42,13 +42,14 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
func requestSignaturePageURL(_ id: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) { func requestSignaturePageURL(_ id: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId] // let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id] let params: [String : Any] = ["doc_id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.pageUrl let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.gcpageUrl
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
if json.code == 200 { 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) callBackBlock(true, nil)
} else { } else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg) let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
...@@ -121,24 +122,6 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel { ...@@ -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?)->()) { func requestSignatureDownload(_ id: String, callBackBlock:@escaping (_ success: Bool, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["id": id] let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.download let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.download
...@@ -161,39 +144,20 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel { ...@@ -161,39 +144,20 @@ 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] = ["order_id": orderId]
let params: [String : Any] = ["id": id] var array: [[String: String]] = []
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.confirm let dataSource = mainModel?.signedDocument ?? []
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in for item in dataSource {
//1. json字符串 转 对象 let param: [String: String] = ["name": item.name, "url": item.url]
guard let self = self else { return } array.append(param)
if json.code == 200 {
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
} }
} let params: [String : Any] = ["id": orderID, "doc_id":id, "signed_docs": array]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.gcinfo
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 let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
if json.code == 200 { 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) callBackBlock(true, nil)
} else { } else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg) let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
...@@ -240,12 +204,4 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel { ...@@ -240,12 +204,4 @@ class YHGCMySignatureDetailViewModel: YHBaseViewModel {
callBackBlock(false, err) 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,15 +182,10 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView ...@@ -182,15 +182,10 @@ extension YHGCWorkExperienceListViewController: UITableViewDelegate, UITableView
if self.dataSource?.count == 10 { if self.dataSource?.count == 10 {
YHHUD.flash(message: "新增工作经历不能超过10条") YHHUD.flash(message: "新增工作经历不能超过10条")
} else { } else {
self.viewModel?.requestCreateNewWork(self.orderId, callBackBlock: {[weak self] success, error in let vc = YHGCWorkExperienceViewController()
guard let self = self else { return } vc.orderID = self.orderId
if success != 0 { vc.workID = 0
let vc = YHGCWorkExperienceViewController() self.navigationController?.pushViewController(vc, animated: true)
vc.orderID = self.orderId
vc.workID = success
self.navigationController?.pushViewController(vc, animated: true)
}
})
} }
} }
cell.backgroundColor = .clear cell.backgroundColor = .clear
......
...@@ -78,6 +78,13 @@ class YHGCWorkExperienceViewController: YHBaseViewController { ...@@ -78,6 +78,13 @@ class YHGCWorkExperienceViewController: YHBaseViewController {
bottomView = { bottomView = {
let bottom = YHBottomNextView() 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.nextblock = { [weak self] in
bottom.nextButton.isEnabled = false bottom.nextButton.isEnabled = false
guard let self = self else { return } guard let self = self else { return }
...@@ -100,17 +107,6 @@ class YHGCWorkExperienceViewController: YHBaseViewController { ...@@ -100,17 +107,6 @@ class YHGCWorkExperienceViewController: YHBaseViewController {
YHHUD.flash(message: "您还有信息未填写") 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 return bottom
}() }()
view.addSubview(bottomView) view.addSubview(bottomView)
......
...@@ -187,6 +187,13 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel { ...@@ -187,6 +187,13 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel {
"country": position.location.country, "country": position.location.country,
"details": position.location.details, "details": position.location.details,
"foreign": position.location.foreign] as [String : Any] "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, let params: [String : Any] = ["id": position.id,
"order_id": position.order_id, "order_id": position.order_id,
"company_name":position.company_name, "company_name":position.company_name,
...@@ -196,7 +203,8 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel { ...@@ -196,7 +203,8 @@ class YHGCWorkExperienceViewModel: YHBaseViewModel {
"has_work_certificate": position.has_work_certificate, "has_work_certificate": position.has_work_certificate,
"company_type": position.company_type, "company_type": position.company_type,
"company_type_other": position.company_type_other, "company_type_other": position.company_type_other,
"location": address] "location": address,
"location_aboard": location_aboard]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.gcWorkSave let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.gcWorkSave
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return } guard let self = self else { return }
......
...@@ -117,7 +117,7 @@ class YHGCWorkItemListViewModel: YHBaseViewModel { ...@@ -117,7 +117,7 @@ class YHGCWorkItemListViewModel: YHBaseViewModel {
"why_work_time_overlap": self.mainModel.why_work_time_overlap, "why_work_time_overlap": self.mainModel.why_work_time_overlap,
"has_work_experience": self.mainModel.has_work_experience, "has_work_experience": self.mainModel.has_work_experience,
"is_submit": true] "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 let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象 //1. json字符串 转 对象
guard let self = self else { return } guard let self = self else { return }
......
...@@ -364,6 +364,14 @@ class YHAllApiName { ...@@ -364,6 +364,14 @@ class YHAllApiName {
static let personal = "infoflow/sign/check-personal-status" static let personal = "infoflow/sign/check-personal-status"
static let signUrl = "infoflow/get-sign-url" static let signUrl = "infoflow/get-sign-url"
static let gclist = "super-app/gc/signature/doc/list" 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