提交 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 @@ ...@@ -2,26 +2,57 @@
* 申请声明 * 申请声明
*/ */
export default { export default function (_this) {
return {
id: 'application_declare', id: 'application_declare',
title: '申请声明', title: '申请声明',
visible() { visible() {
return false 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: { update: {
action: '/api/enrollment/v1.0/application-materials/submit/1005' 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: { form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_honor' } } },
submitText: '提交报名申请',
model: { isAgree: [] }, model: { isAgree: [] },
options: {},
items: [ items: [
{ {
type: 'v-checkbox', type: 'v-checkbox',
values: [{ label: '同意', value: 1 }], values: [{ label: '同意', value: 1 }],
model: 'isAgree', model: 'isAgree',
rules: [{ required: true, message: '请阅读协议', trigger: 'change' }], rules: [{ required: true, message: '请阅读协议', trigger: 'change' }],
prepend: prepend: `<p>1、本人知晓此申请表及所附文件将作为申请雪城大学硕士面试和背景评估的参考依据,一旦成功录取,有关资料将作为学生信息存档。</p>
'<p>我提供的所有报名材料信息皆准确和完整。我同意在需要的情况下提交原件以确认我的报名资格。由于报名材料中的虚假、错误信息或重大遗漏导致不录取或取消学籍的后果由我个人承担。 我理解并同意所有报名材料归紫荆教育所有,无论考生录取与否均不退回。我授权紫荆教育使用报名表中的信息查询本人学习和工作记录。</p>' <p>2、本人声明所填资料正确无误,知晓任何不真实的信息或不诚信的行为,均会影响申请结果,已取得的成绩和资格会被取消。我理解并同意所有报名材料归紫荆教育所有,无论考生录取与否均不退回。我授权紫荆教育使用报名表中的信息查询本人学习和工作记录。</p>`
} }
] ]
} }
}
} }
import info from './info' import info from './info'
import tjx from './tjx' // import tjx from './tjx'
import wfzsm from './wfzzm' // import wfzsm from './wfzzm'
import declare from './declare' import declare from './declare'
export default { export default function(_this) {
return {
id: 'application', id: 'application',
title: '报名申请', title: '报名申请',
children: [ children: [
info, info(_this),
tjx, // tjx(_this),
wfzsm, // wfzsm(_this),
declare, declare(_this),
{ {
id: 'application_pay', id: 'application_pay',
title: '缴报名费', title: '缴报名费',
show: false,
visible() { visible() {
return this.tabActive !== 'application_info_first' return _this.visible && _this.hasPay
}, }
} }
] ]
}
} }
...@@ -6,8 +6,10 @@ import honor from './info/honor' ...@@ -6,8 +6,10 @@ import honor from './info/honor'
import training from './info/training' import training from './info/training'
import answer from './info/answer' import answer from './info/answer'
export default { export default function(_this) {
return {
id: 'application_info', id: 'application_info',
title: '个人资料', title: '个人资料',
tabs: [first, profile, education, career, answer, training, honor] tabs: [first(_this), profile(_this), education(_this), career(_this), answer(_this), training(_this), honor(_this)]
}
} }
...@@ -2,31 +2,33 @@ ...@@ -2,31 +2,33 @@
* 学习目的 * 学习目的
*/ */
export default { export default function (_this) {
return {
id: 'application_info_answer', id: 'application_info_answer',
title: '学习目的', title: '学习目的',
required: true, required: true,
visible() { visible() {
return this.tabActive !== 'application_info_first' return _this.visible
}, },
get: { get: {
action: '/api/enrollment/v1.0/application-materials/1005', action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) { callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED' const { answers = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
const { answers = [] } = data.data.material this.form.options.disabled = submissionStage !== 'FILLING'
const [first = {}, second = {}] = answers const [first = {}, second = {}] = answers
return { return {
qid1: first.qid || '1', qid1: first.qid || '1',
question1: first.question || '个人描述(60-1000字)中文或者英文', question1: '您为什么要申请雪城大学硕士保研项目?',
answer1: first.answer, answer1: first.answer,
qid2: second.qid || '2', qid2: second.qid || '2',
question2: second.question || '申请紫荆教育康博斯威尔大学教育硕士的原因?以及您的职业或个人发展的预期目标(60-1000字)中文或者英文', question2: '您的短期和长期职业发展目标是什么?您打算如何达成此愿景?',
answer2: second.answer answer2: second.answer
} }
} }
}, },
update: { update: {
action: '/api/enrollment/v1.0/application-materials/1005/put', action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) { beforeRequest(data) {
return { return {
answers: [ answers: [
...@@ -37,28 +39,31 @@ export default { ...@@ -37,28 +39,31 @@ export default {
} }
}, },
form: { 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: {}, options: {},
items: [ items: [
{ {
type: 'v-input', type: 'v-input',
label: '个人描述(60-1000字)中文或者英文', label: '您为什么要申请雪城大学硕士保研项目?(60字以上,1000字以内)',
model: 'answer1', model: 'answer1',
attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' }, attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' },
rules: [ rules: [
{ required: true, message: '请输入', trigger: 'blur' }, { required: true, message: '请输入', trigger: 'blur' },
{ min: 200, max: 1000, message: '长度在 200 到 1000 个字符', trigger: 'blur' } { min: 60, max: 1000, message: '长度在 60 到 1000 个字符', trigger: 'blur' }
] ]
}, },
{ {
type: 'v-input', type: 'v-input',
label: '申请紫荆教育康博斯威尔大学教育硕士的原因?以及您的职业或个人发展的预期目标(60-1000字)中文或者英文', label: '您的短期和长期职业发展目标是什么?您打算如何达成此愿景?(60字以上,1000字以内)',
model: 'answer2', model: 'answer2',
attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' }, attrs: { type: 'textarea', rows: '8', maxlength: '1000', style: 'width:100%' },
rules: [ rules: [
{ required: true, message: '请输入', trigger: 'blur' }, { required: true, message: '请输入', trigger: 'blur' },
{ min: 200, max: 1000, message: '长度在 200 到 1000 个字符', trigger: 'blur' } { min: 60, max: 1000, message: '长度在 60 到 1000 个字符', trigger: 'blur' }
] ]
} }
] ]
} }
}
} }
差异被折叠。
...@@ -2,72 +2,99 @@ ...@@ -2,72 +2,99 @@
* 教育背景 * 教育背景
*/ */
export default { export default function (_this) {
return {
id: 'application_info_education', id: 'application_info_education',
title: '教育背景', title: '教育背景',
required: true, required: true,
visible() { visible() {
return this.tabActive !== 'application_info_first' return _this.visible
}, },
get: { get: {
action: '/api/enrollment/v1.0/application-materials/1005', action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) { callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED' const { basic_info: basicInfo = {}, educations: list = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
let list = data.data.material.educations || [] this.form.options.disabled = submissionStage !== 'FILLING'
list = list.map(item => { if (list.length > 0) {
const { start_date: startDate, end_date: endDate } = item list[0].education_status = basicInfo.education_status
if (startDate) {
item.dates = [startDate, endDate]
} }
return item
})
return list.length ? list : [{}] return list.length ? list : [{}]
} }
}, },
update: { update: {
action: '/api/enrollment/v1.0/application-materials/1005/put', action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) { beforeRequest(data) {
const educations = data.map(item => { const educations = data.map(item => {
const [startDate, endDate] = item.dates return ['start_date', 'end_date', 'school_type', 'school_name_cn', 'major_cn', 'degree'].reduce((result, key) => {
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] result[key] = item[key]
return result return result
}, {}) }, {})
}) })
return { educations } const basicInfo = { education_status: data[0].education_status }
return { basic_info: basicInfo, educations }
},
callback() {
_this.getApplication()
} }
}, },
form: { 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, hasAdd: true,
options: { options: { labelWidth: '140px' },
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: [ items: [
{ {
type: 'v-datepicker', type: 'v-datepicker',
label: '教育时间', label: '开始时间',
model: 'dates', model: 'start_date',
attrs: { attrs: {
type: 'monthrange', type: 'month',
rangeSeparator: '至', placeholder: '请选择教育开始时间',
startPlaceholder: '请选择开始时间',
endPlaceholder: '请选择结束时间',
valueFormat: 'yyyy-MM' valueFormat: 'yyyy-MM'
}, },
rules: [{ required: true, message: '请选择教育时间', trigger: 'blur' }] 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', type: 'v-input',
label: '学校名称', label: '学校名称',
model: 'school_name_cn', model: 'school_name_cn',
attrs: { placeholder: '请输入学校名称' },
rules: [{ required: true, message: '请输入学校名称', trigger: 'blur' }] rules: [{ required: true, message: '请输入学校名称', trigger: 'blur' }]
}, },
{ {
type: 'v-input', type: 'v-input',
label: '专业名称', label: '专业名称',
model: 'major_cn', model: 'major_cn',
attrs: { placeholder: '请输入专业名称' },
rules: [{ required: true, message: '请输入专业名称', trigger: 'blur' }] rules: [{ required: true, message: '请输入专业名称', trigger: 'blur' }]
}, },
{ {
...@@ -88,4 +115,5 @@ export default { ...@@ -88,4 +115,5 @@ export default {
} }
] ]
} }
}
} }
...@@ -2,18 +2,20 @@ ...@@ -2,18 +2,20 @@
* 个人信息 * 个人信息
*/ */
export default { export default function (_this) {
return {
id: 'application_info_first', id: 'application_info_first',
title: '个人信息', title: '个人信息',
required: true, required: true,
visible() { // visible() {
return this.tabActive === 'application_info_first' // return this.tabActive === 'application_info_first'
}, // },
get: { get: {
action: '/api/enrollment/v1.0/application-materials/1005', action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) { callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED' const { basic_info: basicInfo = {}, attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
const { basic_info: basicInfo = {}, attachments = [] } = data.data.material this.form.options.disabled = submissionStage !== 'FILLING'
const attachment = attachments.reduce( const attachment = attachments.reduce(
(result, item) => { (result, item) => {
const types = ['ID_CARD_FRONT', 'ID_CARD_BACK', 'HK_ID_CARD', 'PASSPORT', 'OTHER_ID_CARD_PHOTO'] const types = ['ID_CARD_FRONT', 'ID_CARD_BACK', 'HK_ID_CARD', 'PASSPORT', 'OTHER_ID_CARD_PHOTO']
...@@ -26,11 +28,12 @@ export default { ...@@ -26,11 +28,12 @@ export default {
}, },
{ ID_CARD_FRONT: [], ID_CARD_BACK: [], HK_ID_CARD: [], PASSPORT: [], OTHER_ID_CARD_PHOTO: [] } { 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) return Object.assign({}, basicInfo, attachment)
} }
}, },
update: { update: {
action: '/api/enrollment/v1.0/application-materials/1005/put', action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) { beforeRequest(data) {
const basicInfo = ['phone_number', 'email', 'id_type'].reduce((result, key) => { const basicInfo = ['phone_number', 'email', 'id_type'].reduce((result, key) => {
result[key] = data[key] result[key] = data[key]
...@@ -40,26 +43,27 @@ export default { ...@@ -40,26 +43,27 @@ export default {
} }
}, },
form: { form: {
hasButton: false, submitText: '下一步',
next: { to: { query: { active: 'application_info', tab: 'application_info_profile' } }, isSubmit: true },
options: { labelWidth: '140px' }, options: { labelWidth: '140px' },
items: [ items: [
{ {
type: 'v-input', type: 'v-input',
label: '手机号', label: '手机号',
model: 'phone_number', model: 'phone_number',
attrs: { placeholder: '请输入手机号' }, attrs: { placeholder: '请输入手机号', maxlength: 11 },
rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }] rules: [{ required: true, pattern: /^1[3-9]\d{9}$/, message: '请输入手机号', trigger: 'blur' }]
}, },
{ {
type: 'v-input', type: 'v-input',
label: '邮箱', label: '邮箱',
model: 'email', model: 'email',
attrs: { placeholder: '请输入邮箱' }, attrs: { placeholder: '请输入邮箱' },
rules: [{ required: true, message: '请输入邮箱', trigger: 'blur' }] rules: [{ type: 'email', required: true, message: '请输入邮箱', trigger: 'blur' }]
}, },
{ {
type: 'v-select', type: 'v-select',
values: [{ value: '居民身份证' }, { value: '港澳台身份证' }, { value: '护照' }, { value: '其他' }], values: [{ value: '居民身份证' }, { value: '港澳台身份证' }, { value: '中国护照' }, { value: '其他' }],
label: '证件类型', label: '证件类型',
model: 'id_type', model: 'id_type',
attrs: { placeholder: '请选择证件类型' }, attrs: { placeholder: '请选择证件类型' },
...@@ -71,11 +75,12 @@ export default { ...@@ -71,11 +75,12 @@ export default {
label: '身份证人像面', label: '身份证人像面',
model: 'ID_CARD_BACK', model: 'ID_CARD_BACK',
attrs: { attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put', action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete', deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'ID_CARD_BACK' }, data: { file_type: 'ID_CARD_BACK' },
limit: 1, limit: 1,
image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_back.png' accept: 'image/*',
image: 'https://zws-imgs-pub.ezijing.com/pc/cu/id_card_back.png'
}, },
rules: [{ type: 'array', required: true, message: '请上传身份证照片人像面', trigger: 'change' }], rules: [{ type: 'array', required: true, message: '请上传身份证照片人像面', trigger: 'change' }],
isShow(data) { isShow(data) {
...@@ -88,11 +93,12 @@ export default { ...@@ -88,11 +93,12 @@ export default {
label: '身份证国徽面', label: '身份证国徽面',
model: 'ID_CARD_FRONT', model: 'ID_CARD_FRONT',
attrs: { attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put', action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete', deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'ID_CARD_FRONT' }, data: { file_type: 'ID_CARD_FRONT' },
limit: 1, limit: 1,
image: 'https://zws-imgs-pub.oss-cn-beijing.aliyuncs.com/pc/cu/id_card_front.png' accept: 'image/*',
image: 'https://zws-imgs-pub.ezijing.com/pc/cu/id_card_front.png'
}, },
rules: [{ type: 'array', required: true, message: '请上传身份证照片国徽面', trigger: 'change' }], rules: [{ type: 'array', required: true, message: '请上传身份证照片国徽面', trigger: 'change' }],
isShow(data) { isShow(data) {
...@@ -105,30 +111,32 @@ export default { ...@@ -105,30 +111,32 @@ export default {
label: '港澳台身份证', label: '港澳台身份证',
model: 'HK_ID_CARD', model: 'HK_ID_CARD',
attrs: { attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put', action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete', deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'HK_ID_CARD' }, data: { file_type: 'HK_ID_CARD' },
limit: 1 limit: 1,
accept: 'image/*'
}, },
rules: [{ type: 'array', required: true, message: '请上传港澳台身份证', trigger: 'change' }], rules: [{ type: 'array', required: true, message: '请上传港澳台身份证', trigger: 'change' }],
isShow(data) { isShow(data) {
return data.id_type === '港澳台身份证' return data.id_type === '港澳台身份证'
} }
}, },
// 护照 // 中国护照
{ {
type: 'v-upload', type: 'v-upload',
label: '护照', label: '中国护照',
model: 'PASSPORT', model: 'PASSPORT',
attrs: { attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put', action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete', deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'PASSPORT' }, data: { file_type: 'PASSPORT' },
limit: 1 limit: 1,
accept: 'image/*'
}, },
rules: [{ type: 'array', required: true, message: '请上传护照', trigger: 'change' }], rules: [{ type: 'array', required: true, message: '请上传中国护照', trigger: 'change' }],
isShow(data) { isShow(data) {
return data.id_type === '护照' return data.id_type === '中国护照'
} }
}, },
// 其他证件 // 其他证件
...@@ -137,10 +145,11 @@ export default { ...@@ -137,10 +145,11 @@ export default {
label: '其他证件', label: '其他证件',
model: 'OTHER_ID_CARD_PHOTO', model: 'OTHER_ID_CARD_PHOTO',
attrs: { attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put', action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete', deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'OTHER_ID_CARD_PHOTO' }, data: { file_type: 'OTHER_ID_CARD_PHOTO' },
limit: 1 limit: 1,
accept: 'image/*'
}, },
rules: [{ type: 'array', required: true, message: '请上传其他证件', trigger: 'change' }], rules: [{ type: 'array', required: true, message: '请上传其他证件', trigger: 'change' }],
isShow(data) { isShow(data) {
...@@ -149,4 +158,5 @@ export default { ...@@ -149,4 +158,5 @@ export default {
} }
] ]
} }
}
} }
...@@ -2,26 +2,30 @@ ...@@ -2,26 +2,30 @@
* 荣誉奖励 * 荣誉奖励
*/ */
export default { export default function (_this) {
return {
id: 'application_info_honor', id: 'application_info_honor',
title: '荣誉奖励', title: '荣誉奖励',
visible() { visible() {
return this.tabActive !== 'application_info_first' return _this.visible
}, },
get: { get: {
action: '/api/enrollment/v1.0/application-materials/1005', action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) { callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED' const { attachments = [], honors: list = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
let list = data.data.material.honors || [] this.form.options.disabled = submissionStage !== 'FILLING'
return list.length ? list : [{}] 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 }]
} }
}, },
update: { update: {
action: '/api/enrollment/v1.0/application-materials/1005/put', action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) { beforeRequest(data) {
const honors = data.map(item => { const honors = data.map(item => {
return ['time', 'title', 'institution_cn'].reduce((result, key) => { return ['time', 'title', 'institution_cn'].reduce((result, key) => {
result[key] = item[key] result[key] = item[key] || ''
return result return result
}, {}) }, {})
}) })
...@@ -29,31 +33,48 @@ export default { ...@@ -29,31 +33,48 @@ export default {
} }
}, },
form: { form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_training' } }, isSubmit: true },
next: { to: { query: { active: 'application_declare' } }, isSubmit: true },
hasAdd: true, hasAdd: true,
options: { options: { labelWidth: '140px' },
labelWidth: '140px'
},
items: [ items: [
{ {
type: 'v-datepicker', type: 'v-datepicker',
label: '获取时间', label: '获取时间',
model: 'time', model: 'time',
attrs: { type: 'date', valueFormat: 'yyyy-MM-dd', placeholder: '请选择获取时间' }, attrs: { type: 'date', valueFormat: 'yyyy-MM-dd', placeholder: '请选择获取时间' }
rules: [{ required: true, message: '请选择获取时间', trigger: 'blur' }] // rules: [{ required: true, message: '请选择获取时间', trigger: 'blur' }]
}, },
{ {
type: 'v-input', type: 'v-input',
label: '荣誉奖励', label: '荣誉奖励',
model: 'title', model: 'title',
attrs: { placeholder: '请输入荣誉奖励' }, attrs: { placeholder: '请输入荣誉奖励' }
rules: [{ required: true, message: '请输入荣誉奖励', trigger: 'blur' }] // rules: [{ required: true, message: '请输入荣誉奖励', trigger: 'blur' }]
}, },
{ {
type: 'v-input', type: 'v-input',
label: '证书颁发机构', label: '证书颁发机构',
model: 'institution_cn', model: 'institution_cn',
rules: [{ required: true, message: '请输入证书颁发机构', trigger: 'blur' }] 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,36 +2,27 @@ ...@@ -2,36 +2,27 @@
* 所受培训 * 所受培训
*/ */
export default { export default function (_this) {
return {
id: 'application_info_training', id: 'application_info_training',
title: '所受培训', title: '所受培训',
visible() { visible() {
return this.tabActive !== 'application_info_first' return _this.visible
}, },
get: { get: {
action: '/api/enrollment/v1.0/application-materials/1005', action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) { callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED' const { trainings: list = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
let list = data.data.material.trainings || [] this.form.options.disabled = submissionStage !== 'FILLING'
list = list.map(item => {
const { start_date: startDate, end_date: endDate } = item
if (startDate) {
item.dates = [startDate, endDate]
}
return item
})
return list.length ? list : [{}] return list.length ? list : [{}]
} }
}, },
update: { update: {
action: '/api/enrollment/v1.0/application-materials/1005/put', action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) { beforeRequest(data) {
const trainings = data.map(item => { 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) => { return ['start_date', 'end_date', 'institution_cn', 'course_cn'].reduce((result, key) => {
result[key] = item[key] result[key] = item[key] || ''
return result return result
}, {}) }, {})
}) })
...@@ -39,36 +30,48 @@ export default { ...@@ -39,36 +30,48 @@ export default {
} }
}, },
form: { 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, hasAdd: true,
options: { options: { labelWidth: '140px' },
labelWidth: '140px'
},
items: [ items: [
{ {
type: 'v-datepicker', type: 'v-datepicker',
label: '培训时间', label: '开始时间',
model: 'dates', model: 'start_date',
attrs: { attrs: {
type: 'monthrange', type: 'month',
rangeSeparator: '至', placeholder: '请选择培训开始时间',
startPlaceholder: '请选择开始时间',
endPlaceholder: '请选择结束时间',
valueFormat: 'yyyy-MM' valueFormat: 'yyyy-MM'
}
// rules: [{ required: true, message: '请选择培训开始时间', trigger: 'blur' }]
}, },
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', type: 'v-input',
label: '培训机构', label: '培训机构',
model: 'institution_cn', model: 'institution_cn',
rules: [{ required: true, message: '请输入培训机构', trigger: 'blur' }] attrs: { placeholder: '请输入培训机构' }
// rules: [{ required: true, message: '请输入培训机构', trigger: 'blur' }]
}, },
{ {
type: 'v-input', type: 'v-input',
label: '课程名称', label: '课程名称',
model: 'course_cn', model: 'course_cn',
rules: [{ required: true, message: '请输入课程名称', trigger: 'blur' }] attrs: { placeholder: '请输入课程名称' }
// rules: [{ required: true, message: '请输入课程名称', trigger: 'blur' }]
} }
] ]
} }
}
} }
import { STAGE_LIST } from '../../index'
/** /**
* 推荐信 * 推荐信
*/ */
export default { export default function (_this) {
return {
id: 'application_tjx', id: 'application_tjx',
title: '推荐信', title: '推荐信',
visible() { visible() {
return this.tabActive !== 'application_info_first' return _this.visible
}, },
get: { get: {
action: '/api/enrollment/v1.0/application-materials/1005', action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) { callback(data) {
// this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED' const { submission_stage: submissionStage = 'FILLING' } = data.data.material
let list = data.data.material.reco_letters || [] this.form.options.disabled = STAGE_LIST.findIndex(item => item === submissionStage) > 3
return list.length ? list : [{}, {}, {}] const list = data.data.material.reco_letters || []
return list.length ? list : [{}, {}]
} }
}, },
update: { update: {
action: '/api/enrollment/v1.0/application-materials/1005/put', action: `/api/enrollment/v1.0/application-materials/1005/put`,
beforeRequest(data) { 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 } return { reco_letters: data }
} }
}, },
form: { form: {
prev: { to: { query: { active: 'application_info', tab: 'application_info_honor' } } }, minlength: 2,
next: { to: { query: { active: 'application_wfzzm' } } }, prev: { to: { query: { active: 'application_info', tab: 'application_info_honor' } }, isSubmit: true },
next: { to: { query: { active: 'application_wfzzm' } }, isSubmit: true },
hasAdd: true, hasAdd: true,
minLength: 3,
disabled(data) { disabled(data) {
return !!data.letter_content return !!data.letter_content
}, },
...@@ -50,26 +45,28 @@ export default { ...@@ -50,26 +45,28 @@ export default {
{ {
text: '再次邀请', text: '再次邀请',
visible(data) { visible(data) {
return data.id && !data.letter_content const editable = ['PREPAYMENT', 'INTERVIEW_APPLICATION', 'AUDITION'].includes(_this.detail.material.submission_stage)
return data.id && !data.letter_content && editable
}, },
onClick(data) { onClick(data) {
console.log(data, this) _this.sendToProvider(data)
} }
}, },
{ {
text: '更换推荐人', text: '更换推荐人',
visible(data) { visible(data) {
return data.id && !data.letter_content const editable = ['PREPAYMENT', 'INTERVIEW_APPLICATION', 'AUDITION'].includes(_this.detail.material.submission_stage)
return data.id && !data.letter_content && editable
}, },
onClick(data) { onClick(data, $form) {
console.log(data, this) $form.validate().then(() => {
_this.changeProvider(data)
})
} }
} }
] ]
}, },
options: { options: { labelWidth: '140px' },
labelWidth: '140px'
},
items: [ items: [
{ {
type: 'v-input', type: 'v-input',
...@@ -83,31 +80,24 @@ export default { ...@@ -83,31 +80,24 @@ export default {
type: 'v-input', type: 'v-input',
label: '推荐人电话', label: '推荐人电话',
model: 'provider_phone_number', model: 'provider_phone_number',
attrs: { placeholder: '请输入推荐人电话' }, attrs: { placeholder: '请输入推荐人电话', maxlength: 11 },
rules: [{ required: true, message: '请输入推荐人电话', trigger: 'blur' }] rules: [{ required: true, pattern: /^1[3-9]\d{9}$/, message: '请输入推荐人电话', trigger: 'blur' }]
}, },
{ {
type: 'v-input', type: 'v-input',
label: '推荐人邮箱', label: '推荐人邮箱',
model: 'provider_email', model: 'provider_email',
attrs: { placeholder: '请输入推荐人邮箱' }, attrs: { placeholder: '请输入推荐人邮箱' },
rules: [{ required: true, message: '请输入推荐人邮箱', trigger: 'blur' }] rules: [{ type: 'email', required: true, message: '请输入推荐人邮箱', trigger: 'blur' }]
}, },
{ {
type: 'v-select', type: 'v-select',
values: [ values: [{ value: '老师/导师' }, { value: '领导' }, { value: '同学' }, { value: '同事' }, { value: '亲属' }, { value: '朋友' }, { value: '其他' }],
{ value: '老师/导师' },
{ value: '领导' },
{ value: '同学' },
{ value: '同事' },
{ value: '亲属' },
{ value: '朋友' },
{ value: '其他' }
],
label: '与推荐人关系', label: '与推荐人关系',
model: 'provider_relationship', model: 'provider_relationship',
rules: [{ required: true, message: '请选择与推荐人关系', trigger: 'change' }] rules: [{ required: true, message: '请选择与推荐人关系', trigger: 'change' }]
} }
] ]
} }
}
} }
export default { export default function (_this) {
return {
id: 'application_wfzzm', id: 'application_wfzzm',
title: '无犯罪证明', title: '无犯罪证明',
visible() { visible() {
return this.tabActive !== 'application_info_first' return _this.visible
}, },
get: { get: {
action: '/api/enrollment/v1.0/application-materials/1005', action: `/api/enrollment/v1.0/application-materials/1005`,
callback(data) { callback(data) {
this.form.options.disabled = data.data.material.submission_status === 'SUBMITTED' const { attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material
const { attachments = [] } = data.data.material this.form.options.disabled = submissionStage !== 'FILLING'
const NO_CRIMINAL_CERT = attachments.filter(item => { const NO_CRIMINAL_CERT = attachments.filter(item => {
return item.file_type_id === 'NO_CRIMINAL_CERT' return item.file_type_id === 'NO_CRIMINAL_CERT'
}) })
...@@ -26,17 +28,18 @@ export default { ...@@ -26,17 +28,18 @@ export default {
required: true, required: true,
model: 'NO_CRIMINAL_CERT', model: 'NO_CRIMINAL_CERT',
attrs: { attrs: {
action: '/api/enrollment/v1.0/application-materials/attachments/1005/put', action: `/api/enrollment/v1.0/application-materials/attachments/1005/put`,
deleteAction: '/api/enrollment/v1.0/application-materials/attachments/1005/delete', deleteAction: `/api/enrollment/v1.0/application-materials/attachments/1005/delete`,
data: { file_type: 'NO_CRIMINAL_CERT' }, data: { file_type: 'NO_CRIMINAL_CERT' },
limit: 1 limit: 1
}, },
prepend: ` prepend: `
<p>第一步:点击下载按键获取无犯罪证明模板</p> <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> <p>第二步:打印文件后填写内容并签字上传至电脑,点击下方按钮上传文件</p>
` `
} }
] ]
} }
}
} }
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
<script> <script>
import AppLayout from '../layout.vue' import AppLayout from '../layout.vue'
import menus from './form' import getMenus from './form'
// import AppPay from './pay.vue' // import AppPay from './pay.vue'
// import AppPreview from '../preview.vue' // import AppPreview from '../preview.vue'
export default { export default {
components: { AppLayout }, components: { AppLayout },
data() { data() {
const menus = getMenus(this)
return { return {
visible: false, visible: true,
menus: [menus], menus: [menus],
currentActive: 'application_info', currentActive: 'application_info',
tabActive: 'application_info_profile', tabActive: 'application_info_profile',
......
{ {
"name": "@ezijing/vue-form", "name": "@ezijing/vue-form",
"version": "2.4.1", "version": "2.5.29",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@ezijing/vue-form", "name": "@ezijing/vue-form",
"version": "2.4.1", "version": "2.5.29",
"dependencies": { "dependencies": {
"axios": "^1.6.7", "axios": "^1.6.7",
"element-ui": "^2.15.14", "element-ui": "2.15.14",
"vue": "^2.7.16" "vue": "^2.7.16"
}, },
"devDependencies": { "devDependencies": {
...@@ -1285,9 +1285,8 @@ ...@@ -1285,9 +1285,8 @@
}, },
"node_modules/element-ui": { "node_modules/element-ui": {
"version": "2.15.14", "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==", "integrity": "sha512-2v9fHL0ZGINotOlRIAJD5YuVB8V7WKxrE9Qy7dXhRipa035+kF7WuU/z+tEmLVPBcJ0zt8mOu1DKpWcVzBK8IA==",
"license": "MIT",
"dependencies": { "dependencies": {
"async-validator": "~1.8.1", "async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0", "babel-helper-vue-jsx-merge-props": "^2.0.0",
......
{ {
"name": "@ezijing/vue-form", "name": "@ezijing/vue-form",
"version": "2.5.16", "version": "2.5.31",
"private": false, "private": false,
"description": "基于Vue Element-UI的表单", "description": "基于Vue Element-UI的表单",
"type": "module", "type": "module",
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
</div> </div>
<div class="v-layout-main" :key="menuActiveId"> <div class="v-layout-main" :key="menuActiveId">
<slot> <slot>
<template v-if="page">
<!-- 选项卡 --> <!-- 选项卡 -->
<VCardFormTabs <VCardFormTabs
v-model="tabActiveId" v-model="tabActiveId"
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<slot :name="slotName" v-bind="slotProps"></slot> <slot :name="slotName" v-bind="slotProps"></slot>
</template> </template>
</VCardForm> </VCardForm>
</template>
</slot> </slot>
</div> </div>
</div> </div>
...@@ -75,7 +77,7 @@ export default { ...@@ -75,7 +77,7 @@ export default {
return [...result, item] return [...result, item]
}, []) }, [])
return pages.map((item, index, arr) => { 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() { tabPages() {
...@@ -113,29 +115,35 @@ export default { ...@@ -113,29 +115,35 @@ export default {
}, },
methods: { methods: {
filterVisible(data) { filterVisible(data) {
return data.filter(item => { return data.reduce((acc, item) => {
// 检查当前项的visible属性是否为函数,若是则调用函数获取结果 // 检查当前项的visible属性是否为函数,若是则调用函数获取结果
const isVisible = typeof item.visible === 'function' ? item.visible() : item.visible === undefined ? true : item.visible const isVisible = typeof item.visible === 'function' ? item.visible.call(this) : item.visible === undefined ? true : item.visible
if (!isVisible) {
return false // 若当前项不可见,则过滤掉 if (isVisible) {
} const newItem = { ...item }
// 如果当前项有children属性,则递归过滤children // 如果当前项有children属性,则递归过滤children
if (item.children) { if (item.children) {
item.children = this.filterVisible(item.children) newItem.children = this.filterVisible(item.children)
} }
// 如果当前项有tabs属性,则递归过滤tabs // 如果当前项有tabs属性,则递归过滤tabs
if (item.tabs) { if (item.tabs) {
item.tabs = this.filterVisible(item.tabs) newItem.tabs = this.filterVisible(item.tabs)
} }
return true // 当前项可见,保留
}) acc.push(newItem) // 将符合条件的项添加到新数组中
}
return acc
}, [])
}, },
// 上一步\下一步 // 上一步\下一步
handleStepChange(id) { handleStepChange(id) {
const nextPage = this.pages.find(item => item.id === id) const nextPage = this.pages.find(item => item.id === id)
if (nextPage.isTab) { if (nextPage.isTab) {
if (this.menuActiveId !== nextPage.parentId) this.handleMenuChange(nextPage.parentId)
this.handleTabChange(id) this.handleTabChange(id)
if (this.menuActiveId !== nextPage.parentId) this.handleMenuChange(nextPage.parentId)
} else { } else {
this.handleMenuChange(id) this.handleMenuChange(id)
} }
......
...@@ -56,8 +56,8 @@ export default { ...@@ -56,8 +56,8 @@ export default {
} }
}, },
methods: { methods: {
handleTabClick() { handleTabClick(e) {
this.$emit('change', this.value) this.$emit('change', e.name)
} }
} }
} }
......
...@@ -53,11 +53,11 @@ ...@@ -53,11 +53,11 @@
</template> </template>
<div class="v-form-pane__append" v-html="form.append" v-if="form.append"></div> <div class="v-form-pane__append" v-html="form.append" v-if="form.append"></div>
<div class="v-form-footer" v-if="form.hasButton"> <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 size="medium" @click="onPrev" 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 type="primary" size="medium" :disabled="form.options.disabled" @click.native="onSubmit" style="min-width: 120px" v-if="form.hasSubmit">
{{ submitButtonText }} {{ submitButtonText }}
</el-button> </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>
</div> </div>
</template> </template>
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
}, },
data() { data() {
return { return {
model: undefined, model: {},
form: {} form: {}
} }
}, },
...@@ -130,13 +130,15 @@ export default { ...@@ -130,13 +130,15 @@ export default {
immediate: true, immediate: true,
handler() { handler() {
const { form } = this.page const { form } = this.page
this.model = form.model || (form.hasAdd ? [Object.assign({}, form.defaultModel)] : {})
const formOptions = Object.assign({ disabled: this.options.disabled }, form.options) const formOptions = Object.assign({ disabled: this.options.disabled }, form.options)
this.form = Object.assign({ minlength: 1, hasSubmit: true, hasButton: true }, form, { options: formOptions }) 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: { methods: {
// 获取 // 获取
async getData() { async getData() {
...@@ -195,22 +197,29 @@ export default { ...@@ -195,22 +197,29 @@ export default {
} }
this.model.splice(index, 1) this.model.splice(index, 1)
}, },
onSubmit() {
this.handleSubmit()
},
onPrev() {
this.handlePrev()
},
onNext() {
this.handleNext()
},
// 提交 // 提交
async handleSubmit() { async handleSubmit() {
if (this.form.options.disabled) return if (this.form.options.disabled) return
const form = this.$refs.form const form = this.$refs.form
const formComponents = Array.isArray(form) ? form : [form] const formComponents = Array.isArray(form) ? form : [form]
const allPromise = formComponents.map(form => form.$form.validate()) const allPromise = formComponents.map(form => form.$form.validate())
try { await Promise.all(allPromise).then(() => {
await Promise.all(allPromise)
if (this.page.onUpdate) { if (this.page.onUpdate) {
return await this.page.onUpdate(this.update.beforeRequest(this.model)) return this.page.onUpdate(this.update.beforeRequest(this.model))
} else { } else {
return await this.updateData() return this.updateData()
}
} catch (error) {
console.log(error)
} }
})
return false
}, },
// 上一步 // 上一步
async handlePrev() { async handlePrev() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论