提交 43a498af authored 作者: matian's avatar matian

updates

上级 3786544d
...@@ -13,23 +13,28 @@ export default function(_this) { ...@@ -13,23 +13,28 @@ 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'
console.log(list)
return list.length ? list : [{}] return list.length ? list : [{}]
} }
}, },
update: { update: {
action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}/put`, action: `${process.env.baseURL}/api/enrollment/v1.0/application-materials/${process.env.projectId}/put`,
beforeRequest(data) { beforeRequest(data) {
console.log(data, '1111')
const educations = data.map(item => { const educations = data.map(item => {
return ['start_date', 'end_date', 'school_name_cn', 'major_cn', 'degree'].reduce((result, key) => { 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
}, {}) }, {})
}) })
const base_Info = { education_status: data[0].education_status }
return { base_Info, educations } const basicInfo = { education_status: data.education_status }
return { basic_info: basicInfo, educations }
} }
}, },
form: { form: {
......
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
<template v-if="item.computed"> <template v-if="item.computed">
<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 && item.code !== 'educations'">
<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"
:key="subitem.code" :key="subitem.code"
v-show="subitem.visible ? subitem.visible() : true" v-if="subitem.visible ? subitem.visible() : true"
> >
<dt>{{ subitem.label }}</dt> <dt>{{ subitem.label }}</dt>
<dd> <dd>
...@@ -54,6 +54,46 @@ ...@@ -54,6 +54,46 @@
</dl> </dl>
</div> </div>
</template> </template>
<template v-else-if="item.isMultiple && item.code === 'educations'">
<div 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">
<dl
v-for="subitem in item.items"
:key="subitem.code"
v-if="subitem.visible ? subitem.visible() : true"
>
<template v-if="item.code === 'educations'">
<dt v-if="data[subitem.code]">{{ subitem.label }}</dt>
<dd>
<template v-if="subitem.computed">
<div v-html="subitem.computed(data)"></div>
</template>
<template v-else>{{ data[subitem.code] }}</template>
</dd>
</template>
<template v-else>
<dt>{{ subitem.label }}</dt>
<dd>
<template v-if="subitem.computed">
<div v-html="subitem.computed(data)"></div>
</template>
<template v-else>{{ data[subitem.code] }}</template>
</dd>
</template>
</dl>
</div>
</template>
<template v-else> <template v-else>
<div class="group"> <div class="group">
<dl v-for="subitem in item.items" :key="subitem.code"> <dl v-for="subitem in item.items" :key="subitem.code">
...@@ -215,6 +255,7 @@ export default { ...@@ -215,6 +255,7 @@ export default {
label: '现居住城市', label: '现居住城市',
code: 'address_city', code: 'address_city',
computed(data) { computed(data) {
console.log(data, '111')
return data.address_city ? `${data.address_province}-${data.address_city}` : '' return data.address_city ? `${data.address_province}-${data.address_city}` : ''
} }
}, },
...@@ -239,20 +280,22 @@ export default { ...@@ -239,20 +280,22 @@ export default {
to: { path: '/my/application', query: { active: 'application_info', tab: 'application_info_education' } } to: { path: '/my/application', query: { active: 'application_info', tab: 'application_info_education' } }
}, },
isMultiple: true, isMultiple: true,
items: [ items: [
// { label: '当前状态', code: 'education_status' },
// { label: 'GPA', code: 'gpa_score' },
// { label: '语言成绩', code: 'language_score' },
{ {
label: '教育时间', label: '教育时间',
code: 'start_date', code: 'start_date',
computed(data) { computed(data) {
console.log(data, 'data')
return (data.start_date || '') + (data.end_date ? `至${data.end_date}` : '') return (data.start_date || '') + (data.end_date ? `至${data.end_date}` : '')
} }
}, },
{ 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' }
] ]
}, },
{ {
...@@ -345,7 +388,7 @@ export default { ...@@ -345,7 +388,7 @@ export default {
// } // }
// } // }
] ]
console.log(options, 'oooo')
this.isManager && this.isManager &&
options.push({ options.push({
title: '推荐信', title: '推荐信',
...@@ -362,6 +405,7 @@ export default { ...@@ -362,6 +405,7 @@ export default {
{ label: '推荐信内容', code: 'letter_content', visible: () => this.isManager } { label: '推荐信内容', code: 'letter_content', visible: () => this.isManager }
] ]
}) })
return options return options
} }
}, },
...@@ -370,10 +414,12 @@ export default { ...@@ -370,10 +414,12 @@ export default {
getApplication() { getApplication() {
this.loading = true this.loading = true
api.getApplication(this.$route.query).then(response => { api.getApplication(this.$route.query).then(response => {
console.log(response)
const { data, error, message } = response const { data, error, message } = response
if (error.toString() === '0') { if (error.toString() === '0') {
const { material, progress } = data const { material, progress } = data
this.material = material this.material = material
console.log(this.material.basic_info)
const missedRequiredList = progress.FILLING.attachments.missed_required_list const missedRequiredList = progress.FILLING.attachments.missed_required_list
progress.FILLING.attachments.progress = missedRequiredList.NO_CRIMINAL_CERT ? 0 : 1 progress.FILLING.attachments.progress = missedRequiredList.NO_CRIMINAL_CERT ? 0 : 1
progress.FILLING.reco_letters = progress.REGISTRATION.reco_letters progress.FILLING.reco_letters = progress.REGISTRATION.reco_letters
......
...@@ -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,6 +34,7 @@ export default function(_this) { ...@@ -30,6 +34,7 @@ export default function(_this) {
}, },
{ REPORT_CARD_CN: [], REPORT_CARD_EN: [] } { REPORT_CARD_CN: [], REPORT_CARD_EN: [] }
) )
return Object.assign({}, basicInfo, attachment)
} }
}, },
update: { update: {
...@@ -39,7 +44,10 @@ export default function(_this) { ...@@ -39,7 +44,10 @@ export default function(_this) {
// result[key] = data[key] // result[key] = data[key]
// return result // return result
// }, {}) // }, {})
return { basic_info: data.gpa_score } const basicInfo = {
gpa_score: data.gpa_score
}
return { basic_info: basicInfo }
} }
}, },
form: { form: {
......
...@@ -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,17 @@ export default function(_this) { ...@@ -27,12 +31,17 @@ 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 { language_score: 'language_score', submission_stage: 'INTERVIEW_APPLICATION' } console.log(data)
const basicInfo = {
language_score: data.language_score
}
return { basic_info: basicInfo, submission_stage: 'INTERVIEW_APPLICATION' }
}, },
callback() { callback() {
this.form.options.disabled = true this.form.options.disabled = true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论