Commit b9f3f457 authored by Steven杜宇's avatar Steven杜宇

// 必填字段

parent 4832ca0e
......@@ -132,7 +132,6 @@ class YHPrincipleUploadListVC: YHBaseViewController {
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
if agreementModel.id > 0 {
agreementModel.customType = YHPrincipleAgreementType.agreement.rawValue
agreementModel.isMust = true
agreementModel.isNeedTemplate = true
self.items.append(agreementModel)
}
......@@ -141,7 +140,6 @@ class YHPrincipleUploadListVC: YHBaseViewController {
let opinionModel = self.viewModel.uploadDetailModel.file_data.opinion
if opinionModel.id > 0 {
opinionModel.customType = YHPrincipleAgreementType.opinion.rawValue
opinionModel.isMust = true
opinionModel.isNeedTemplate = true
self.items.append(opinionModel)
}
......@@ -150,7 +148,6 @@ class YHPrincipleUploadListVC: YHBaseViewController {
let otherModel = self.viewModel.uploadDetailModel.file_data.other
if otherModel.id > 0 {
otherModel.customType = YHPrincipleAgreementType.other.rawValue
otherModel.isMust = false
otherModel.isNeedTemplate = false
self.items.append(otherModel)
}
......@@ -186,16 +183,23 @@ extension YHPrincipleUploadListVC {
func checkMustItems() -> Bool {
// 赴港居留同意书
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
if agreementModel.content_url.count <= 0 {
if agreementModel.isMust, agreementModel.content_url.count <= 0 {
YHHUD.flash(message: "请上传必要文件赴港居留同意书")
return false
}
// 申请人意见访问
let opinionModel = self.viewModel.uploadDetailModel.file_data.opinion
if opinionModel.content_url.count <= 0 {
if opinionModel.isMust, opinionModel.content_url.count <= 0 {
YHHUD.flash(message: "请上传必要文件申请人意见访问")
return false
}
// 其他证明条件
let otherModel = self.viewModel.uploadDetailModel.file_data.opinion
if otherModel.isMust, otherModel.content_url.count <= 0 {
YHHUD.flash(message: "请上传必要文件其他证明条件")
return false
}
return true
}
......
......@@ -195,13 +195,20 @@ class YHPrincipleAgreementModel: SmartCodable {
// 自定义属性
var customType: Int = YHPrincipleAgreementType.none.rawValue
var isMust: Bool = false // 是否必须
var isMust: Bool {// 是否必须 0:必须提供 1:无需提供
get {
return self.upload_requirement == 0
}
}
var isNeedTemplate: Bool = false
var isNeedUploadBtn: Bool {
// 待上传或已驳回状态才显示上传按钮 且最多上传10个
get {
return (self.check_status == YHPrincipleUploadStatus.preUpload.rawValue ||
self.check_status == YHPrincipleUploadStatus.rejected.rawValue) && self.content_url.count < 10
}
}
// 是否展示上传状态
var isNeedUploadStatus: Bool {
return self.check_status != YHPrincipleUploadStatus.preUpload.rawValue
......
......@@ -425,7 +425,8 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
return ""
}
if type == YHPrincipleAgreementType.other.rawValue {
return "1.新公司在职证明(在申请期间更换了工作时必传)\n2.主申人的曾用名证明文件,例如户口本副本\n3.主申请人的中国无刑事罪行记录证明书副本(由公安局开具)"
let remark = self.itemModel?.remark ?? ""
return "新公司在职证明(在申请期间更换了工作时必传)\n"+remark
}
return ""
}
......
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