提交 d1643670 authored 作者: matian's avatar matian

updates

上级 abf5e76b
...@@ -13,9 +13,13 @@ export default function(_this) { ...@@ -13,9 +13,13 @@ export default function(_this) {
get: { get: {
action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}`, action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}`,
callback(data) { callback(data) {
const { educations: list = [], submission_stage: submissionStage = 'FILLING' } = data.data.material const {
basic_info: basicInfo = {},
educations: list = [],
submission_stage: submissionStage = 'FILLING'
} = data.data.material
this.form.options.disabled = submissionStage !== 'FILLING' this.form.options.disabled = submissionStage !== 'FILLING'
return list.length ? list : [{}] return Object.assign({}, basicInfo, list.length ? list : [{}])
} }
}, },
update: { update: {
...@@ -27,7 +31,8 @@ export default function(_this) { ...@@ -27,7 +31,8 @@ export default function(_this) {
return result return result
}, {}) }, {})
}) })
return { educations } const basic_info = { education_status: data.education_status }
return { basic_info, educations }
} }
}, },
form: { form: {
......
...@@ -38,6 +38,21 @@ ...@@ -38,6 +38,21 @@
<div v-html="item.computed(material[item.code])"></div> <div v-html="item.computed(material[item.code])"></div>
</template> </template>
<template v-else-if="item.isMultiple"> <template v-else-if="item.isMultiple">
<div
v-if="item.code === 'educations'"
style="margin-bottom:20px;padding-bottom: 10px;border-bottom: 1px solid #f1f1f1;"
>
<dl>
<dt>当前状态:</dt>
<dd>{{ material.basic_info.education_status }}</dd>
<dt>GPA:</dt>
<dd>{{ material.basic_info.gpa_score }}</dd>
</dl>
<dl>
<dt>语言成绩</dt>
<dd></dd>
</dl>
</div>
<div class="group" v-for="(data, index) in material[item.code]" :key="index"> <div class="group" v-for="(data, index) in material[item.code]" :key="index">
<dl <dl
v-for="subitem in item.items" v-for="subitem in item.items"
...@@ -249,10 +264,7 @@ export default { ...@@ -249,10 +264,7 @@ export default {
}, },
{ label: '专业名称', code: 'major_cn' }, { label: '专业名称', code: 'major_cn' },
{ label: '学校名称', code: 'school_name_cn' }, { label: '学校名称', code: 'school_name_cn' },
{ label: '学历/学位', code: 'degree' }, { label: '学历/学位', code: 'degree' }
{ label: '当前状态', code: 'education_status' },
{ label: 'GPA', code: 'gpa_score' },
{ label: '语言成绩', code: 'language_score' }
] ]
}, },
{ {
......
...@@ -6,7 +6,11 @@ export default function(_this) { ...@@ -6,7 +6,11 @@ export default function(_this) {
get: { get: {
action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}`, action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}`,
callback(data) { callback(data) {
const { attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material const {
basic_info: basicInfo = {},
attachments = [],
submission_stage: submissionStage = 'FILLING'
} = data.data.material
const stageList = [ const stageList = [
'FILLING', 'FILLING',
'PREPAYMENT', 'PREPAYMENT',
...@@ -18,7 +22,7 @@ export default function(_this) { ...@@ -18,7 +22,7 @@ export default function(_this) {
'CLOSED' 'CLOSED'
] ]
this.form.options.disabled = stageList.findIndex(item => item === submissionStage) > 2 this.form.options.disabled = stageList.findIndex(item => item === submissionStage) > 2
return attachments.reduce( const attachment = attachments.reduce(
(result, item) => { (result, item) => {
if (item.file_type_id === 'REPORT_CARD_CN') { if (item.file_type_id === 'REPORT_CARD_CN') {
result.REPORT_CARD_CN.push(item) result.REPORT_CARD_CN.push(item)
...@@ -30,18 +34,30 @@ export default function(_this) { ...@@ -30,18 +34,30 @@ export default function(_this) {
}, },
{ REPORT_CARD_CN: [], REPORT_CARD_EN: [] } { REPORT_CARD_CN: [], REPORT_CARD_EN: [] }
) )
return { basicInfo, attachment }
}
},
update: {
action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}/put`,
beforeRequest(data) {
// const basicInfo = ['gpa_score'].reduce((result, key) => {
// result[key] = data[key]
// return result
// }, {})
const basicInfo = { gpa_score: data.gpa_score }
return { basic_info: basicInfo }
} }
}, },
form: { form: {
prev: { to: { query: { active: 'interview_ywjl' } } }, prev: { to: { query: { active: 'interview_ywjl' } } },
next: { to: { query: { active: 'interview_yynl' } } }, next: { to: { query: { active: 'interview_yynl' } }, isSubmit: true },
hasButton: false, hasButton: false,
options: { 'label-position': 'top' }, options: { 'label-position': 'top' },
items: [ items: [
{ {
type: 'v-input', type: 'v-input',
label: 'GPA成绩 (填写示例:3.9 / 5.0)', label: 'GPA成绩 (填写示例:3.9 / 5.0)',
model: 'id_number', model: 'gpa_score',
attrs: { placeholder: '请填写您的GPA成绩' }, attrs: { placeholder: '请填写您的GPA成绩' },
rules: [{ required: true, message: '请填写您的GPA成绩', trigger: 'blur' }] rules: [{ required: true, message: '请填写您的GPA成绩', trigger: 'blur' }]
}, },
......
...@@ -6,7 +6,11 @@ export default function(_this) { ...@@ -6,7 +6,11 @@ export default function(_this) {
get: { get: {
action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}`, action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}`,
callback(data) { callback(data) {
const { attachments = [], submission_stage: submissionStage = 'FILLING' } = data.data.material const {
basic_info: basicInfo = {},
attachments = [],
submission_stage: submissionStage = 'FILLING'
} = data.data.material
const stageList = [ const stageList = [
'FILLING', 'FILLING',
'PREPAYMENT', 'PREPAYMENT',
...@@ -18,7 +22,7 @@ export default function(_this) { ...@@ -18,7 +22,7 @@ export default function(_this) {
'CLOSED' 'CLOSED'
] ]
this.form.options.disabled = stageList.findIndex(item => item === submissionStage) > 2 this.form.options.disabled = stageList.findIndex(item => item === submissionStage) > 2
return attachments.reduce( const attachment = attachments.reduce(
(result, item) => { (result, item) => {
if (item.file_type_id === 'INTERNATIONAL_LANGUAGE_SCORE') { if (item.file_type_id === 'INTERNATIONAL_LANGUAGE_SCORE') {
result.INTERNATIONAL_LANGUAGE_SCORE.push(item) result.INTERNATIONAL_LANGUAGE_SCORE.push(item)
...@@ -27,12 +31,14 @@ export default function(_this) { ...@@ -27,12 +31,14 @@ export default function(_this) {
}, },
{ INTERNATIONAL_LANGUAGE_SCORE: [] } { INTERNATIONAL_LANGUAGE_SCORE: [] }
) )
return Object.assign({}, basicInfo, attachment)
} }
}, },
update: { update: {
action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/submit/${process.env.projectId}`, action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/submit/${process.env.projectId}`,
beforeRequest(data) { beforeRequest(data) {
return { submission_stage: 'INTERVIEW_APPLICATION' } const base_info = { language_score: data.language_score }
return { base_info, submission_stage: 'INTERVIEW_APPLICATION' }
}, },
callback() { callback() {
this.form.options.disabled = true this.form.options.disabled = true
...@@ -52,7 +58,7 @@ export default function(_this) { ...@@ -52,7 +58,7 @@ export default function(_this) {
{ {
type: 'v-input', type: 'v-input',
label: '语言成绩(填写示例:大学英语六级/550)', label: '语言成绩(填写示例:大学英语六级/550)',
model: 'id_number', model: 'language_score',
attrs: { placeholder: '请填写您的语言成绩' }, attrs: { placeholder: '请填写您的语言成绩' },
rules: [{ required: true, message: '请填写您的语言成绩', trigger: 'blur' }] rules: [{ required: true, message: '请填写您的语言成绩', trigger: 'blur' }]
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论