Commit 51329e3e authored by Steven杜宇's avatar Steven杜宇

// 学位类型选择

parent 40d899b6
...@@ -228,6 +228,21 @@ class YHFormPickerView: UIView { ...@@ -228,6 +228,21 @@ class YHFormPickerView: UIView {
YHFormPickerViewItem(type: .professionCertificate(.CQF)), YHFormPickerViewItem(type: .professionCertificate(.CQF)),
YHFormPickerViewItem(type: .professionCertificate(.CIMA)), YHFormPickerViewItem(type: .professionCertificate(.CIMA)),
YHFormPickerViewItem(type: .professionCertificate(.ACA))], YHFormPickerViewItem(type: .professionCertificate(.ACA))],
// 学位类型
.degreeCategory:
[YHFormPickerViewItem(type: .degreeCategory(.accountantOrFinance)),
YHFormPickerViewItem(type: .degreeCategory(.artOrLiterature)),
YHFormPickerViewItem(type: .degreeCategory(.businessManagement)),
YHFormPickerViewItem(type: .degreeCategory(.economics)),
YHFormPickerViewItem(type: .degreeCategory(.engineering)),
YHFormPickerViewItem(type: .degreeCategory(.electronicOrSoftwareEngineering)),
YHFormPickerViewItem(type: .degreeCategory(.laws)),
YHFormPickerViewItem(type: .degreeCategory(.lifeSciencesOrMedicine)),
YHFormPickerViewItem(type: .degreeCategory(.management)),
YHFormPickerViewItem(type: .degreeCategory(.NeoConfucianism)),
YHFormPickerViewItem(type: .degreeCategory(.socialScience)),
YHFormPickerViewItem(type: .degreeCategory(.others))],
] ]
}() }()
...@@ -386,6 +401,8 @@ class YHFormPickerView: UIView { ...@@ -386,6 +401,8 @@ class YHFormPickerView: UIView {
return "选择语言能力" return "选择语言能力"
case .professionalSkill: case .professionalSkill:
return "选择专业技能行业" return "选择专业技能行业"
case .degreeCategory:
return "选择学位类型"
} }
} }
} }
...@@ -623,6 +640,43 @@ extension YHFormPickerView { ...@@ -623,6 +640,43 @@ extension YHFormPickerView {
} else if title.contains("英国皇家特许会计师") { } else if title.contains("英国皇家特许会计师") {
return .professionCertificate(.ACA) return .professionCertificate(.ACA)
} }
case .degreeCategory:
if title == "会计/金融" {
return .degreeCategory(.accountantOrFinance)
} else if title == "艺术及人文/文学" {
return .degreeCategory(.artOrLiterature)
} else if title == "工商管理" {
return .degreeCategory(.businessManagement)
} else if title == "经济学" {
return .degreeCategory(.economics)
} else if title == "工程学" {
return .degreeCategory(.engineering)
} else if title == "咨询科技/电子及软件工程/数据科学" {
return .degreeCategory(.electronicOrSoftwareEngineering)
} else if title == "法律" {
return .degreeCategory(.laws)
} else if title == "生命科学及医学" {
return .degreeCategory(.lifeSciencesOrMedicine)
} else if title == "管理学" {
return .degreeCategory(.management)
} else if title == "理学" {
return .degreeCategory(.NeoConfucianism)
} else if title == "社会科学" {
return .degreeCategory(.socialScience)
} else if title == "其他" {
return .degreeCategory(.others)
}
case .language: case .language:
return .none return .none
case .professionalSkill: case .professionalSkill:
......
...@@ -37,6 +37,8 @@ enum YHFormPickerViewType: Int { ...@@ -37,6 +37,8 @@ enum YHFormPickerViewType: Int {
case language case language
// 专业技能行业 // 专业技能行业
case professionalSkill case professionalSkill
// 学位类型
case degreeCategory
} }
enum YHPickerViewMarriageType: Int { enum YHPickerViewMarriageType: Int {
...@@ -191,6 +193,34 @@ enum YHPickerViewProfessionalCertificateType:Int { ...@@ -191,6 +193,34 @@ enum YHPickerViewProfessionalCertificateType:Int {
case ACA case ACA
} }
enum YHPickerViewDegreedegreeCategoryType:Int {
// 会计/金融
case accountantOrFinance
// 艺术及人文/文学
case artOrLiterature
// 工商管理
case businessManagement
// 经济学
case economics
// 工程学
case engineering
// 咨询科技/电子及软件工程/数据科学
case electronicOrSoftwareEngineering
// 法律
case laws
// 生命科学及医学
case lifeSciencesOrMedicine
// 管理学
case management
// 理学
case NeoConfucianism
// 社会科学
case socialScience
// 其他
case others
}
enum YHFormPickerViewSubType { enum YHFormPickerViewSubType {
case none case none
...@@ -205,6 +235,7 @@ enum YHFormPickerViewSubType { ...@@ -205,6 +235,7 @@ enum YHFormPickerViewSubType {
case degreeLocation(YHPickerViewDegreeLocationType) case degreeLocation(YHPickerViewDegreeLocationType)
case profession(YHPicerViewProfessionType) case profession(YHPicerViewProfessionType)
case professionCertificate(YHPickerViewProfessionalCertificateType) case professionCertificate(YHPickerViewProfessionalCertificateType)
case degreeCategory(YHPickerViewDegreedegreeCategoryType)
var title:String { var title:String {
switch self { switch self {
...@@ -315,31 +346,57 @@ enum YHFormPickerViewSubType { ...@@ -315,31 +346,57 @@ enum YHFormPickerViewSubType {
return "其他".local return "其他".local
case .professionCertificate(.CFA): case .professionCertificate(.CFA):
return "CFA(注册金融分析师)" return "CFA(注册金融分析师)".local
case .professionCertificate(.CFP): case .professionCertificate(.CFP):
return "CFP(CFP证书是目前世界上权威的权威理财顾问认证项目之一)" return "CFP(CFP证书是目前世界上权威的权威理财顾问认证项目之一)".local
case .professionCertificate(.FRM): case .professionCertificate(.FRM):
return "FRM(金融风险管理师)" return "FRM(金融风险管理师)".local
case .professionCertificate(.FIA): case .professionCertificate(.FIA):
return "FIA(保险精算师)" return "FIA(保险精算师)".local
case .professionCertificate(.CPA): case .professionCertificate(.CPA):
return "CPA(注册会计师)" return "CPA(注册会计师)".local
case .professionCertificate(.CIIA): case .professionCertificate(.CIIA):
return "CIIA(注册国际投资分析师)" return "CIIA(注册国际投资分析师)".local
case .professionCertificate(.RFC): case .professionCertificate(.RFC):
return "RFC(财务顾问师)" return "RFC(财务顾问师)".local
case .professionCertificate(.ACCA): case .professionCertificate(.ACCA):
return "ACCA(特许公认会计师)" return "ACCA(特许公认会计师)".local
case .professionCertificate(.CIA): case .professionCertificate(.CIA):
return "CIA(国际注册内部审计师)" return "CIA(国际注册内部审计师)".local
case .professionCertificate(.CMA): case .professionCertificate(.CMA):
return "CMA(美国管理会计师)" return "CMA(美国管理会计师)".local
case .professionCertificate(.CQF): case .professionCertificate(.CQF):
return "CQF(国际数量金融工程认证)" return "CQF(国际数量金融工程认证)".local
case .professionCertificate(.CIMA): case .professionCertificate(.CIMA):
return "CIMA(管理会计师考试)" return "CIMA(管理会计师考试)".local
case .professionCertificate(.ACA): case .professionCertificate(.ACA):
return "The Associate Chartered Accountant(英国皇家特许会计师)" return "The Associate Chartered Accountant(英国皇家特许会计师)".local
case .degreeCategory(.accountantOrFinance):
return "会计/金融".local
case .degreeCategory(.artOrLiterature):
return "艺术及人文/文学".local
case .degreeCategory(.businessManagement):
return "工商管理".local
case .degreeCategory(.economics):
return "经济学".local
case .degreeCategory(.engineering):
return "工程学".local
case .degreeCategory(.electronicOrSoftwareEngineering):
return "咨询科技/电子及软件工程/数据科学".local
case .degreeCategory(.laws):
return "法律".local
case .degreeCategory(.lifeSciencesOrMedicine):
return "生命科学及医学".local
case .degreeCategory(.management):
return "管理学".local
case .degreeCategory(.NeoConfucianism):
return "理学".local
case .degreeCategory(.socialScience):
return "社会科学".local
case .degreeCategory(.others):
return "其他".local
} }
} }
...@@ -479,6 +536,31 @@ enum YHFormPickerViewSubType { ...@@ -479,6 +536,31 @@ enum YHFormPickerViewSubType {
case .professionCertificate(.ACA): case .professionCertificate(.ACA):
return 13 return 13
case .degreeCategory(.accountantOrFinance):
return 0
case .degreeCategory(.artOrLiterature):
return 1
case .degreeCategory(.businessManagement):
return 2
case .degreeCategory(.economics):
return 3
case .degreeCategory(.engineering):
return 4
case .degreeCategory(.electronicOrSoftwareEngineering):
return 5
case .degreeCategory(.laws):
return 6
case .degreeCategory(.lifeSciencesOrMedicine):
return 7
case .degreeCategory(.management):
return 8
case .degreeCategory(.NeoConfucianism):
return 9
case .degreeCategory(.socialScience):
return 10
case .degreeCategory(.others):
return 11
} }
} }
} }
...@@ -16,6 +16,8 @@ class YHEducationDetailVC: YHBaseViewController { ...@@ -16,6 +16,8 @@ class YHEducationDetailVC: YHBaseViewController {
var orderId: Int = 0 var orderId: Int = 0
// 学历ID // 学历ID
var detailId: Int = 0 var detailId: Int = 0
// 是否显示未填写错误提示
var isNeedShowError = false
let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel() let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel()
var detailInfo: YHEducationDetailInfo = YHEducationDetailInfo() var detailInfo: YHEducationDetailInfo = YHEducationDetailInfo()
var isChildsEditMode: YHFormTitleItemEditType = .none var isChildsEditMode: YHFormTitleItemEditType = .none
...@@ -67,7 +69,13 @@ class YHEducationDetailVC: YHBaseViewController { ...@@ -67,7 +69,13 @@ class YHEducationDetailVC: YHBaseViewController {
bottomView.saveBlock = { bottomView.saveBlock = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
saveDetailInfo() saveDetailInfo(isNeedPop: true)
}
bottomView.submitBlock = {
[weak self] in
guard let self = self else { return }
submitInfo()
} }
bottomView.snp.makeConstraints { make in bottomView.snp.makeConstraints { make in
...@@ -97,50 +105,59 @@ class YHEducationDetailVC: YHBaseViewController { ...@@ -97,50 +105,59 @@ class YHEducationDetailVC: YHBaseViewController {
let title0 = YHFormTitleItem(type: .mainApplicantEducation) let title0 = YHFormTitleItem(type: .mainApplicantEducation)
let item00 = YHFormDetailItem(type: .universityFullName) let item00 = YHFormDetailItem(type: .universityFullName)
item00.placeHolder = "请输入学校全称,例:清华,需填全称“清华大学".local item00.placeHolder = "请选择学校".local
item00.tips = "请选择学校".local
item00.value = detailInfo.college item00.value = detailInfo.college
let item01 = YHFormDetailItem(type: .educationStyle) let item01 = YHFormDetailItem(type: .educationStyle)
item01.placeHolder = "请选择授课形式".local item01.placeHolder = "请选择授课形式".local
item01.tips = "请选择授课形式".local
item01.value = detailInfo.type item01.value = detailInfo.type
let item02 = YHFormDetailItem(type: .educationTime) let item02 = YHFormDetailItem(type: .educationTime)
item02.placeHolder = "请选择年月".local item02.placeHolder = "请选择年月".local
item02.tips = "请选择年月".local
item02.value = detailInfo.admissionTime item02.value = detailInfo.admissionTime
let item03 = YHFormDetailItem(type: .graduateTime) let item03 = YHFormDetailItem(type: .graduateTime)
item03.placeHolder = "请选择年月".local item03.placeHolder = "请选择年月".local
item03.tips = "请选择年月".local
item03.value = detailInfo.graduateTime item03.value = detailInfo.graduateTime
let item04 = YHFormDetailItem(type: .educationMajor) let item04 = YHFormDetailItem(type: .educationMajor)
item04.placeHolder = "请输入专业".local item04.placeHolder = "请输入专业".local
item04.tips = "请输入专业".local
item04.value = detailInfo.professional item04.value = detailInfo.professional
let item05 = YHFormDetailItem(type: .educationDegree) let item05 = YHFormDetailItem(type: .educationDegree)
item05.placeHolder = "请选择学位".local item05.placeHolder = "请选择学位".local
item05.tips = "请选择学位".local
item05.value = detailInfo.background item05.value = detailInfo.background
let item06 = YHFormDetailItem(type: .degreeType) let item06 = YHFormDetailItem(type: .degreeType)
item06.placeHolder = "请输入学位类型,如管理学".local item06.placeHolder = "请选择学位类型".local
item06.tips = "请选择学位类型".local
item06.value = detailInfo.degreeType item06.value = detailInfo.degreeType
let item07 = YHFormDetailItem(type: .educationCountry) let item07 = YHFormDetailItem(type: .educationCountry)
item07.placeHolder = "请输入国家及地区".local item07.placeHolder = "请输入国家及地区".local
item07.value = detailInfo.schoolAddress?.country item07.tips = "请输入国家及地区".local
item07.value = detailInfo.schoolAddress.country
let item08 = YHFormDetailItem(type: .educationCity) let item08 = YHFormDetailItem(type: .educationCity)
item08.placeHolder = "请选择城市".local
if detailInfo.isSchoolInAboard() { if detailInfo.isSchoolInAboard() {
item08.value = detailInfo.schoolAddress?.foreign item08.value = detailInfo.schoolAddress.foreign
item08.tips = "请输入城市".local
item08.placeHolder = "请输入城市".local item08.placeHolder = "请输入城市".local
item08.tips = "请输入城市".local item08.tips = "请输入城市".local
} else { } else {
item08.value = detailInfo.schoolAddress?.area.joined(separator: ",") item08.value = detailInfo.schoolAddress.area.joined(separator: ",")
item08.placeHolder = "请选择出生城市".local item08.tips = "请选择城市".local
item08.tips = "请选择出生城市".local item08.placeHolder = "请选择城市".local
item08.tips = "请选择城市".local
} }
let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05, item06, item07, item08] let arr0:[YHFormItemProtocol] = [title0, item00, item01, item02, item03, item04, item05, item06, item07, item08]
...@@ -183,6 +200,12 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -183,6 +200,12 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
let cellType = getCellType(detailItem) let cellType = getCellType(detailItem)
if cellType == .inputText { if cellType == .inputText {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemInputTextCell.cellReuseIdentifier, for: indexPath) as! YHFormItemInputTextCell
cell.isShowBottomLine = (indexPath.row != arr.count-1)
var isValueValid = false
if let value = detailItem.value, !value.isEmpty {
isValueValid = true
}
cell.setTips(detailItem.tips, isShow: (isNeedShowError && !isValueValid))
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
...@@ -193,18 +216,22 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -193,18 +216,22 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
// 只有国外城市才需输入,国内城市使用的是选择器 // 只有国外城市才需输入,国内城市使用的是选择器
if detailItem.type == .educationCity { if detailItem.type == .educationCity {
if let text = text, !text.isEmpty { if let text = text, !text.isEmpty {
detailInfo.schoolAddress?.foreign = text detailInfo.schoolAddress.foreign = text
} else { } else {
detailInfo.schoolAddress?.foreign = "" detailInfo.schoolAddress.foreign = ""
} }
} else if detailItem.type == .educationMajor { } else if detailItem.type == .educationMajor {
if let text = text, !text.isEmpty {
detailInfo.professional = text detailInfo.professional = text
} else {
detailInfo.professional = ""
}
} }
if isEditEnd { if isEditEnd {
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo() saveDetailInfo(isNeedPop: false)
} }
} }
} }
...@@ -212,10 +239,16 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -212,10 +239,16 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} else if cellType == .selectSheet { } else if cellType == .selectSheet {
let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell let cell = tableView.dequeueReusableCell(withIdentifier: YHFormItemSelectSheetCell.cellReuseIdentifier, for: indexPath) as! YHFormItemSelectSheetCell
cell.isShowBottomLine = (indexPath.row != arr.count-1)
cell.placeHolder = detailItem.placeHolder cell.placeHolder = detailItem.placeHolder
cell.isMust = detailItem.isNeed cell.isMust = detailItem.isNeed
cell.title = detailItem.getTitle() cell.title = detailItem.getTitle()
cell.detail = detailItem.value cell.detail = detailItem.value
var isValueValid = false
if let value = detailItem.value, !value.isEmpty {
isValueValid = true
}
cell.setTips(detailItem.tips, isShow: (isNeedShowError && !isValueValid))
return cell return cell
} }
} }
...@@ -274,8 +307,9 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -274,8 +307,9 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.type = selectType.title detailInfo.type = selectType.title
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo() saveDetailInfo(isNeedPop: false)
} } }
}
} else if detailItem.type == .educationTime || detailItem.type == .graduateTime { // 入学及毕业年月 } else if detailItem.type == .educationTime || detailItem.type == .graduateTime { // 入学及毕业年月
...@@ -290,8 +324,9 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -290,8 +324,9 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} }
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo() saveDetailInfo(isNeedPop: false)
} } }
}
} else if detailItem.type == .educationDegree { // 学位 } else if detailItem.type == .educationDegree { // 学位
...@@ -301,10 +336,20 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -301,10 +336,20 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
detailInfo.background = selectType.title detailInfo.background = selectType.title
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo() saveDetailInfo(isNeedPop: false)
} } }
}
} else if detailItem.type == .degreeType { // 学位类型 } else if detailItem.type == .degreeType { // 学位类型
YHFormPickerView.show(type: .degreeCategory, selectType: .degreeCategory(.accountantOrFinance)) {
[weak self] selectType in
guard let self = self else { return }
detailInfo.degreeType = selectType.title
loadInfo()
if detailId != 0 {
saveDetailInfo(isNeedPop: false)
}
}
} else if detailItem.type == .educationCountry { // 上课国家/地区 } else if detailItem.type == .educationCountry { // 上课国家/地区
...@@ -312,11 +357,12 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -312,11 +357,12 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
vc.backLocationStringController = { vc.backLocationStringController = {
[weak self] country in [weak self] country in
guard let self = self else { return } guard let self = self else { return }
detailInfo.schoolAddress?.country = country detailInfo.schoolAddress.country = country
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo() saveDetailInfo(isNeedPop: false)
} } }
}
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} else if detailItem.type == .educationCity { // 上课城市 } else if detailItem.type == .educationCity { // 上课城市
...@@ -327,15 +373,15 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -327,15 +373,15 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
vc.backLocationStringController = { vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in [weak self] (string1, string2, string3, string4) in
guard let self = self else { return } guard let self = self else { return }
detailInfo.schoolAddress?.area = [string1, string2, string3, string4] detailInfo.schoolAddress.area = [string1, string2, string3, string4]
loadInfo() loadInfo()
if detailId != 0 { if detailId != 0 {
saveDetailInfo() saveDetailInfo(isNeedPop: false)
} } }
}
self.present(vc, animated: true) self.present(vc, animated: true)
} }
} }
} }
func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell { func createDefaultCell(_ indexPath: IndexPath) -> UITableViewCell {
...@@ -407,23 +453,62 @@ extension YHEducationDetailVC { ...@@ -407,23 +453,62 @@ extension YHEducationDetailVC {
} }
} }
func saveDetailInfo() { func submitInfo() {
let isChecked = checkIntegrity()
isNeedShowError = !isChecked
self.tableView .reloadData()
if !isChecked {
YHHUD.flash(message: "资料还未填完")
return
}
saveDetailInfo(isNeedPop: true)
}
// 检查填写信息完整性
func checkIntegrity() -> Bool {
if detailInfo.college.isEmpty
|| detailInfo.type.isEmpty
|| detailInfo.admissionTime.isEmpty
|| detailInfo.graduateTime.isEmpty
|| detailInfo.professional.isEmpty
|| detailInfo.background.isEmpty
|| detailInfo.degreeType.isEmpty
|| detailInfo.schoolAddress.country.isEmpty
{
return false
}
if detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.foreign.isEmpty {
return false
}
if !detailInfo.isSchoolInAboard(), detailInfo.schoolAddress.area.count <= 0 {
return false
}
return true
}
// 保存信息 isNeedPop:保存成功后是否退出该页面
func saveDetailInfo(isNeedPop:Bool) {
// detailInfo.toDictionary() 对于值为空的字段不会添加 而后台需要 所以如下处理 // detailInfo.toDictionary() 对于值为空的字段不会添加 而后台需要 所以如下处理
let dict:[String : Any] = ["verify": 0, let dict:[String : Any] = ["verify": 0,
"id": detailInfo.id, "id": detailInfo.id,
"order_id": detailInfo.orderId, "order_id": detailInfo.orderId,
"admission_time": detailInfo.admissionTime ?? "", "admission_time": detailInfo.admissionTime,
"background": detailInfo.background ?? "", "background": detailInfo.background,
"college": detailInfo.college ?? "", "college": detailInfo.college,
"degree_type": detailInfo.degreeType ?? "", "degree_type": detailInfo.degreeType,
"graduate_time": detailInfo.graduateTime ?? "", "graduate_time": detailInfo.graduateTime,
"professional": detailInfo.professional ?? "", "professional": detailInfo.professional,
"school_address_aboard": "", "school_address_aboard": "",
"type": detailInfo.type ?? "", "type": detailInfo.type,
"school_address": ["country": detailInfo.schoolAddress?.country ?? "", "school_address": ["country": detailInfo.schoolAddress.country,
"area": detailInfo.schoolAddress?.area ?? "", "area": detailInfo.schoolAddress.area,
"foreign": detailInfo.schoolAddress?.foreign ?? ""], "foreign": detailInfo.schoolAddress.foreign],
] ]
self.educationRequest.saveEducationInfo(params: dict) { self.educationRequest.saveEducationInfo(params: dict) {
...@@ -431,6 +516,9 @@ extension YHEducationDetailVC { ...@@ -431,6 +516,9 @@ extension YHEducationDetailVC {
guard let self = self else { return } guard let self = self else { return }
if success { if success {
YHHUD.flash(message: "保存成功") YHHUD.flash(message: "保存成功")
if isNeedPop {
self.navigationController?.popViewController(animated: true)
}
} else { } else {
YHHUD.flash(message: "保存失败") YHHUD.flash(message: "保存失败")
......
...@@ -101,7 +101,7 @@ class YHQualificationDetailVC: YHBaseViewController { ...@@ -101,7 +101,7 @@ class YHQualificationDetailVC: YHBaseViewController {
items.removeAll() items.removeAll()
let title0 = YHFormTitleItem(type: .mainApplicantEducation) let title0 = YHFormTitleItem(type: .mainApplicantProfessionalQualification)
let item00 = YHFormDetailItem(type: .qualificationCertificateName) let item00 = YHFormDetailItem(type: .qualificationCertificateName)
item00.placeHolder = "请选择资格证书名称".local item00.placeHolder = "请选择资格证书名称".local
item00.tips = "请选择资格证书名称".local item00.tips = "请选择资格证书名称".local
...@@ -396,7 +396,7 @@ extension YHQualificationDetailVC { ...@@ -396,7 +396,7 @@ extension YHQualificationDetailVC {
} }
} }
// 保存数据 isNeedPop:保存成功后是否需要 // 保存数据 isNeedPop:保存成功后是否需要退出该页面
func saveDetailInfo(isNeedPop:Bool) { func saveDetailInfo(isNeedPop:Bool) {
var dict:[String : Any] = [:] var dict:[String : Any] = [:]
......
...@@ -82,25 +82,25 @@ class YHEducationDetailInfo: SmartCodable { ...@@ -82,25 +82,25 @@ class YHEducationDetailInfo: SmartCodable {
var id: Int = 0 var id: Int = 0
var orderId: Int = 0 var orderId: Int = 0
var college: String? var college: String = ""
var isTop: Int = 0 var isTop: Int = 0
var type: String? var type: String = ""
var admissionTime: String? var admissionTime: String = ""
var graduateTime: String? var graduateTime: String = ""
var background: String? var background: String = ""
var professional: String? var professional: String = ""
var degreeType: String? var degreeType: String = ""
var remark: String? var remark: String = ""
var average: String? var average: String = ""
var schoolAddress: YHCollegeAddress? var schoolAddress: YHCollegeAddress = YHCollegeAddress()
var schoolAddressAboard: Int = 0 var schoolAddressAboard: Int = 0
var oldId: Int = 0 var oldId: Int = 0
var createdAt: String? var createdAt: String = ""
var updatedAt: String? var updatedAt: String = ""
var deletedAt: SmartAny? var deletedAt: String = ""
var isShow: Int = 0 var isShow: Int = 0
var operatorName: SmartAny? var operatorName: String = ""
var operatorEnglishName: SmartAny? var operatorEnglishName: String = ""
var operatorId: Int = 0 var operatorId: Int = 0
var matchListing: Int = 0 var matchListing: Int = 0
var createFromAppid: Int = 0 var createFromAppid: Int = 0
...@@ -141,7 +141,6 @@ class YHEducationDetailInfo: SmartCodable { ...@@ -141,7 +141,6 @@ class YHEducationDetailInfo: SmartCodable {
} }
// 学校是否在国外 默认是在国内 // 学校是否在国外 默认是在国内
func isSchoolInAboard() -> Bool { func isSchoolInAboard() -> Bool {
guard let schoolAddress = schoolAddress else { return false }
if schoolAddress.country.isEmpty { return false } if schoolAddress.country.isEmpty { return false }
if schoolAddress.country.contains("中国") { if schoolAddress.country.contains("中国") {
return false return false
......
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