提交 02e48deb authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 2b7ed3b0
/**
* 申请声明
*/
export default {
id: 'application_declare',
title: '申请声明',
visible() {
return false
},
update: {
action: '/api/enrollment/v1.0/application-materials/submit/1005'
},
form: {
model: { isAgree: [] },
items: [
{
type: 'v-checkbox',
values: [{ label: '同意', value: 1 }],
model: 'isAgree',
rules: [{ required: true, message: '请阅读协议', trigger: 'change' }],
prepend:
'<p>我提供的所有报名材料信息皆准确和完整。我同意在需要的情况下提交原件以确认我的报名资格。由于报名材料中的虚假、错误信息或重大遗漏导致不录取或取消学籍的后果由我个人承担。 我理解并同意所有报名材料归紫荆教育所有,无论考生录取与否均不退回。我授权紫荆教育使用报名表中的信息查询本人学习和工作记录。</p>'
}
]
}
}
import info from './info'
import tjx from './tjx'
import wfzsm from './wfzzm'
import declare from './declare'
export default {
id: 'application',
title: '报名申请',
children: [
info,
tjx,
wfzsm,
declare,
{
id: 'application_pay',
title: '缴报名费',
visible() {
return this.tabActive !== 'application_info_first'
},
}
]
}
import first from './info/first'
import profile from './info/profile'
import education from './info/education'
import career from './info/career'
import honor from './info/honor'
import training from './info/training'
import answer from './info/answer'
export default {
id: 'application_info',
title: '个人资料',
tabs: [first, profile, education, career, answer, training, honor]
}
/**
* 学习目的
*/
export default {
id: 'application_info_answer',
title: '学习目的',
required: true,
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
const { answers = [] } = data.data.material
const [first = {}, second = {}] = answers
return {
qid1: first.qid || '1',
question1: first.question || '个人描述(60-1000字)中文或者英文',
answer1: first.answer,
qid2: second.qid || '2',
question2: second.question || '申请紫荆教育康博斯威尔大学教育硕士的原因?以及您的职业或个人发展的预期目标(60-1000字)中文或者英文',
answer2: second.answer
}
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
return {
answers: [
{ qid: data.qid1, question: data.question1, answer: data.answer1 },
{ qid: data.qid2, question: data.question2, answer: data.answer2 }
]
}
}
},
form: {
options: {},
items: [
{
type: 'v-input',
label: '个人描述(60-1000字)中文或者英文',
model: 'answer1',
attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' },
rules: [
{ required: true, message: '请输入', trigger: 'blur' },
{ min: 200, max: 1000, message: '长度在 200 到 1000 个字符', trigger: 'blur' }
]
},
{
type: 'v-input',
label: '申请紫荆教育康博斯威尔大学教育硕士的原因?以及您的职业或个人发展的预期目标(60-1000字)中文或者英文',
model: 'answer2',
attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' },
rules: [
{ required: true, message: '请输入', trigger: 'blur' },
{ min: 200, max: 1000, message: '长度在 200 到 1000 个字符', trigger: 'blur' }
]
}
]
}
}
/**
* 工作经验
*/
export default {
id: 'application_info_career',
title: '工作经验',
required: true,
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.careers || []
list = list.map(item => {
const { start_date: startDate, end_date: endDate } = item
if (startDate) {
item.dates = [startDate, endDate]
}
return item
})
return list.length ? list : [{}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const careers = data.map(item => {
const [startDate, endDate] = item.dates
item.start_date = startDate
item.end_date = endDate
return ['start_date', 'end_date', 'company_name_cn', 'industry', 'dept_cn', 'position_cn', 'job_desc_cn'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { careers }
}
},
form: {
hasAdd: true,
options: {
labelWidth: '140px'
},
items: [
{
type: 'v-datepicker',
label: '工作时间',
model: 'dates',
attrs: {
type: 'monthrange',
rangeSeparator: '至',
startPlaceholder: '请选择开始时间',
endPlaceholder: '请选择结束时间',
valueFormat: 'yyyy-MM'
},
rules: [{ required: true, message: '请选择工作时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '工作单位',
model: 'company_name_cn',
attrs: { placeholder: '请输入工作单位' },
rules: [{ required: true, message: '请输入工作单位', trigger: 'blur' }]
},
{
type: 'v-select',
values: [
{ label: '互联网/电子商务', value: '1 ' },
{ label: '基金/证券/期货/投资', value: '2 ' },
{ label: '保险', value: '3 ' },
{ label: '银行', value: '4 ' },
{ label: '信托/担保/拍卖/典当', value: '5 ' },
{ label: '计算机软件', value: '6 ' },
{ label: 'IT服务(系统/数据/维护)', value: '7 ' },
{ label: '电子技术/半导体/集成电路', value: '8 ' },
{ label: '计算机硬件', value: '9 ' },
{ label: '通信/电信/网络设备', value: '10' },
{ label: '通信/电信运营、增值服务', value: '11' },
{ label: '网络游戏', value: '12' },
{ label: '房地产/建筑/建材/工程', value: '13' },
{ label: '家居/室内设计/装饰装潢', value: '14' },
{ label: '物业管理/商业中心', value: '15' },
{ label: '专业服务/咨询(财会/法律/人力资源等)', value: '16' },
{ label: '广告/会展/公关', value: '17' },
{ label: '中介服务', value: '18' },
{ label: '检验/检测/认证', value: '19' },
{ label: '外包服务', value: '20' },
{ label: '快速消费品(食品/饮料/烟酒/日化)', value: '21' },
{ label: '耐用消费品(服饰/纺织/皮革/家具/家电)', value: '22' },
{ label: '贸易/进出口', value: '23' },
{ label: '零售/批发', value: '24' },
{ label: '租赁服务', value: '25' },
{ label: '教育/培训/院校', value: '26' },
{ label: '礼品/玩具/工艺美术/收藏品/奢侈品', value: '27' },
{ label: '汽车/摩托车', value: '28' },
{ label: '大型设备/机电设备/重工业', value: '29' },
{ label: '加工制造(原料加工/模具)', value: '30' },
{ label: '仪器仪表及工业自动化', value: '31' },
{ label: '印刷/包装/造纸', value: '32' },
{ label: '办公用品及设备', value: '33' },
{ label: '医药/生物工程', value: '34' },
{ label: '医疗设备/器械', value: '35' },
{ label: '航空/航天研究与制造', value: '36' },
{ label: '交通/运输,物流/仓储', value: '37' },
{ label: '医疗/护理/美容/保健/卫生服务', value: '38' },
{ label: '酒店/餐饮,旅游/度假,媒体/出版/影视/文化传播', value: '39' },
{ label: '娱乐/体育/休闲', value: '40' },
{ label: '能源/矿产/采掘/冶炼', value: '41' },
{ label: '石油/石化/化工,电气/电力/水利', value: '42' },
{ label: '环保', value: '43' },
{ label: '政府/公共事业/非盈利机构', value: '44' },
{ label: '学术/科研,农/林/牧/渔跨领域经营', value: '45' },
{ label: '其他', value: '90' }
],
label: '行业类别',
model: 'industry',
rules: [{ required: true, message: '请选择行业类别', trigger: 'change' }]
},
{
type: 'v-input',
label: '工作部门',
model: 'dept_cn',
attrs: { placeholder: '请输入工作部门' },
rules: [{ required: true, message: '请输入工作部门', trigger: 'blur' }]
},
{
type: 'v-input',
label: '工作职位',
model: 'position_cn',
attrs: { placeholder: '请输入工作职位' },
rules: [{ required: true, message: '请输入工作职位', trigger: 'blur' }]
},
{
type: 'v-input',
label: '工作描述',
model: 'job_desc_cn',
attrs: {
type: 'textarea',
placeholder: '请输入工作描述',
rows: '8',
maxlength: '3000'
},
rules: [{ required: true, message: '请输入工作描述', trigger: 'blur' }]
}
]
}
}
/**
* 教育背景
*/
export default {
id: 'application_info_education',
title: '教育背景',
required: true,
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.educations || []
list = list.map(item => {
const { start_date: startDate, end_date: endDate } = item
if (startDate) {
item.dates = [startDate, endDate]
}
return item
})
return list.length ? list : [{}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const educations = data.map(item => {
const [startDate, endDate] = item.dates
item.start_date = startDate
item.end_date = endDate
return ['start_date', 'end_date', 'school_name_cn', 'major_cn', 'degree'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { educations }
}
},
form: {
hasAdd: true,
options: {
labelWidth: '140px'
},
items: [
{
type: 'v-datepicker',
label: '教育时间',
model: 'dates',
attrs: {
type: 'monthrange',
rangeSeparator: '至',
startPlaceholder: '请选择开始时间',
endPlaceholder: '请选择结束时间',
valueFormat: 'yyyy-MM'
},
rules: [{ required: true, message: '请选择教育时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '学校名称',
model: 'school_name_cn',
rules: [{ required: true, message: '请输入学校名称', trigger: 'blur' }]
},
{
type: 'v-input',
label: '专业名称',
model: 'major_cn',
rules: [{ required: true, message: '请输入专业名称', trigger: 'blur' }]
},
{
type: 'v-select',
values: [
{ value: '专科' },
{ value: '本科' },
{ value: '本科/学士' },
{ value: '硕士研究生' },
{ value: '研究生/硕士' },
{ value: '博士研究生' },
{ value: '研究生/博士' },
{ value: '其他' }
],
label: '学历/学位',
model: 'degree',
rules: [{ required: true, message: '请选择学历/学位', trigger: 'change' }]
}
]
}
}
/**
* 个人信息
*/
export default {
id: 'application_info_first',
title: '个人信息',
required: true,
visible() {
return this.tabActive === 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
const { basic_info: basicInfo = {}, attachments = [] } = data.data.material
const attachment = attachments.reduce(
(result, item) => {
const types = ['ID_CARD_FRONT', 'ID_CARD_BACK', 'HK_ID_CARD', 'PASSPORT', 'OTHER_ID_CARD_PHOTO']
types.forEach(type => {
if (item.file_type_id === type) {
result[type].push(item)
}
})
return result
},
{ ID_CARD_FRONT: [], ID_CARD_BACK: [], HK_ID_CARD: [], PASSPORT: [], OTHER_ID_CARD_PHOTO: [] }
)
return Object.assign({}, basicInfo, attachment)
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const basicInfo = ['phone_number', 'email', 'id_type'].reduce((result, key) => {
result[key] = data[key]
return result
}, {})
return { basic_info: basicInfo }
}
},
form: {
hasButton: false,
options: { labelWidth: '140px' },
items: [
{
type: 'v-input',
label: '手机号',
model: 'phone_number',
attrs: { placeholder: '请输入手机号' },
rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }]
},
{
type: 'v-input',
label: '邮箱',
model: 'email',
attrs: { placeholder: '请输入邮箱' },
rules: [{ required: true, message: '请输入邮箱', trigger: 'blur' }]
},
{
type: 'v-select',
values: [{ value: '居民身份证' }, { value: '港澳台身份证' }, { value: '护照' }, { value: '其他' }],
label: '证件类型',
model: 'id_type',
attrs: { placeholder: '请选择证件类型' },
rules: [{ required: true, message: '请选择证件类型', trigger: 'change' }]
},
// 身份证照片(背面)
{
type: 'v-upload',
label: '身份证人像面',
model: 'ID_CARD_BACK',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'ID_CARD_BACK' },
limit: 1,
image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_back.png'
},
rules: [{ type: 'array', required: true, message: '请上传身份证照片人像面', trigger: 'change' }],
isShow(data) {
return data.id_type === '居民身份证'
}
},
// 身份证照片(正面)
{
type: 'v-upload',
label: '身份证国徽面',
model: 'ID_CARD_FRONT',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'ID_CARD_FRONT' },
limit: 1,
image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_front.png'
},
rules: [{ type: 'array', required: true, message: '请上传身份证照片国徽面', trigger: 'change' }],
isShow(data) {
return data.id_type === '居民身份证'
}
},
// 港澳台身份证
{
type: 'v-upload',
label: '港澳台身份证',
model: 'HK_ID_CARD',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'HK_ID_CARD' },
limit: 1
},
rules: [{ type: 'array', required: true, message: '请上传港澳台身份证', trigger: 'change' }],
isShow(data) {
return data.id_type === '港澳台身份证'
}
},
// 护照
{
type: 'v-upload',
label: '护照',
model: 'PASSPORT',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'PASSPORT' },
limit: 1
},
rules: [{ type: 'array', required: true, message: '请上传护照', trigger: 'change' }],
isShow(data) {
return data.id_type === '护照'
}
},
// 其他证件
{
type: 'v-upload',
label: '其他证件',
model: 'OTHER_ID_CARD_PHOTO',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'OTHER_ID_CARD_PHOTO' },
limit: 1
},
rules: [{ type: 'array', required: true, message: '请上传其他证件', trigger: 'change' }],
isShow(data) {
return data.id_type === '其他'
}
}
]
}
}
/**
* 荣誉奖励
*/
export default {
id: 'application_info_honor',
title: '荣誉奖励',
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.honors || []
return list.length ? list : [{}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const honors = data.map(item => {
return ['time', 'title', 'institution_cn'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { honors }
}
},
form: {
hasAdd: true,
options: {
labelWidth: '140px'
},
items: [
{
type: 'v-datepicker',
label: '获取时间',
model: 'time',
attrs: { type: 'date', valueFormat: 'yyyy-MM-dd', placeholder: '请选择获取时间' },
rules: [{ required: true, message: '请选择获取时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '荣誉奖励',
model: 'title',
attrs: { placeholder: '请输入荣誉奖励' },
rules: [{ required: true, message: '请输入荣誉奖励', trigger: 'blur' }]
},
{
type: 'v-input',
label: '证书颁发机构',
model: 'institution_cn',
rules: [{ required: true, message: '请输入证书颁发机构', trigger: 'blur' }]
}
]
}
}
/**
* 个人信息
*/
export default {
id: 'application_info_profile',
title: '个人信息',
required: true,
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
const { basic_info: basicInfo = {}, attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
const attachment = attachments.reduce(
(result, item) => {
const types = ['ID_CARD_FRONT', 'ID_CARD_BACK', 'HK_ID_CARD', 'PASSPORT', 'OTHER_ID_CARD_PHOTO']
types.forEach(type => {
if (item.file_type_id === type) {
result[type].push(item)
}
})
return result
},
{ ID_CARD_FRONT: [], ID_CARD_BACK: [], HK_ID_CARD: [], PASSPORT: [], OTHER_ID_CARD_PHOTO: [] }
)
return Object.assign({}, basicInfo, attachment)
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
// let [province, city] = data.city.split('-')
// data.address_province = province
// data.address_city = city
const basicInfo = [
'phone_number',
'email',
'id_type',
'id_number',
'real_name_cn',
'gender',
'nationality',
'birthday',
'address_province',
'address_city',
'we_chat_account',
'mailing_address',
'emergency_contact_name',
'emergency_contacts_phone'
].reduce((result, key) => {
result[key] = data[key]
return result
}, {})
return { basic_info: basicInfo }
}
},
form: {
options: { labelWidth: '140px' },
items: [
{
type: 'v-input',
label: '手机号',
model: 'phone_number',
attrs: { disabled: true, placeholder: '请输入手机号' },
rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }]
},
{
type: 'v-input',
label: '邮箱',
model: 'email',
attrs: { disabled: true, placeholder: '请输入邮箱' },
rules: [{ required: true, message: '请输入邮箱', trigger: 'blur' }],
hint: '(后续报名信息将发送至此邮箱,请认真填写)'
},
{
type: 'v-select',
values: [{ value: '居民身份证' }, { value: '港澳台身份证' }, { value: '护照' }, { value: '其他' }],
label: '证件类型',
model: 'id_type',
attrs: { disabled: true, placeholder: '请选择证件类型' },
rules: [{ required: true, message: '请选择证件类型', trigger: 'change' }]
},
// // 身份证照片(背面)
// {
// type: 'v-upload',
// label: '身份证人像面',
// model: 'ID_CARD_BACK',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'ID_CARD_BACK' },
// limit: 1,
// image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_back.png'
// },
// rules: [{ type: 'array', required: true, message: '请上传身份证照片人像面', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '居民身份证'
// }
// },
// // 身份证照片(正面)
// {
// type: 'v-upload',
// label: '身份证国徽面',
// model: 'ID_CARD_FRONT',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'ID_CARD_FRONT' },
// limit: 1,
// image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_front.png'
// },
// rules: [{ type: 'array', required: true, message: '请上传身份证照片国徽面', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '居民身份证'
// }
// },
// // 港澳台身份证
// {
// type: 'v-upload',
// label: '港澳台身份证',
// model: 'HK_ID_CARD',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'HK_ID_CARD' },
// limit: 1
// },
// rules: [{ type: 'array', required: true, message: '请上传港澳台身份证', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '港澳台身份证'
// }
// },
// // 护照
// {
// type: 'v-upload',
// label: '护照',
// model: 'PASSPORT',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'PASSPORT' },
// limit: 1
// },
// rules: [{ type: 'array', required: true, message: '请上传护照', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '护照'
// }
// },
// // 其他证件
// {
// type: 'v-upload',
// label: '其他证件',
// model: 'OTHER_ID_CARD_PHOTO',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'OTHER_ID_CARD_PHOTO' },
// limit: 1
// },
// rules: [{ type: 'array', required: true, message: '请上传其他证件', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '其他'
// }
// },
{
type: 'v-input',
label: '证件号码',
model: 'id_number',
attrs: { disabled: true, placeholder: '请输入证件号码' },
rules: [{ required: true, message: '请输入证件号码', trigger: 'blur' }]
},
{
type: 'v-input',
label: '姓名',
model: 'real_name_cn',
attrs: { placeholder: '请输入姓名' },
rules: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
prependSlotName: 'form-name-prepend'
},
{
type: 'v-radio',
values: [
{ label: '男', value: '男' },
{ label: '女', value: '女' }
],
label: '性别',
model: 'gender',
rules: [{ required: true, message: '请选择性别', trigger: 'change' }]
},
{
type: 'v-input',
label: '国籍',
model: 'nationality',
attrs: { placeholder: '请输入国籍' },
rules: [{ required: true, message: '请输入国籍', trigger: 'blur' }]
},
{
type: 'v-datepicker',
label: '出生日期',
model: 'birthday',
attrs: { type: 'date', placeholder: '请选择出生日期', valueFormat: 'yyyy-MM-dd' },
rules: [{ required: true, message: '请选择出生日期', trigger: 'blur' }]
},
{
type: 'v-input',
label: '居住省',
model: 'address_province',
attrs: { placeholder: '请输入居住省' },
rules: [{ required: true, message: '请输入居住省', trigger: 'blur' }]
},
{
type: 'v-input',
label: '居住市',
model: 'address_city',
attrs: { placeholder: '请输入居住市' },
rules: [{ required: true, message: '请输入居住市', trigger: 'blur' }]
},
// {
// type: 'city-v-select',
// label: '现居住城市',
// model: 'city',
// separator: '-',
// rules: [{ required: true, message: '请选择居住城市', trigger: 'blur' }]
// },
{
type: 'v-input',
label: '微信号',
model: 'we_chat_account',
attrs: { placeholder: '请输入微信号' },
rules: [{ required: true, message: '请输入微信号', trigger: 'blur' }]
},
{
type: 'v-input',
label: '邮寄地址',
model: 'mailing_address',
attrs: { placeholder: '请输入邮寄地址' },
rules: [{ required: true, message: '请输入邮寄地址', trigger: 'blur' }]
},
{
type: 'v-input',
label: '紧急联系人',
model: 'emergency_contact_name',
attrs: { placeholder: '请输入紧急联系人' },
rules: [{ required: true, message: '请输入紧急联系人', trigger: 'blur' }]
},
{
type: 'v-input',
label: '紧急联系电话',
model: 'emergency_contacts_phone',
attrs: { placeholder: '请输入紧急联系电话' },
rules: [{ required: true, message: '请输入紧急联系电话', trigger: 'blur' }]
}
]
}
}
/**
* 所受培训
*/
export default {
id: 'application_info_training',
title: '所受培训',
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.trainings || []
list = list.map(item => {
const { start_date: startDate, end_date: endDate } = item
if (startDate) {
item.dates = [startDate, endDate]
}
return item
})
return list.length ? list : [{}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const trainings = data.map(item => {
const [startDate, endDate] = item.dates
item.start_date = startDate
item.end_date = endDate
return ['start_date', 'end_date', 'institution_cn', 'course_cn'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { trainings }
}
},
form: {
hasAdd: true,
options: {
labelWidth: '140px'
},
items: [
{
type: 'v-datepicker',
label: '培训时间',
model: 'dates',
attrs: {
type: 'monthrange',
rangeSeparator: '至',
startPlaceholder: '请选择开始时间',
endPlaceholder: '请选择结束时间',
valueFormat: 'yyyy-MM'
},
rules: [{ required: true, message: '请选择培训时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '培训机构',
model: 'institution_cn',
rules: [{ required: true, message: '请输入培训机构', trigger: 'blur' }]
},
{
type: 'v-input',
label: '课程名称',
model: 'course_cn',
rules: [{ required: true, message: '请输入课程名称', trigger: 'blur' }]
}
]
}
}
/**
* 推荐信
*/
export default {
id: 'application_tjx',
title: '推荐信',
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
// this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.reco_letters || []
return list.length ? list : [{}, {}, {}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
// const recoLetters = data.map(item => {
// return ['provider_name', 'provider_phone_number', 'provider_email', 'provider_relationship'].reduce(
// (result, key) => {
// result[key] = item[key]
// return result
// },
// {}
// )
// })
return { reco_letters: data }
}
},
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_honor' } } },
next: { to: { query: { active: 'application_wfzzm' } } },
hasAdd: true,
minLength: 3,
disabled(data) {
return !!data.letter_content
},
aside: {
prepend: {
html: '<p style="color:#33C011;">推荐人已完成</p>',
visible(data) {
return !!data.letter_content
}
},
buttons: [
{
text: '再次邀请',
visible(data) {
return data.id && !data.letter_content
},
onClick(data) {
console.log(data, this)
}
},
{
text: '更换推荐人',
visible(data) {
return data.id && !data.letter_content
},
onClick(data) {
console.log(data, this)
}
}
]
},
options: {
labelWidth: '140px'
},
items: [
{
type: 'v-input',
label: '推荐人姓名',
model: 'provider_name',
attrs: { placeholder: '请输入推荐人姓名' },
rules: [{ required: true, message: '请输入推荐人姓名', trigger: 'blur' }]
},
{
type: 'v-input',
label: '推荐人电话',
model: 'provider_phone_number',
attrs: { placeholder: '请输入推荐人电话' },
rules: [{ required: true, message: '请输入推荐人电话', trigger: 'blur' }]
},
{
type: 'v-input',
label: '推荐人邮箱',
model: 'provider_email',
attrs: { placeholder: '请输入推荐人邮箱' },
rules: [{ required: true, message: '请输入推荐人邮箱', trigger: 'blur' }]
},
{
type: 'v-select',
values: [
{ value: '老师/导师' },
{ value: '领导' },
{ value: '同学' },
{ value: '同事' },
{ value: '亲属' },
{ value: '朋友' },
{ value: '其他' }
],
label: '与推荐人关系',
model: 'provider_relationship',
rules: [{ required: true, message: '请选择与推荐人关系', trigger: 'change' }]
}
]
}
}
export default {
id: 'application_wfzzm',
title: '无犯罪证明',
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
const { attachments = [] } = data.data.material
const NO_CRIMINAL_CERT = attachments.filter(item => {
return item.file_type_id === 'NO_CRIMINAL_CERT'
})
return { NO_CRIMINAL_CERT }
}
},
form: {
prev: { to: { query: { active: 'application_tjx' } } },
next: { to: { query: { active: 'application_declare' } } },
hasSubmit: false,
options: {},
items: [
{
type: 'v-upload',
required: true,
model: 'NO_CRIMINAL_CERT',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'NO_CRIMINAL_CERT' },
limit: 1
},
prepend: `
<p>第一步:点击下载按键获取无犯罪证明模板</p>
<p><a href="https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/%E6%97%A0%E7%8A%AF%E7%BD%AA%E8%AE%B0%E5%BD%95%E8%AF%81%E6%98%8E.docx" target="_blank" download>下载模板</a></p>
<p>第二步:打印文件后填写内容并签字上传至电脑,点击下方按钮上传文件</p>
`
}
]
}
}
......@@ -2,26 +2,57 @@
* 申请声明
*/
export default {
id: 'application_declare',
title: '申请声明',
visible() {
return false
},
update: {
action: '/api/enrollment/v1.0/application-materials/submit/1005'
},
form: {
model: { isAgree: [] },
items: [
{
type: 'v-checkbox',
values: [{ label: '同意', value: 1 }],
model: 'isAgree',
rules: [{ required: true, message: '请阅读协议', trigger: 'change' }],
prepend:
'<p>我提供的所有报名材料信息皆准确和完整。我同意在需要的情况下提交原件以确认我的报名资格。由于报名材料中的虚假、错误信息或重大遗漏导致不录取或取消学籍的后果由我个人承担。 我理解并同意所有报名材料归紫荆教育所有,无论考生录取与否均不退回。我授权紫荆教育使用报名表中的信息查询本人学习和工作记录。</p>'
export default function (_this) {
return {
id: 'application_declare',
title: '申请声明',
visible() {
return _this.visible
},
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { submission_stage: submissionStage = 'FILLING' } = data.data.material
const isSubmitted = submissionStage !== 'FILLING'
// this.form.options.disabled = isSubmitted
if (isSubmitted) {
return { isAgree: [1] }
}
return { isAgree: [] }
}
]
},
update: {
action: `/api/enrollment/v1.0/application-materials/submit/1005`,
callback() {
_this.getApplication()
this.form.options.disabled = true
// _this.$router.push({ path: this.$route.path, query: { active: 'application_pay' } })
// _this.$router.push({ path: '/my/interview' })
if (_this.hasPay) {
_this.$router.push({ path: this.$route.path, query: { active: 'application_pay' } })
} else {
_this.$router.push({ path: '/my/interview' })
}
},
errorCallback() {
_this.completeVisible = true
}
},
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_honor' } } },
submitText: '提交报名申请',
model: { isAgree: [] },
options: {},
items: [
{
type: 'v-checkbox',
values: [{ label: '同意', value: 1 }],
model: 'isAgree',
rules: [{ required: true, message: '请阅读协议', trigger: 'change' }],
prepend: `<p>1、本人知晓此申请表及所附文件将作为申请雪城大学硕士面试和背景评估的参考依据,一旦成功录取,有关资料将作为学生信息存档。</p>
<p>2、本人声明所填资料正确无误,知晓任何不真实的信息或不诚信的行为,均会影响申请结果,已取得的成绩和资格会被取消。我理解并同意所有报名材料归紫荆教育所有,无论考生录取与否均不退回。我授权紫荆教育使用报名表中的信息查询本人学习和工作记录。</p>`
}
]
}
}
}
import info from './info'
import tjx from './tjx'
import wfzsm from './wfzzm'
// import tjx from './tjx'
// import wfzsm from './wfzzm'
import declare from './declare'
export default {
id: 'application',
title: '报名申请',
children: [
info,
tjx,
wfzsm,
declare,
{
id: 'application_pay',
title: '缴报名费',
visible() {
return this.tabActive !== 'application_info_first'
},
}
]
export default function(_this) {
return {
id: 'application',
title: '报名申请',
children: [
info(_this),
// tjx(_this),
// wfzsm(_this),
declare(_this),
{
id: 'application_pay',
title: '缴报名费',
show: false,
visible() {
return _this.visible && _this.hasPay
}
}
]
}
}
......@@ -6,8 +6,10 @@ import honor from './info/honor'
import training from './info/training'
import answer from './info/answer'
export default {
id: 'application_info',
title: '个人资料',
tabs: [first, profile, education, career, answer, training, honor]
export default function(_this) {
return {
id: 'application_info',
title: '个人资料',
tabs: [first(_this), profile(_this), education(_this), career(_this), answer(_this), training(_this), honor(_this)]
}
}
......@@ -2,63 +2,68 @@
* 学习目的
*/
export default {
id: 'application_info_answer',
title: '学习目的',
required: true,
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
const { answers = [] } = data.data.material
const [first = {}, second = {}] = answers
return {
qid1: first.qid || '1',
question1: first.question || '个人描述(60-1000字)中文或者英文',
answer1: first.answer,
qid2: second.qid || '2',
question2: second.question || '申请紫荆教育康博斯威尔大学教育硕士的原因?以及您的职业或个人发展的预期目标(60-1000字)中文或者英文',
answer2: second.answer
export default function (_this) {
return {
id: 'application_info_answer',
title: '学习目的',
required: true,
visible() {
return _this.visible
},
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { answers = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
const [first = {}, second = {}] = answers
return {
qid1: first.qid || '1',
question1: '您为什么要申请雪城大学硕士保研项目?',
answer1: first.answer,
qid2: second.qid || '2',
question2: '您的短期和长期职业发展目标是什么?您打算如何达成此愿景?',
answer2: second.answer
}
}
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
return {
answers: [
{ qid: data.qid1, question: data.question1, answer: data.answer1 },
{ qid: data.qid2, question: data.question2, answer: data.answer2 }
]
},
update: {
action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) {
return {
answers: [
{ qid: data.qid1, question: data.question1, answer: data.answer1 },
{ qid: data.qid2, question: data.question2, answer: data.answer2 }
]
}
}
},
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_career' } }, isSubmit: true },
next: { to: { query: { active: 'application_info', tab: 'application_info_training' } }, isSubmit: true },
options: {},
items: [
{
type: 'v-input',
label: '您为什么要申请雪城大学硕士保研项目?(60字以上,1000字以内)',
model: 'answer1',
attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' },
rules: [
{ required: true, message: '请输入', trigger: 'blur' },
{ min: 60, max: 1000, message: '长度在 60 到 1000 个字符', trigger: 'blur' }
]
},
{
type: 'v-input',
label: '您的短期和长期职业发展目标是什么?您打算如何达成此愿景?(60字以上,1000字以内)',
model: 'answer2',
attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' },
rules: [
{ required: true, message: '请输入', trigger: 'blur' },
{ min: 60, max: 1000, message: '长度在 60 到 1000 个字符', trigger: 'blur' }
]
}
]
}
},
form: {
options: {},
items: [
{
type: 'v-input',
label: '个人描述(60-1000字)中文或者英文',
model: 'answer1',
attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' },
rules: [
{ required: true, message: '请输入', trigger: 'blur' },
{ min: 200, max: 1000, message: '长度在 200 到 1000 个字符', trigger: 'blur' }
]
},
{
type: 'v-input',
label: '申请紫荆教育康博斯威尔大学教育硕士的原因?以及您的职业或个人发展的预期目标(60-1000字)中文或者英文',
model: 'answer2',
attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' },
rules: [
{ required: true, message: '请输入', trigger: 'blur' },
{ min: 200, max: 1000, message: '长度在 200 到 1000 个字符', trigger: 'blur' }
]
}
]
}
}
......@@ -2,149 +2,151 @@
* 工作经验
*/
export default {
id: 'application_info_career',
title: '工作经验',
required: true,
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.careers || []
list = list.map(item => {
const { start_date: startDate, end_date: endDate } = item
if (startDate) {
item.dates = [startDate, endDate]
}
return item
})
return list.length ? list : [{}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const careers = data.map(item => {
const [startDate, endDate] = item.dates
item.start_date = startDate
item.end_date = endDate
return ['start_date', 'end_date', 'company_name_cn', 'industry', 'dept_cn', 'position_cn', 'job_desc_cn'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { careers }
}
},
form: {
hasAdd: true,
options: {
labelWidth: '140px'
export default function (_this) {
return {
id: 'application_info_career',
title: '工作经验',
// required: true,
visible() {
return _this.visible
},
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { careers: list = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
return list.length ? list : [{}]
}
},
update: {
action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) {
const careers = data.map(item => {
return ['start_date', 'end_date', 'company_name_cn', 'industry', 'dept_cn', 'position_cn', 'job_desc_cn'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { careers }
}
},
items: [
{
type: 'v-datepicker',
label: '工作时间',
model: 'dates',
attrs: {
type: 'monthrange',
rangeSeparator: '至',
startPlaceholder: '请选择开始时间',
endPlaceholder: '请选择结束时间',
valueFormat: 'yyyy-MM'
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_education' } }, isSubmit: true },
next: { to: { query: { active: 'application_info', tab: 'application_info_answer' } }, isSubmit: true },
hasAdd: true,
options: { labelWidth: '140px' },
prepend: '<p style="color:#606266;padding-left:70px">无工作经验学生可不填写</p>',
items: [
{
type: 'v-datepicker',
label: '开始时间',
model: 'start_date',
attrs: {
type: 'month',
placeholder: '请选择工作开始时间',
valueFormat: 'yyyy-MM'
}
// rules: [{ required: true, message: '请选择工作开始时间', trigger: 'blur' }]
},
rules: [{ required: true, message: '请选择工作时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '工作单位',
model: 'company_name_cn',
attrs: { placeholder: '请输入工作单位' },
rules: [{ required: true, message: '请输入工作单位', trigger: 'blur' }]
},
{
type: 'v-select',
values: [
{ label: '互联网/电子商务', value: '1 ' },
{ label: '基金/证券/期货/投资', value: '2 ' },
{ label: '保险', value: '3 ' },
{ label: '银行', value: '4 ' },
{ label: '信托/担保/拍卖/典当', value: '5 ' },
{ label: '计算机软件', value: '6 ' },
{ label: 'IT服务(系统/数据/维护)', value: '7 ' },
{ label: '电子技术/半导体/集成电路', value: '8 ' },
{ label: '计算机硬件', value: '9 ' },
{ label: '通信/电信/网络设备', value: '10' },
{ label: '通信/电信运营、增值服务', value: '11' },
{ label: '网络游戏', value: '12' },
{ label: '房地产/建筑/建材/工程', value: '13' },
{ label: '家居/室内设计/装饰装潢', value: '14' },
{ label: '物业管理/商业中心', value: '15' },
{ label: '专业服务/咨询(财会/法律/人力资源等)', value: '16' },
{ label: '广告/会展/公关', value: '17' },
{ label: '中介服务', value: '18' },
{ label: '检验/检测/认证', value: '19' },
{ label: '外包服务', value: '20' },
{ label: '快速消费品(食品/饮料/烟酒/日化)', value: '21' },
{ label: '耐用消费品(服饰/纺织/皮革/家具/家电)', value: '22' },
{ label: '贸易/进出口', value: '23' },
{ label: '零售/批发', value: '24' },
{ label: '租赁服务', value: '25' },
{ label: '教育/培训/院校', value: '26' },
{ label: '礼品/玩具/工艺美术/收藏品/奢侈品', value: '27' },
{ label: '汽车/摩托车', value: '28' },
{ label: '大型设备/机电设备/重工业', value: '29' },
{ label: '加工制造(原料加工/模具)', value: '30' },
{ label: '仪器仪表及工业自动化', value: '31' },
{ label: '印刷/包装/造纸', value: '32' },
{ label: '办公用品及设备', value: '33' },
{ label: '医药/生物工程', value: '34' },
{ label: '医疗设备/器械', value: '35' },
{ label: '航空/航天研究与制造', value: '36' },
{ label: '交通/运输,物流/仓储', value: '37' },
{ label: '医疗/护理/美容/保健/卫生服务', value: '38' },
{ label: '酒店/餐饮,旅游/度假,媒体/出版/影视/文化传播', value: '39' },
{ label: '娱乐/体育/休闲', value: '40' },
{ label: '能源/矿产/采掘/冶炼', value: '41' },
{ label: '石油/石化/化工,电气/电力/水利', value: '42' },
{ label: '环保', value: '43' },
{ label: '政府/公共事业/非盈利机构', value: '44' },
{ label: '学术/科研,农/林/牧/渔跨领域经营', value: '45' },
{ label: '其他', value: '90' }
],
label: '行业类别',
model: 'industry',
rules: [{ required: true, message: '请选择行业类别', trigger: 'change' }]
},
{
type: 'v-input',
label: '工作部门',
model: 'dept_cn',
attrs: { placeholder: '请输入工作部门' },
rules: [{ required: true, message: '请输入工作部门', trigger: 'blur' }]
},
{
type: 'v-input',
label: '工作职位',
model: 'position_cn',
attrs: { placeholder: '请输入工作职位' },
rules: [{ required: true, message: '请输入工作职位', trigger: 'blur' }]
},
{
type: 'v-input',
label: '工作描述',
model: 'job_desc_cn',
attrs: {
type: 'textarea',
placeholder: '请输入工作描述',
rows: '8',
maxlength: '3000'
{
type: 'v-datepicker',
label: '结束时间',
model: 'end_date',
attrs: {
type: 'month',
placeholder: '请选择工作结束时间',
valueFormat: 'yyyy-MM'
}
// rules: [{ required: true, message: '请选择工作结束时间', trigger: 'blur' }]
},
rules: [{ required: true, message: '请输入工作描述', trigger: 'blur' }]
}
]
{
type: 'v-input',
label: '工作单位',
model: 'company_name_cn',
attrs: { placeholder: '请输入工作单位' }
// rules: [{ required: true, message: '请输入工作单位', trigger: 'blur' }]
},
{
type: 'v-select',
values: [
{ value: '互联网/电子商务' },
{ value: '基金/证券/期货/投资' },
{ value: '保险' },
{ value: '银行' },
{ value: '信托/担保/拍卖/典当' },
{ value: '计算机软件' },
{ value: 'IT服务(系统/数据/维护)' },
{ value: '电子技术/半导体/集成电路' },
{ value: '计算机硬件' },
{ value: '通信/电信/网络设备' },
{ value: '通信/电信运营、增值服务' },
{ value: '网络游戏' },
{ value: '房地产/建筑/建材/工程' },
{ value: '家居/室内设计/装饰装潢' },
{ value: '物业管理/商业中心' },
{ value: '专业服务/咨询(财会/法律/人力资源等)' },
{ value: '广告/会展/公关' },
{ value: '中介服务' },
{ value: '检验/检测/认证' },
{ value: '外包服务' },
{ value: '快速消费品(食品/饮料/烟酒/日化)' },
{ value: '耐用消费品(服饰/纺织/皮革/家具/家电)' },
{ value: '贸易/进出口' },
{ value: '零售/批发' },
{ value: '租赁服务' },
{ value: '教育/培训/院校' },
{ value: '礼品/玩具/工艺美术/收藏品/奢侈品' },
{ value: '汽车/摩托车' },
{ value: '大型设备/机电设备/重工业' },
{ value: '加工制造(原料加工/模具)' },
{ value: '仪器仪表及工业自动化' },
{ value: '印刷/包装/造纸' },
{ value: '办公用品及设备' },
{ value: '医药/生物工程' },
{ value: '医疗设备/器械' },
{ value: '航空/航天研究与制造' },
{ value: '交通/运输,物流/仓储' },
{ value: '医疗/护理/美容/保健/卫生服务' },
{ value: '酒店/餐饮,旅游/度假,媒体/出版/影视/文化传播' },
{ value: '娱乐/体育/休闲' },
{ value: '能源/矿产/采掘/冶炼' },
{ value: '石油/石化/化工,电气/电力/水利' },
{ value: '环保' },
{ value: '政府/公共事业/非盈利机构' },
{ value: '学术/科研,农/林/牧/渔跨领域经营' },
{ value: '其他' }
],
label: '行业类别',
model: 'industry'
// rules: [{ required: true, message: '请选择行业类别', trigger: 'change' }]
},
{
type: 'v-input',
label: '工作部门',
model: 'dept_cn',
attrs: { placeholder: '请输入工作部门' }
// rules: [{ required: true, message: '请输入工作部门', trigger: 'blur' }]
},
{
type: 'v-input',
label: '工作职位',
model: 'position_cn',
attrs: { placeholder: '请输入工作职位' }
// rules: [{ required: true, message: '请输入工作职位', trigger: 'blur' }]
},
{
type: 'v-input',
label: '工作描述',
model: 'job_desc_cn',
attrs: {
type: 'textarea',
placeholder: '请输入工作描述',
rows: '8',
maxlength: '3000'
}
// rules: [{ required: true, message: '请输入工作描述', trigger: 'blur' }]
}
]
}
}
}
export default [
{ label: '中国', value: '中国' },
{ label: '阿富汗', value: '阿富汗' },
{ label: '奥兰群岛', value: '奥兰群岛' },
{ label: '阿尔巴尼亚', value: '阿尔巴尼亚' },
{ label: '阿尔及利亚', value: '阿尔及利亚' },
{ label: '美属萨摩亚', value: '美属萨摩亚' },
{ label: '安道尔', value: '安道尔' },
{ label: '安哥拉', value: '安哥拉' },
{ label: '安圭拉', value: '安圭拉' },
{ label: '安提瓜和巴布达', value: '安提瓜和巴布达' },
{ label: '阿根廷', value: '阿根廷' },
{ label: '亚美尼亚', value: '亚美尼亚' },
{ label: '阿鲁巴', value: '阿鲁巴' },
{ label: '澳大利亚', value: '澳大利亚' },
{ label: '奥地利', value: '奥地利' },
{ label: '阿塞拜疆', value: '阿塞拜疆' },
{ label: '孟加拉', value: '孟加拉' },
{ label: '巴林', value: '巴林' },
{ label: '巴哈马', value: '巴哈马' },
{ label: '巴巴多斯', value: '巴巴多斯' },
{ label: '白俄罗斯', value: '白俄罗斯' },
{ label: '比利时', value: '比利时' },
{ label: '伯利兹', value: '伯利兹' },
{ label: '贝宁', value: '贝宁' },
{ label: '百慕大', value: '百慕大' },
{ label: '不丹', value: '不丹' },
{ label: '玻利维亚', value: '玻利维亚' },
{ label: '波斯尼亚和黑塞哥维那', value: '波斯尼亚和黑塞哥维那' },
{ label: '博茨瓦纳', value: '博茨瓦纳' },
{ label: '布维岛', value: '布维岛' },
{ label: '巴西', value: '巴西' },
{ label: '文莱', value: '文莱' },
{ label: '保加利亚', value: '保加利亚' },
{ label: '布基纳法索', value: '布基纳法索' },
{ label: '布隆迪', value: '布隆迪' },
{ label: '柬埔寨', value: '柬埔寨' },
{ label: '喀麦隆', value: '喀麦隆' },
{ label: '加拿大', value: '加拿大' },
{ label: '佛得角', value: '佛得角' },
{ label: '中非', value: '中非' },
{ label: '乍得', value: '乍得' },
{ label: '智利', value: '智利' },
{ label: '圣诞岛', value: '圣诞岛' },
{ label: '科科斯(基林)群岛', value: '科科斯(基林)群岛' },
{ label: '哥伦比亚', value: '哥伦比亚' },
{ label: '科摩罗', value: '科摩罗' },
{ label: '刚果(金)', value: '刚果(金)' },
{ label: '刚果', value: '刚果' },
{ label: '库克群岛', value: '库克群岛' },
{ label: '哥斯达黎加', value: '哥斯达黎加' },
{ label: '科特迪瓦', value: '科特迪瓦' },
{ label: '克罗地亚', value: '克罗地亚' },
{ label: '古巴', value: '古巴' },
{ label: '捷克', value: '捷克' },
{ label: '塞浦路斯', value: '塞浦路斯' },
{ label: '丹麦', value: '丹麦' },
{ label: '吉布提', value: '吉布提' },
{ label: '多米尼加', value: '多米尼加' },
{ label: '厄瓜多尔', value: '厄瓜多尔' },
{ label: '埃及', value: '埃及' },
{ label: '赤道几内亚', value: '赤道几内亚' },
{ label: '厄立特里亚', value: '厄立特里亚' },
{ label: '爱沙尼亚', value: '爱沙尼亚' },
{ label: '埃塞俄比亚', value: '埃塞俄比亚' },
{ label: '法罗群岛', value: '法罗群岛' },
{ label: '斐济', value: '斐济' },
{ label: '芬兰', value: '芬兰' },
{ label: '法国', value: '法国' },
{ label: '法国大都会', value: '法国大都会' },
{ label: '法属圭亚那', value: '法属圭亚那' },
{ label: '法属波利尼西亚', value: '法属波利尼西亚' },
{ label: '加蓬', value: '加蓬' },
{ label: '冈比亚', value: '冈比亚' },
{ label: '格鲁吉亚', value: '格鲁吉亚' },
{ label: '德国', value: '德国' },
{ label: '加纳', value: '加纳' },
{ label: '直布罗陀', value: '直布罗陀' },
{ label: '希腊', value: '希腊' },
{ label: '格林纳达', value: '格林纳达' },
{ label: '瓜德罗普岛', value: '瓜德罗普岛' },
{ label: '关岛', value: '关岛' },
{ label: '危地马拉', value: '危地马拉' },
{ label: '根西岛', value: '根西岛' },
{ label: '几内亚比绍', value: '几内亚比绍' },
{ label: '几内亚', value: '几内亚' },
{ label: '圭亚那', value: '圭亚那' },
{ label: '海地', value: '海地' },
{ label: '洪都拉斯', value: '洪都拉斯' },
{ label: '匈牙利', value: '匈牙利' },
{ label: '冰岛', value: '冰岛' },
{ label: '印度', value: '印度' },
{ label: '印度尼西亚', value: '印度尼西亚' },
{ label: '伊朗', value: '伊朗' },
{ label: '伊拉克', value: '伊拉克' },
{ label: '爱尔兰', value: '爱尔兰' },
{ label: '马恩岛', value: '马恩岛' },
{ label: '以色列', value: '以色列' },
{ label: '意大利', value: '意大利' },
{ label: '牙买加', value: '牙买加' },
{ label: '日本', value: '日本' },
{ label: '泽西岛', value: '泽西岛' },
{ label: '约旦', value: '约旦' },
{ label: '哈萨克斯坦', value: '哈萨克斯坦' },
{ label: '肯尼亚', value: '肯尼亚' },
{ label: '基里巴斯', value: '基里巴斯' },
{ label: '韩国', value: '韩国' },
{ label: '朝鲜', value: '朝鲜' },
{ label: '科威特', value: '科威特' },
{ label: '吉尔吉斯斯坦', value: '吉尔吉斯斯坦' },
{ label: '老挝', value: '老挝' },
{ label: '拉脱维亚', value: '拉脱维亚' },
{ label: '黎巴嫩', value: '黎巴嫩' },
{ label: '莱索托', value: '莱索托' },
{ label: '利比里亚', value: '利比里亚' },
{ label: '利比亚', value: '利比亚' },
{ label: '列支敦士登', value: '列支敦士登' },
{ label: '立陶宛', value: '立陶宛' },
{ label: '卢森堡', value: '卢森堡' },
{ label: '马其顿', value: '马其顿' },
{ label: '马拉维', value: '马拉维' },
{ label: '马来西亚', value: '马来西亚' },
{ label: '马达加斯加', value: '马达加斯加' },
{ label: '马尔代夫', value: '马尔代夫' },
{ label: '马里', value: '马里' },
{ label: '马耳他', value: '马耳他' },
{ label: '马绍尔群岛', value: '马绍尔群岛' },
{ label: '马提尼克岛', value: '马提尼克岛' },
{ label: '毛里塔尼亚', value: '毛里塔尼亚' },
{ label: '毛里求斯', value: '毛里求斯' },
{ label: '马约特', value: '马约特' },
{ label: '墨西哥', value: '墨西哥' },
{ label: '密克罗尼西亚', value: '密克罗尼西亚' },
{ label: '摩尔多瓦', value: '摩尔多瓦' },
{ label: '摩纳哥', value: '摩纳哥' },
{ label: '蒙古', value: '蒙古' },
{ label: '黑山', value: '黑山' },
{ label: '蒙特塞拉特', value: '蒙特塞拉特' },
{ label: '摩洛哥', value: '摩洛哥' },
{ label: '莫桑比克', value: '莫桑比克' },
{ label: '缅甸', value: '缅甸' },
{ label: '纳米比亚', value: '纳米比亚' },
{ label: '瑙鲁', value: '瑙鲁' },
{ label: '尼泊尔', value: '尼泊尔' },
{ label: '荷兰', value: '荷兰' },
{ label: '新喀里多尼亚', value: '新喀里多尼亚' },
{ label: '新西兰', value: '新西兰' },
{ label: '尼加拉瓜', value: '尼加拉瓜' },
{ label: '尼日尔', value: '尼日尔' },
{ label: '尼日利亚', value: '尼日利亚' },
{ label: '纽埃', value: '纽埃' },
{ label: '诺福克岛', value: '诺福克岛' },
{ label: '挪威', value: '挪威' },
{ label: '阿曼', value: '阿曼' },
{ label: '巴基斯坦', value: '巴基斯坦' },
{ label: '帕劳', value: '帕劳' },
{ label: '巴勒斯坦', value: '巴勒斯坦' },
{ label: '巴拿马', value: '巴拿马' },
{ label: '巴布亚新几内亚', value: '巴布亚新几内亚' },
{ label: '秘鲁', value: '秘鲁' },
{ label: '菲律宾', value: '菲律宾' },
{ label: '皮特凯恩群岛', value: '皮特凯恩群岛' },
{ label: '波兰', value: '波兰' },
{ label: '葡萄牙', value: '葡萄牙' },
{ label: '波多黎各', value: '波多黎各' },
{ label: '卡塔尔', value: '卡塔尔' },
{ label: '留尼汪岛', value: '留尼汪岛' },
{ label: '罗马尼亚', value: '罗马尼亚' },
{ label: '卢旺达', value: '卢旺达' },
{ label: '俄罗斯联邦', value: '俄罗斯联邦' },
{ label: '圣赫勒拿', value: '圣赫勒拿' },
{ label: '圣基茨和尼维斯', value: '圣基茨和尼维斯' },
{ label: '圣卢西亚', value: '圣卢西亚' },
{ label: '圣文森特和格林纳丁斯', value: '圣文森特和格林纳丁斯' },
{ label: '萨尔瓦多', value: '萨尔瓦多' },
{ label: '萨摩亚', value: '萨摩亚' },
{ label: '圣马力诺', value: '圣马力诺' },
{ label: '圣多美和普林西比', value: '圣多美和普林西比' },
{ label: '沙特阿拉伯', value: '沙特阿拉伯' },
{ label: '塞内加尔', value: '塞内加尔' },
{ label: '塞舌尔', value: '塞舌尔' },
{ label: '塞拉利昂', value: '塞拉利昂' },
{ label: '新加坡', value: '新加坡' },
{ label: '塞尔维亚', value: '塞尔维亚' },
{ label: '斯洛伐克', value: '斯洛伐克' },
{ label: '斯洛文尼亚', value: '斯洛文尼亚' },
{ label: '所罗门群岛', value: '所罗门群岛' },
{ label: '索马里', value: '索马里' },
{ label: '南非', value: '南非' },
{ label: '西班牙', value: '西班牙' },
{ label: '斯里兰卡', value: '斯里兰卡' },
{ label: '苏丹', value: '苏丹' },
{ label: '苏里南', value: '苏里南' },
{ label: '斯威士兰', value: '斯威士兰' },
{ label: '瑞典', value: '瑞典' },
{ label: '瑞士', value: '瑞士' },
{ label: '叙利亚', value: '叙利亚' },
{ label: '塔吉克斯坦', value: '塔吉克斯坦' },
{ label: '坦桑尼亚', value: '坦桑尼亚' },
{ label: '泰国', value: '泰国' },
{ label: '特立尼达和多巴哥', value: '特立尼达和多巴哥' },
{ label: '东帝汶', value: '东帝汶' },
{ label: '多哥', value: '多哥' },
{ label: '托克劳', value: '托克劳' },
{ label: '汤加', value: '汤加' },
{ label: '突尼斯', value: '突尼斯' },
{ label: '土耳其', value: '土耳其' },
{ label: '土库曼斯坦', value: '土库曼斯坦' },
{ label: '图瓦卢', value: '图瓦卢' },
{ label: '乌干达', value: '乌干达' },
{ label: '乌克兰', value: '乌克兰' },
{ label: '阿拉伯联合酋长国', value: '阿拉伯联合酋长国' },
{ label: '英国', value: '英国' },
{ label: '美国', value: '美国' },
{ label: '乌拉圭', value: '乌拉圭' },
{ label: '乌兹别克斯坦', value: '乌兹别克斯坦' },
{ label: '瓦努阿图', value: '瓦努阿图' },
{ label: '梵蒂冈', value: '梵蒂冈' },
{ label: '委内瑞拉', value: '委内瑞拉' },
{ label: '越南', value: '越南' },
{ label: '瓦利斯群岛和富图纳群岛', value: '瓦利斯群岛和富图纳群岛' },
{ label: '西撒哈拉', value: '西撒哈拉' },
{ label: '也门', value: '也门' },
{ label: '南斯拉夫', value: '南斯拉夫' },
{ label: '赞比亚', value: '赞比亚' },
{ label: '津巴布韦', value: '津巴布韦' }
]
......@@ -2,90 +2,118 @@
* 教育背景
*/
export default {
id: 'application_info_education',
title: '教育背景',
required: true,
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.educations || []
list = list.map(item => {
const { start_date: startDate, end_date: endDate } = item
if (startDate) {
item.dates = [startDate, endDate]
export default function (_this) {
return {
id: 'application_info_education',
title: '教育背景',
required: true,
visible() {
return _this.visible
},
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { basic_info: basicInfo = {}, educations: list = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
if (list.length > 0) {
list[0].education_status = basicInfo.education_status
}
return item
})
return list.length ? list : [{}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const educations = data.map(item => {
const [startDate, endDate] = item.dates
item.start_date = startDate
item.end_date = endDate
return ['start_date', 'end_date', 'school_name_cn', 'major_cn', 'degree'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { educations }
}
},
form: {
hasAdd: true,
options: {
labelWidth: '140px'
return list.length ? list : [{}]
}
},
items: [
{
type: 'v-datepicker',
label: '教育时间',
model: 'dates',
attrs: {
type: 'monthrange',
rangeSeparator: '至',
startPlaceholder: '请选择开始时间',
endPlaceholder: '请选择结束时间',
valueFormat: 'yyyy-MM'
},
rules: [{ required: true, message: '请选择教育时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '学校名称',
model: 'school_name_cn',
rules: [{ required: true, message: '请输入学校名称', trigger: 'blur' }]
update: {
action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) {
const educations = data.map(item => {
return ['start_date', 'end_date', 'school_type', 'school_name_cn', 'major_cn', 'degree'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
const basicInfo = { education_status: data[0].education_status }
return { basic_info: basicInfo, educations }
},
{
type: 'v-input',
label: '专业名称',
model: 'major_cn',
rules: [{ required: true, message: '请输入专业名称', trigger: 'blur' }]
},
{
type: 'v-select',
values: [
{ value: '专科' },
{ value: '本科' },
{ value: '本科/学士' },
{ value: '硕士研究生' },
{ value: '研究生/硕士' },
{ value: '博士研究生' },
{ value: '研究生/博士' },
{ value: '其他' }
],
label: '学历/学位',
model: 'degree',
rules: [{ required: true, message: '请选择学历/学位', trigger: 'change' }]
callback() {
_this.getApplication()
}
]
},
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_profile' } } },
next: { to: { query: { active: 'application_info', tab: 'application_info_career' } }, isSubmit: true },
hasAdd: true,
options: { labelWidth: '140px' },
appendItems: [
{
type: 'v-input',
label: '当前教育状态',
model: 'education_status',
attrs: { placeholder: '请填写当前教育状态' },
rules: [{ required: true, message: '请填写当前教育状态', trigger: 'blur' }],
append: '<p style="color:#606266">当前教育状态(填写示例:本科在读/大四)</p>'
}
],
items: [
{
type: 'v-datepicker',
label: '开始时间',
model: 'start_date',
attrs: {
type: 'month',
placeholder: '请选择教育开始时间',
valueFormat: 'yyyy-MM'
},
rules: [{ required: true, message: '请选择教育开始时间', trigger: 'blur' }]
},
{
type: 'v-datepicker',
label: '结束时间',
model: 'end_date',
attrs: {
type: 'month',
placeholder: '请选择教育结束时间',
valueFormat: 'yyyy-MM'
},
rules: [{ required: true, message: '请选择教育结束时间', trigger: 'blur' }],
append: '<p style="color:#606266">在读学生填写预计毕业时间</p>'
},
{
type: 'v-select',
values: [{ value: '985院校' }, { value: '211院校' }, { value: '省重点' }, { value: '普通本科' }, { value: '专科院校' }],
label: '学校类型',
model: 'school_type',
rules: [{ required: true, message: '请选择学校类型', trigger: 'change' }]
},
{
type: 'v-input',
label: '学校名称',
model: 'school_name_cn',
attrs: { placeholder: '请输入学校名称' },
rules: [{ required: true, message: '请输入学校名称', trigger: 'blur' }]
},
{
type: 'v-input',
label: '专业名称',
model: 'major_cn',
attrs: { placeholder: '请输入专业名称' },
rules: [{ required: true, message: '请输入专业名称', trigger: 'blur' }]
},
{
type: 'v-select',
values: [
{ value: '专科' },
{ value: '本科' },
{ value: '本科/学士' },
{ value: '硕士研究生' },
{ value: '研究生/硕士' },
{ value: '博士研究生' },
{ value: '研究生/博士' },
{ value: '其他' }
],
label: '学历/学位',
model: 'degree',
rules: [{ required: true, message: '请选择学历/学位', trigger: 'change' }]
}
]
}
}
}
......@@ -2,151 +2,161 @@
* 个人信息
*/
export default {
id: 'application_info_first',
title: '个人信息',
required: true,
visible() {
return this.tabActive === 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
const { basic_info: basicInfo = {}, attachments = [] } = data.data.material
const attachment = attachments.reduce(
(result, item) => {
const types = ['ID_CARD_FRONT', 'ID_CARD_BACK', 'HK_ID_CARD', 'PASSPORT', 'OTHER_ID_CARD_PHOTO']
types.forEach(type => {
if (item.file_type_id === type) {
result[type].push(item)
}
})
export default function (_this) {
return {
id: 'application_info_first',
title: '个人信息',
required: true,
// visible() {
// return this.tabActive === 'application_info_first'
// },
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { basic_info: basicInfo = {}, attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
const attachment = attachments.reduce(
(result, item) => {
const types = ['ID_CARD_FRONT', 'ID_CARD_BACK', 'HK_ID_CARD', 'PASSPORT', 'OTHER_ID_CARD_PHOTO']
types.forEach(type => {
if (item.file_type_id === type) {
result[type].push(item)
}
})
return result
},
{ ID_CARD_FRONT: [], ID_CARD_BACK: [], HK_ID_CARD: [], PASSPORT: [], OTHER_ID_CARD_PHOTO: [] }
)
basicInfo.id_type = basicInfo.id_type === '护照' ? '中国护照' : basicInfo.id_type
return Object.assign({}, basicInfo, attachment)
}
},
update: {
action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) {
const basicInfo = ['phone_number', 'email', 'id_type'].reduce((result, key) => {
result[key] = data[key]
return result
}, {})
return { basic_info: basicInfo }
}
},
form: {
submitText: '下一步',
next: { to: { query: { active: 'application_info', tab: 'application_info_profile' } }, isSubmit: true },
options: { labelWidth: '140px' },
items: [
{
type: 'v-input',
label: '手机号',
model: 'phone_number',
attrs: { placeholder: '请输入手机号', maxlength: 11 },
rules: [{ required: true, pattern: /^1[3-9]\d{9}$/, message: '请输入手机号', trigger: 'blur' }]
},
{ ID_CARD_FRONT: [], ID_CARD_BACK: [], HK_ID_CARD: [], PASSPORT: [], OTHER_ID_CARD_PHOTO: [] }
)
return Object.assign({}, basicInfo, attachment)
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const basicInfo = ['phone_number', 'email', 'id_type'].reduce((result, key) => {
result[key] = data[key]
return result
}, {})
return { basic_info: basicInfo }
}
},
form: {
hasButton: false,
options: { labelWidth: '140px' },
items: [
{
type: 'v-input',
label: '手机号',
model: 'phone_number',
attrs: { placeholder: '请输入手机号' },
rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }]
},
{
type: 'v-input',
label: '邮箱',
model: 'email',
attrs: { placeholder: '请输入邮箱' },
rules: [{ required: true, message: '请输入邮箱', trigger: 'blur' }]
},
{
type: 'v-select',
values: [{ value: '居民身份证' }, { value: '港澳台身份证' }, { value: '护照' }, { value: '其他' }],
label: '证件类型',
model: 'id_type',
attrs: { placeholder: '请选择证件类型' },
rules: [{ required: true, message: '请选择证件类型', trigger: 'change' }]
},
// 身份证照片(背面)
{
type: 'v-upload',
label: '身份证人像面',
model: 'ID_CARD_BACK',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'ID_CARD_BACK' },
limit: 1,
image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_back.png'
{
type: 'v-input',
label: '邮箱',
model: 'email',
attrs: { placeholder: '请输入邮箱' },
rules: [{ type: 'email', required: true, message: '请输入邮箱', trigger: 'blur' }]
},
rules: [{ type: 'array', required: true, message: '请上传身份证照片人像面', trigger: 'change' }],
isShow(data) {
return data.id_type === '居民身份证'
}
},
// 身份证照片(正面)
{
type: 'v-upload',
label: '身份证国徽面',
model: 'ID_CARD_FRONT',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'ID_CARD_FRONT' },
limit: 1,
image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_front.png'
{
type: 'v-select',
values: [{ value: '居民身份证' }, { value: '港澳台身份证' }, { value: '中国护照' }, { value: '其他' }],
label: '证件类型',
model: 'id_type',
attrs: { placeholder: '请选择证件类型' },
rules: [{ required: true, message: '请选择证件类型', trigger: 'change' }]
},
rules: [{ type: 'array', required: true, message: '请上传身份证照片国徽面', trigger: 'change' }],
isShow(data) {
return data.id_type === '居民身份证'
}
},
// 港澳台身份证
{
type: 'v-upload',
label: '港澳台身份证',
model: 'HK_ID_CARD',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'HK_ID_CARD' },
limit: 1
// 身份证照片(背面)
{
type: 'v-upload',
label: '身份证人像面',
model: 'ID_CARD_BACK',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'ID_CARD_BACK' },
limit: 1,
accept: 'image/*',
image: 'https://zws-imgs-pub.ezijing.com/pc/cu/id_card_back.png'
},
rules: [{ type: 'array', required: true, message: '请上传身份证照片人像面', trigger: 'change' }],
isShow(data) {
return data.id_type === '居民身份证'
}
},
rules: [{ type: 'array', required: true, message: '请上传港澳台身份证', trigger: 'change' }],
isShow(data) {
return data.id_type === '港澳台身份证'
}
},
// 护照
{
type: 'v-upload',
label: '护照',
model: 'PASSPORT',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'PASSPORT' },
limit: 1
// 身份证照片(正面)
{
type: 'v-upload',
label: '身份证国徽面',
model: 'ID_CARD_FRONT',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'ID_CARD_FRONT' },
limit: 1,
accept: 'image/*',
image: 'https://zws-imgs-pub.ezijing.com/pc/cu/id_card_front.png'
},
rules: [{ type: 'array', required: true, message: '请上传身份证照片国徽面', trigger: 'change' }],
isShow(data) {
return data.id_type === '居民身份证'
}
},
rules: [{ type: 'array', required: true, message: '请上传护照', trigger: 'change' }],
isShow(data) {
return data.id_type === '护照'
}
},
// 其他证件
{
type: 'v-upload',
label: '其他证件',
model: 'OTHER_ID_CARD_PHOTO',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'OTHER_ID_CARD_PHOTO' },
limit: 1
// 港澳台身份证
{
type: 'v-upload',
label: '港澳台身份证',
model: 'HK_ID_CARD',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'HK_ID_CARD' },
limit: 1,
accept: 'image/*'
},
rules: [{ type: 'array', required: true, message: '请上传港澳台身份证', trigger: 'change' }],
isShow(data) {
return data.id_type === '港澳台身份证'
}
},
rules: [{ type: 'array', required: true, message: '请上传其他证件', trigger: 'change' }],
isShow(data) {
return data.id_type === '其他'
// 中国护照
{
type: 'v-upload',
label: '中国护照',
model: 'PASSPORT',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'PASSPORT' },
limit: 1,
accept: 'image/*'
},
rules: [{ type: 'array', required: true, message: '请上传中国护照', trigger: 'change' }],
isShow(data) {
return data.id_type === '中国护照'
}
},
// 其他证件
{
type: 'v-upload',
label: '其他证件',
model: 'OTHER_ID_CARD_PHOTO',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'OTHER_ID_CARD_PHOTO' },
limit: 1,
accept: 'image/*'
},
rules: [{ type: 'array', required: true, message: '请上传其他证件', trigger: 'change' }],
isShow(data) {
return data.id_type === '其他'
}
}
}
]
]
}
}
}
......@@ -2,58 +2,79 @@
* 荣誉奖励
*/
export default {
id: 'application_info_honor',
title: '荣誉奖励',
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.honors || []
return list.length ? list : [{}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const honors = data.map(item => {
return ['time', 'title', 'institution_cn'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { honors }
}
},
form: {
hasAdd: true,
options: {
labelWidth: '140px'
export default function (_this) {
return {
id: 'application_info_honor',
title: '荣誉奖励',
visible() {
return _this.visible
},
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { attachments = [], honors: list = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
const CERTIFICATE_OF_HONOR = attachments.filter(item => {
return item.file_type_id === 'CERTIFICATE_OF_HONOR'
})
return list.length ? list.map(item => Object.assign({}, item, { CERTIFICATE_OF_HONOR })) : [{ CERTIFICATE_OF_HONOR }]
}
},
items: [
{
type: 'v-datepicker',
label: '获取时间',
model: 'time',
attrs: { type: 'date', valueFormat: 'yyyy-MM-dd', placeholder: '请选择获取时间' },
rules: [{ required: true, message: '请选择获取时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '荣誉奖励',
model: 'title',
attrs: { placeholder: '请输入荣誉奖励' },
rules: [{ required: true, message: '请输入荣誉奖励', trigger: 'blur' }]
},
{
type: 'v-input',
label: '证书颁发机构',
model: 'institution_cn',
rules: [{ required: true, message: '请输入证书颁发机构', trigger: 'blur' }]
update: {
action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) {
const honors = data.map(item => {
return ['time', 'title', 'institution_cn'].reduce((result, key) => {
result[key] = item[key] || ''
return result
}, {})
})
return { honors }
}
]
},
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_training' } }, isSubmit: true },
next: { to: { query: { active: 'application_declare' } }, isSubmit: true },
hasAdd: true,
options: { labelWidth: '140px' },
items: [
{
type: 'v-datepicker',
label: '获取时间',
model: 'time',
attrs: { type: 'date', valueFormat: 'yyyy-MM-dd', placeholder: '请选择获取时间' }
// rules: [{ required: true, message: '请选择获取时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '荣誉奖励',
model: 'title',
attrs: { placeholder: '请输入荣誉奖励' }
// rules: [{ required: true, message: '请输入荣誉奖励', trigger: 'blur' }]
},
{
type: 'v-input',
label: '证书颁发机构',
model: 'institution_cn',
attrs: { placeholder: '请输入证书颁发机构' }
// rules: [{ required: true, message: '请输入证书颁发机构', trigger: 'blur' }]
}
],
appendItems: [
// 推荐信附件
{
type: 'v-upload',
label: '荣誉证书附件',
model: 'CERTIFICATE_OF_HONOR',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'CERTIFICATE_OF_HONOR' },
accept: 'image/*'
},
class: 'upload-attachments'
}
]
}
}
}
......@@ -2,257 +2,278 @@
* 个人信息
*/
export default {
id: 'application_info_profile',
title: '个人信息',
required: true,
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
const { basic_info: basicInfo = {}, attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
const attachment = attachments.reduce(
(result, item) => {
const types = ['ID_CARD_FRONT', 'ID_CARD_BACK', 'HK_ID_CARD', 'PASSPORT', 'OTHER_ID_CARD_PHOTO']
types.forEach(type => {
if (item.file_type_id === type) {
result[type].push(item)
}
})
import country from './country'
export default function (_this) {
return {
id: 'application_info_profile',
title: '个人信息',
required: true,
visible() {
return _this.visible
},
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { basic_info: basicInfo = {}, attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
const attachment = attachments.reduce(
(result, item) => {
const types = ['ID_CARD_FRONT', 'ID_CARD_BACK', 'HK_ID_CARD', 'PASSPORT', 'OTHER_ID_CARD_PHOTO']
types.forEach(type => {
if (item.file_type_id === type) {
result[type].push(item)
}
})
return result
},
{ ID_CARD_FRONT: [], ID_CARD_BACK: [], HK_ID_CARD: [], PASSPORT: [], OTHER_ID_CARD_PHOTO: [] }
)
basicInfo.id_type = basicInfo.id_type === '护照' ? '中国护照' : basicInfo.id_type
return Object.assign({}, basicInfo, attachment)
}
},
update: {
action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) {
// let [province, city] = data.city.split('-')
// data.address_province = province
// data.address_city = city
const basicInfo = [
'phone_number',
'email',
'id_type',
'id_number',
'real_name_cn',
'real_name_en',
'gender',
'nationality',
'birthday',
'address_province',
'address_city',
'we_chat_account',
'mailing_address',
'emergency_contact_name',
'emergency_contacts_phone'
].reduce((result, key) => {
result[key] = data[key]
return result
}, {})
return { basic_info: basicInfo }
}
},
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_first' } } },
next: { to: { query: { active: 'application_info', tab: 'application_info_education' } }, isSubmit: true },
options: { labelWidth: '140px' },
items: [
{
type: 'v-input',
label: '手机号',
model: 'phone_number',
attrs: { placeholder: '请输入手机号', maxlength: 11 },
rules: [{ required: true, pattern: /^1[3-9]\d{9}$/, message: '请输入手机号', trigger: 'blur' }]
},
{ ID_CARD_FRONT: [], ID_CARD_BACK: [], HK_ID_CARD: [], PASSPORT: [], OTHER_ID_CARD_PHOTO: [] }
)
return Object.assign({}, basicInfo, attachment)
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
// let [province, city] = data.city.split('-')
// data.address_province = province
// data.address_city = city
const basicInfo = [
'phone_number',
'email',
'id_type',
'id_number',
'real_name_cn',
'gender',
'nationality',
'birthday',
'address_province',
'address_city',
'we_chat_account',
'mailing_address',
'emergency_contact_name',
'emergency_contacts_phone'
].reduce((result, key) => {
result[key] = data[key]
return result
}, {})
return { basic_info: basicInfo }
{
type: 'v-input',
label: '邮箱',
model: 'email',
attrs: { placeholder: '请输入邮箱' },
rules: [{ type: 'email', required: true, message: '请输入邮箱', trigger: 'blur' }],
append: '(后续报名信息将发送至此邮箱,请认真填写)'
},
{
type: 'v-select',
values: [{ value: '居民身份证' }, { value: '港澳台身份证' }, { value: '中国护照' }, { value: '其他' }],
label: '证件类型',
model: 'id_type',
attrs: { placeholder: '请选择证件类型' },
rules: [{ required: true, message: '请选择证件类型', trigger: 'change' }]
},
// 身份证照片(背面)
{
type: 'v-upload',
label: '身份证人像面',
model: 'ID_CARD_BACK',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'ID_CARD_BACK' },
limit: 1,
accept: 'image/*',
image: 'https://zws-imgs-pub.ezijing.com/pc/cu/id_card_back.png'
},
rules: [{ type: 'array', required: true, message: '请上传身份证照片人像面', trigger: 'change' }],
isShow(data) {
return data.id_type === '居民身份证'
}
},
// 身份证照片(正面)
{
type: 'v-upload',
label: '身份证国徽面',
model: 'ID_CARD_FRONT',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'ID_CARD_FRONT' },
limit: 1,
accept: 'image/*',
image: 'https://zws-imgs-pub.ezijing.com/pc/cu/id_card_front.png'
},
rules: [{ type: 'array', required: true, message: '请上传身份证照片国徽面', trigger: 'change' }],
isShow(data) {
return data.id_type === '居民身份证'
}
},
// 港澳台身份证
{
type: 'v-upload',
label: '港澳台身份证',
model: 'HK_ID_CARD',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'HK_ID_CARD' },
limit: 1,
accept: 'image/*'
},
rules: [{ type: 'array', required: true, message: '请上传港澳台身份证', trigger: 'change' }],
isShow(data) {
return data.id_type === '港澳台身份证'
}
},
// 中国护照
{
type: 'v-upload',
label: '中国护照',
model: 'PASSPORT',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'PASSPORT' },
limit: 1,
accept: 'image/*'
},
rules: [{ type: 'array', required: true, message: '请上传中国护照', trigger: 'change' }],
isShow(data) {
return data.id_type === '中国护照'
}
},
// 其他证件
{
type: 'v-upload',
label: '其他证件',
model: 'OTHER_ID_CARD_PHOTO',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'OTHER_ID_CARD_PHOTO' },
limit: 1,
accept: 'image/*'
},
rules: [{ type: 'array', required: true, message: '请上传其他证件', trigger: 'change' }],
isShow(data) {
return data.id_type === '其他'
}
},
{
type: 'v-input',
label: '证件号码',
model: 'id_number',
attrs: { placeholder: '请输入证件号码' },
rules: [{ required: true, message: '请输入证件号码', trigger: 'blur' }]
},
{
type: 'v-input',
label: '姓名',
model: 'real_name_cn',
attrs: { placeholder: '请输入姓名' },
rules: [{ required: true, message: '请输入姓名', trigger: 'blur' }]
},
{
type: 'v-input',
label: '英文名',
model: 'real_name_en',
attrs: { placeholder: '请输入英文名' },
rules: [{ required: true, message: '请输入英文名', trigger: 'blur' }]
},
{
type: 'v-radio',
values: [
{ label: '男', value: '男' },
{ label: '女', value: '女' }
],
label: '性别',
model: 'gender',
rules: [{ required: true, message: '请选择性别', trigger: 'change' }]
},
{
type: 'v-select',
label: '国籍',
model: 'nationality',
values: country,
attrs: { placeholder: '请选择国籍', filterable: true },
rules: [{ required: true, message: '请选择国籍', trigger: 'blur' }]
},
{
type: 'v-datepicker',
label: '出生日期',
model: 'birthday',
attrs: { type: 'date', placeholder: '请选择出生日期', valueFormat: 'yyyy-MM-dd' },
rules: [{ required: true, message: '请选择出生日期', trigger: 'blur' }]
},
{
type: 'v-input',
label: '居住省',
model: 'address_province',
attrs: { placeholder: '请输入居住省' },
rules: [{ required: true, message: '请输入居住省', trigger: 'blur' }]
},
{
type: 'v-input',
label: '居住市',
model: 'address_city',
attrs: { placeholder: '请输入居住市' },
rules: [{ required: true, message: '请输入居住市', trigger: 'blur' }]
},
// {
// type: 'city-v-select',
// label: '现居住城市',
// model: 'city',
// separator: '-',
// rules: [{ required: true, message: '请选择居住城市', trigger: 'blur' }]
// },
{
type: 'v-input',
label: '微信号',
model: 'we_chat_account',
attrs: { placeholder: '请输入微信号' },
rules: [{ required: true, message: '请输入微信号', trigger: 'blur' }]
},
{
type: 'v-input',
label: '邮寄地址',
model: 'mailing_address',
attrs: { placeholder: '请输入邮寄地址' },
rules: [{ required: true, message: '请输入邮寄地址', trigger: 'blur' }]
},
{
type: 'v-input',
label: '紧急联系人',
model: 'emergency_contact_name',
attrs: { placeholder: '请输入紧急联系人' },
rules: [{ required: true, message: '请输入紧急联系人', trigger: 'blur' }]
},
{
type: 'v-input',
label: '紧急联系电话',
model: 'emergency_contacts_phone',
attrs: { placeholder: '请输入紧急联系电话' },
rules: [{ required: true, message: '请输入紧急联系电话', trigger: 'blur' }]
}
]
}
},
form: {
options: { labelWidth: '140px' },
items: [
{
type: 'v-input',
label: '手机号',
model: 'phone_number',
attrs: { disabled: true, placeholder: '请输入手机号' },
rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }]
},
{
type: 'v-input',
label: '邮箱',
model: 'email',
attrs: { disabled: true, placeholder: '请输入邮箱' },
rules: [{ required: true, message: '请输入邮箱', trigger: 'blur' }],
hint: '(后续报名信息将发送至此邮箱,请认真填写)'
},
{
type: 'v-select',
values: [{ value: '居民身份证' }, { value: '港澳台身份证' }, { value: '护照' }, { value: '其他' }],
label: '证件类型',
model: 'id_type',
attrs: { disabled: true, placeholder: '请选择证件类型' },
rules: [{ required: true, message: '请选择证件类型', trigger: 'change' }]
},
// // 身份证照片(背面)
// {
// type: 'v-upload',
// label: '身份证人像面',
// model: 'ID_CARD_BACK',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'ID_CARD_BACK' },
// limit: 1,
// image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_back.png'
// },
// rules: [{ type: 'array', required: true, message: '请上传身份证照片人像面', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '居民身份证'
// }
// },
// // 身份证照片(正面)
// {
// type: 'v-upload',
// label: '身份证国徽面',
// model: 'ID_CARD_FRONT',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'ID_CARD_FRONT' },
// limit: 1,
// image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_front.png'
// },
// rules: [{ type: 'array', required: true, message: '请上传身份证照片国徽面', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '居民身份证'
// }
// },
// // 港澳台身份证
// {
// type: 'v-upload',
// label: '港澳台身份证',
// model: 'HK_ID_CARD',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'HK_ID_CARD' },
// limit: 1
// },
// rules: [{ type: 'array', required: true, message: '请上传港澳台身份证', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '港澳台身份证'
// }
// },
// // 护照
// {
// type: 'v-upload',
// label: '护照',
// model: 'PASSPORT',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'PASSPORT' },
// limit: 1
// },
// rules: [{ type: 'array', required: true, message: '请上传护照', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '护照'
// }
// },
// // 其他证件
// {
// type: 'v-upload',
// label: '其他证件',
// model: 'OTHER_ID_CARD_PHOTO',
// attrs: {
// action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
// deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
// data: { file_type: 'OTHER_ID_CARD_PHOTO' },
// limit: 1
// },
// rules: [{ type: 'array', required: true, message: '请上传其他证件', trigger: 'change' }],
// isShow(data) {
// return data.id_type === '其他'
// }
// },
{
type: 'v-input',
label: '证件号码',
model: 'id_number',
attrs: { disabled: true, placeholder: '请输入证件号码' },
rules: [{ required: true, message: '请输入证件号码', trigger: 'blur' }]
},
{
type: 'v-input',
label: '姓名',
model: 'real_name_cn',
attrs: { placeholder: '请输入姓名' },
rules: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
prependSlotName: 'form-name-prepend'
},
{
type: 'v-radio',
values: [
{ label: '男', value: '男' },
{ label: '女', value: '女' }
],
label: '性别',
model: 'gender',
rules: [{ required: true, message: '请选择性别', trigger: 'change' }]
},
{
type: 'v-input',
label: '国籍',
model: 'nationality',
attrs: { placeholder: '请输入国籍' },
rules: [{ required: true, message: '请输入国籍', trigger: 'blur' }]
},
{
type: 'v-datepicker',
label: '出生日期',
model: 'birthday',
attrs: { type: 'date', placeholder: '请选择出生日期', valueFormat: 'yyyy-MM-dd' },
rules: [{ required: true, message: '请选择出生日期', trigger: 'blur' }]
},
{
type: 'v-input',
label: '居住省',
model: 'address_province',
attrs: { placeholder: '请输入居住省' },
rules: [{ required: true, message: '请输入居住省', trigger: 'blur' }]
},
{
type: 'v-input',
label: '居住市',
model: 'address_city',
attrs: { placeholder: '请输入居住市' },
rules: [{ required: true, message: '请输入居住市', trigger: 'blur' }]
},
// {
// type: 'city-v-select',
// label: '现居住城市',
// model: 'city',
// separator: '-',
// rules: [{ required: true, message: '请选择居住城市', trigger: 'blur' }]
// },
{
type: 'v-input',
label: '微信号',
model: 'we_chat_account',
attrs: { placeholder: '请输入微信号' },
rules: [{ required: true, message: '请输入微信号', trigger: 'blur' }]
},
{
type: 'v-input',
label: '邮寄地址',
model: 'mailing_address',
attrs: { placeholder: '请输入邮寄地址' },
rules: [{ required: true, message: '请输入邮寄地址', trigger: 'blur' }]
},
{
type: 'v-input',
label: '紧急联系人',
model: 'emergency_contact_name',
attrs: { placeholder: '请输入紧急联系人' },
rules: [{ required: true, message: '请输入紧急联系人', trigger: 'blur' }]
},
{
type: 'v-input',
label: '紧急联系电话',
model: 'emergency_contacts_phone',
attrs: { placeholder: '请输入紧急联系电话' },
rules: [{ required: true, message: '请输入紧急联系电话', trigger: 'blur' }]
}
]
}
}
......@@ -2,73 +2,76 @@
* 所受培训
*/
export default {
id: 'application_info_training',
title: '所受培训',
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.trainings || []
list = list.map(item => {
const { start_date: startDate, end_date: endDate } = item
if (startDate) {
item.dates = [startDate, endDate]
}
return item
})
return list.length ? list : [{}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
const trainings = data.map(item => {
const [startDate, endDate] = item.dates
item.start_date = startDate
item.end_date = endDate
return ['start_date', 'end_date', 'institution_cn', 'course_cn'].reduce((result, key) => {
result[key] = item[key]
return result
}, {})
})
return { trainings }
}
},
form: {
hasAdd: true,
options: {
labelWidth: '140px'
export default function (_this) {
return {
id: 'application_info_training',
title: '所受培训',
visible() {
return _this.visible
},
items: [
{
type: 'v-datepicker',
label: '培训时间',
model: 'dates',
attrs: {
type: 'monthrange',
rangeSeparator: '至',
startPlaceholder: '请选择开始时间',
endPlaceholder: '请选择结束时间',
valueFormat: 'yyyy-MM'
},
rules: [{ required: true, message: '请选择培训时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '培训机构',
model: 'institution_cn',
rules: [{ required: true, message: '请输入培训机构', trigger: 'blur' }]
},
{
type: 'v-input',
label: '课程名称',
model: 'course_cn',
rules: [{ required: true, message: '请输入课程名称', trigger: 'blur' }]
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { trainings: list = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
return list.length ? list : [{}]
}
},
update: {
action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) {
const trainings = data.map(item => {
return ['start_date', 'end_date', 'institution_cn', 'course_cn'].reduce((result, key) => {
result[key] = item[key] || ''
return result
}, {})
})
return { trainings }
}
]
},
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_answer' } }, isSubmit: true },
next: { to: { query: { active: 'application_info', tab: 'application_info_honor' } }, isSubmit: true },
hasAdd: true,
options: { labelWidth: '140px' },
items: [
{
type: 'v-datepicker',
label: '开始时间',
model: 'start_date',
attrs: {
type: 'month',
placeholder: '请选择培训开始时间',
valueFormat: 'yyyy-MM'
}
// rules: [{ required: true, message: '请选择培训开始时间', trigger: 'blur' }]
},
{
type: 'v-datepicker',
label: '结束时间',
model: 'end_date',
attrs: {
type: 'month',
placeholder: '请选择培训结束时间',
valueFormat: 'yyyy-MM'
}
// rules: [{ required: true, message: '请选择培训结束时间', trigger: 'blur' }]
},
{
type: 'v-input',
label: '培训机构',
model: 'institution_cn',
attrs: { placeholder: '请输入培训机构' }
// rules: [{ required: true, message: '请输入培训机构', trigger: 'blur' }]
},
{
type: 'v-input',
label: '课程名称',
model: 'course_cn',
attrs: { placeholder: '请输入课程名称' }
// rules: [{ required: true, message: '请输入课程名称', trigger: 'blur' }]
}
]
}
}
}
import { STAGE_LIST } from '../../index'
/**
* 推荐信
*/
export default {
id: 'application_tjx',
title: '推荐信',
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
// this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
let list = data.data.material.reco_letters || []
return list.length ? list : [{}, {}, {}]
}
},
update: {
action: '/api/enrollment/v1.0/application-materials/1005/put',
beforeRequest(data) {
// const recoLetters = data.map(item => {
// return ['provider_name', 'provider_phone_number', 'provider_email', 'provider_relationship'].reduce(
// (result, key) => {
// result[key] = item[key]
// return result
// },
// {}
// )
// })
return { reco_letters: data }
}
},
form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_honor' } } },
next: { to: { query: { active: 'application_wfzzm' } } },
hasAdd: true,
minLength: 3,
disabled(data) {
return !!data.letter_content
export default function (_this) {
return {
id: 'application_tjx',
title: '推荐信',
visible() {
return _this.visible
},
aside: {
prepend: {
html: '<p style="color:#33C011;">推荐人已完成</p>',
visible(data) {
return !!data.letter_content
}
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = STAGE_LIST.findIndex(item => item === submissionStage) > 3
const list = data.data.material.reco_letters || []
return list.length ? list : [{}, {}]
}
},
update: {
action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) {
return { reco_letters: data }
}
},
form: {
minlength: 2,
prev: { to: { query: { active: 'application_info', tab: 'application_info_honor' } }, isSubmit: true },
next: { to: { query: { active: 'application_wfzzm' } }, isSubmit: true },
hasAdd: true,
disabled(data) {
return !!data.letter_content
},
buttons: [
{
text: '再次邀请',
aside: {
prepend: {
html: '<p style="color:#33C011;">推荐人已完成</p>',
visible(data) {
return data.id && !data.letter_content
},
onClick(data) {
console.log(data, this)
return !!data.letter_content
}
},
{
text: '更换推荐人',
visible(data) {
return data.id && !data.letter_content
buttons: [
{
text: '再次邀请',
visible(data) {
const editable = ['PREPAYMENT', 'INTERVIEW_APPLICATION', 'AUDITION'].includes(_this.detail.material.submission_stage)
return data.id && !data.letter_content && editable
},
onClick(data) {
_this.sendToProvider(data)
}
},
onClick(data) {
console.log(data, this)
{
text: '更换推荐人',
visible(data) {
const editable = ['PREPAYMENT', 'INTERVIEW_APPLICATION', 'AUDITION'].includes(_this.detail.material.submission_stage)
return data.id && !data.letter_content && editable
},
onClick(data, $form) {
$form.validate().then(() => {
_this.changeProvider(data)
})
}
}
}
]
},
options: {
labelWidth: '140px'
},
items: [
{
type: 'v-input',
label: '推荐人姓名',
model: 'provider_name',
attrs: { placeholder: '请输入推荐人姓名' },
rules: [{ required: true, message: '请输入推荐人姓名', trigger: 'blur' }]
]
},
options: { labelWidth: '140px' },
items: [
{
type: 'v-input',
label: '推荐人姓名',
model: 'provider_name',
attrs: { placeholder: '请输入推荐人姓名' },
rules: [{ required: true, message: '请输入推荐人姓名', trigger: 'blur' }]
},
{
type: 'v-input',
label: '推荐人电话',
model: 'provider_phone_number',
attrs: { placeholder: '请输入推荐人电话' },
rules: [{ required: true, message: '请输入推荐人电话', trigger: 'blur' }]
},
{
type: 'v-input',
label: '推荐人邮箱',
model: 'provider_email',
attrs: { placeholder: '请输入推荐人邮箱' },
rules: [{ required: true, message: '请输入推荐人邮箱', trigger: 'blur' }]
},
{
type: 'v-select',
values: [
{ value: '老师/导师' },
{ value: '领导' },
{ value: '同学' },
{ value: '同事' },
{ value: '亲属' },
{ value: '朋友' },
{ value: '其他' }
],
label: '与推荐人关系',
model: 'provider_relationship',
rules: [{ required: true, message: '请选择与推荐人关系', trigger: 'change' }]
}
]
{
type: 'v-input',
label: '推荐人电话',
model: 'provider_phone_number',
attrs: { placeholder: '请输入推荐人电话', maxlength: 11 },
rules: [{ required: true, pattern: /^1[3-9]\d{9}$/, message: '请输入推荐人电话', trigger: 'blur' }]
},
{
type: 'v-input',
label: '推荐人邮箱',
model: 'provider_email',
attrs: { placeholder: '请输入推荐人邮箱' },
rules: [{ type: 'email', required: true, message: '请输入推荐人邮箱', trigger: 'blur' }]
},
{
type: 'v-select',
values: [{ value: '老师/导师' }, { value: '领导' }, { value: '同学' }, { value: '同事' }, { value: '亲属' }, { value: '朋友' }, { value: '其他' }],
label: '与推荐人关系',
model: 'provider_relationship',
rules: [{ required: true, message: '请选择与推荐人关系', trigger: 'change' }]
}
]
}
}
}
export default {
id: 'application_wfzzm',
title: '无犯罪证明',
visible() {
return this.tabActive !== 'application_info_first'
},
get: {
action: '/api/enrollment/v1.0/application-materials/1005',
callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED'
const { attachments = [] } = data.data.material
const NO_CRIMINAL_CERT = attachments.filter(item => {
return item.file_type_id === 'NO_CRIMINAL_CERT'
})
return { NO_CRIMINAL_CERT }
}
},
form: {
prev: { to: { query: { active: 'application_tjx' } } },
next: { to: { query: { active: 'application_declare' } } },
hasSubmit: false,
options: {},
items: [
{
type: 'v-upload',
required: true,
model: 'NO_CRIMINAL_CERT',
attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put',
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete',
data: { file_type: 'NO_CRIMINAL_CERT' },
limit: 1
},
prepend: `
export default function (_this) {
return {
id: 'application_wfzzm',
title: '无犯罪证明',
visible() {
return _this.visible
},
get: {
action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) {
const { attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING'
const NO_CRIMINAL_CERT = attachments.filter(item => {
return item.file_type_id === 'NO_CRIMINAL_CERT'
})
return { NO_CRIMINAL_CERT }
}
},
form: {
prev: { to: { query: { active: 'application_tjx' } } },
next: { to: { query: { active: 'application_declare' } } },
hasSubmit: false,
options: {},
items: [
{
type: 'v-upload',
required: true,
model: 'NO_CRIMINAL_CERT',
attrs: {
action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'NO_CRIMINAL_CERT' },
limit: 1
},
prepend: `
<p>第一步:点击下载按键获取无犯罪证明模板</p>
<p><a href="https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/%E6%97%A0%E7%8A%AF%E7%BD%AA%E8%AE%B0%E5%BD%95%E8%AF%81%E6%98%8E.docx" target="_blank" download>下载模板</a></p>
<p><a href="https://zws-imgs-pub.ezijing.com/pc/cu/%E6%97%A0%E7%8A%AF%E7%BD%AA%E8%AE%B0%E5%BD%95%E8%AF%81%E6%98%8E.docx" target="_blank" download>下载模板</a></p>
<p>第二步:打印文件后填写内容并签字上传至电脑,点击下方按钮上传文件</p>
`
}
]
}
]
}
}
}
......@@ -27,14 +27,15 @@
<script>
import AppLayout from '../layout.vue'
import menus from './form'
import getMenus from './form'
// import AppPay from './pay.vue'
// import AppPreview from '../preview.vue'
export default {
components: { AppLayout },
data() {
const menus = getMenus(this)
return {
visible: false,
visible: true,
menus: [menus],
currentActive: 'application_info',
tabActive: 'application_info_profile',
......
{
"name": "@ezijing/vue-form",
"version": "2.4.1",
"version": "2.5.29",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@ezijing/vue-form",
"version": "2.4.1",
"version": "2.5.29",
"dependencies": {
"axios": "^1.6.7",
"element-ui": "^2.15.14",
"element-ui": "2.15.14",
"vue": "^2.7.16"
},
"devDependencies": {
......@@ -1285,9 +1285,8 @@
},
"node_modules/element-ui": {
"version": "2.15.14",
"resolved": "https://registry.npmmirror.com/element-ui/-/element-ui-2.15.14.tgz",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.14.tgz",
"integrity": "sha512-2v9fHL0ZGINotOlRIAJD5YuVB8V7WKxrE9Qy7dXhRipa035+kF7WuU/z+tEmLVPBcJ0zt8mOu1DKpWcVzBK8IA==",
"license": "MIT",
"dependencies": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
......
{
"name": "@ezijing/vue-form",
"version": "2.5.16",
"version": "2.5.31",
"private": false,
"description": "基于Vue Element-UI的表单",
"type": "module",
......
......@@ -9,28 +9,30 @@
</div>
<div class="v-layout-main" :key="menuActiveId">
<slot>
<!-- 选项卡 -->
<VCardFormTabs
v-model="tabActiveId"
:tabs="tabPages"
@change="handleTabChange"
@prev="handleStepChange"
@next="handleStepChange"
v-on="$listeners"
v-if="tabPages.length">
<!-- slot -->
<template v-slot:[slotName]="slotProps" v-for="slotName in slotNames">
<slot :name="slotName" v-bind="slotProps"></slot>
</template>
</VCardFormTabs>
<template v-if="page">
<!-- 选项卡 -->
<VCardFormTabs
v-model="tabActiveId"
:tabs="tabPages"
@change="handleTabChange"
@prev="handleStepChange"
@next="handleStepChange"
v-on="$listeners"
v-if="tabPages.length">
<!-- slot -->
<template v-slot:[slotName]="slotProps" v-for="slotName in slotNames">
<slot :name="slotName" v-bind="slotProps"></slot>
</template>
</VCardFormTabs>
<VCardForm :page="page" @prev="handleStepChange" @next="handleStepChange" v-on="$listeners" v-else>
<slot name="content"></slot>
<!-- slot -->
<template v-slot:[slotName]="slotProps" v-for="slotName in slotNames">
<slot :name="slotName" v-bind="slotProps"></slot>
</template>
</VCardForm>
<VCardForm :page="page" @prev="handleStepChange" @next="handleStepChange" v-on="$listeners" v-else>
<slot name="content"></slot>
<!-- slot -->
<template v-slot:[slotName]="slotProps" v-for="slotName in slotNames">
<slot :name="slotName" v-bind="slotProps"></slot>
</template>
</VCardForm>
</template>
</slot>
</div>
</div>
......@@ -75,7 +77,7 @@ export default {
return [...result, item]
}, [])
return pages.map((item, index, arr) => {
return { ...item, prev: arr[index - 1]?.id, next: arr[index + 1]?.id }
return { ...item, prev: item.prev || arr[index - 1]?.id, next: item.next || arr[index + 1]?.id }
})
},
tabPages() {
......@@ -113,29 +115,35 @@ export default {
},
methods: {
filterVisible(data) {
return data.filter(item => {
return data.reduce((acc, item) => {
// 检查当前项的visible属性是否为函数,若是则调用函数获取结果
const isVisible = typeof item.visible === 'function' ? item.visible() : item.visible === undefined ? true : item.visible
if (!isVisible) {
return false // 若当前项不可见,则过滤掉
}
// 如果当前项有children属性,则递归过滤children
if (item.children) {
item.children = this.filterVisible(item.children)
}
// 如果当前项有tabs属性,则递归过滤tabs
if (item.tabs) {
item.tabs = this.filterVisible(item.tabs)
const isVisible = typeof item.visible === 'function' ? item.visible.call(this) : item.visible === undefined ? true : item.visible
if (isVisible) {
const newItem = { ...item }
// 如果当前项有children属性,则递归过滤children
if (item.children) {
newItem.children = this.filterVisible(item.children)
}
// 如果当前项有tabs属性,则递归过滤tabs
if (item.tabs) {
newItem.tabs = this.filterVisible(item.tabs)
}
acc.push(newItem) // 将符合条件的项添加到新数组中
}
return true // 当前项可见,保留
})
return acc
}, [])
},
// 上一步\下一步
handleStepChange(id) {
const nextPage = this.pages.find(item => item.id === id)
if (nextPage.isTab) {
if (this.menuActiveId !== nextPage.parentId) this.handleMenuChange(nextPage.parentId)
this.handleTabChange(id)
if (this.menuActiveId !== nextPage.parentId) this.handleMenuChange(nextPage.parentId)
} else {
this.handleMenuChange(id)
}
......
......@@ -56,8 +56,8 @@ export default {
}
},
methods: {
handleTabClick() {
this.$emit('change', this.value)
handleTabClick(e) {
this.$emit('change', e.name)
}
}
}
......
......@@ -53,11 +53,11 @@
</template>
<div class="v-form-pane__append" v-html="form.append" v-if="form.append"></div>
<div class="v-form-footer" v-if="form.hasButton">
<el-button size="medium" @click="handlePrev" v-if="page.prev">{{ options.prevText }}</el-button>
<el-button type="primary" size="medium" :disabled="form.options.disabled" @click="handleSubmit" style="min-width: 120px" v-if="form.hasSubmit">
<el-button size="medium" @click="onPrev" v-if="page.prev">{{ options.prevText }}</el-button>
<el-button type="primary" size="medium" :disabled="form.options.disabled" @click.native="onSubmit" style="min-width: 120px" v-if="form.hasSubmit">
{{ submitButtonText }}
</el-button>
<el-button size="medium" @click="handleNext" v-if="page.next">{{ options.nextText }}</el-button>
<el-button size="medium" @click="onNext" v-if="page.next">{{ options.nextText }}</el-button>
</div>
</div>
</template>
......@@ -91,7 +91,7 @@ export default {
},
data() {
return {
model: undefined,
model: {},
form: {}
}
},
......@@ -130,13 +130,15 @@ export default {
immediate: true,
handler() {
const { form } = this.page
this.model = form.model || (form.hasAdd ? [Object.assign({}, form.defaultModel)] : {})
const formOptions = Object.assign({ disabled: this.options.disabled }, form.options)
this.form = Object.assign({ minlength: 1, hasSubmit: true, hasButton: true }, form, { options: formOptions })
this.getData()
}
}
},
beforeMount() {
this.model = this.form.model || (this.form.hasAdd ? [Object.assign({}, this.form.defaultModel)] : {})
this.getData()
},
methods: {
// 获取
async getData() {
......@@ -195,22 +197,29 @@ export default {
}
this.model.splice(index, 1)
},
onSubmit() {
this.handleSubmit()
},
onPrev() {
this.handlePrev()
},
onNext() {
this.handleNext()
},
// 提交
async handleSubmit() {
if (this.form.options.disabled) return
const form = this.$refs.form
const formComponents = Array.isArray(form) ? form : [form]
const allPromise = formComponents.map(form => form.$form.validate())
try {
await Promise.all(allPromise)
await Promise.all(allPromise).then(() => {
if (this.page.onUpdate) {
return await this.page.onUpdate(this.update.beforeRequest(this.model))
return this.page.onUpdate(this.update.beforeRequest(this.model))
} else {
return await this.updateData()
return this.updateData()
}
} catch (error) {
console.log(error)
}
})
return false
},
// 上一步
async handlePrev() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论