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

updates

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