master
xy 1 year ago
parent e9031caf4d
commit 104507c0f8

@ -11,6 +11,8 @@ let apiApp = {
batchDetail: '/api/mobile/batch/detail',
batchSubmit: '/api/mobile/batch/user-submit',
batchData: '/api/mobile/user/batch-data',
batchDataDetail: '/api/mobile/user/batch-data-detail',
specialtyList: '/api/mobile/school/specialty',
}
const apiUser = {
appletLogin: '/api/mobile/user/applet-login',
@ -46,6 +48,8 @@ const install = (Vue, vm) => {
const batchDetail = (params = {}) => vm.$u.get(apiApp.batchDetail, params)
const batchSubmit = (params = {}) => vm.$u.post(apiApp.batchSubmit, params)
const batchData = (params = {}) => vm.$u.get(apiApp.batchData, params)
const batchDataDetail = (params = {}) => vm.$u.get(apiApp.batchDataDetail, params)
const specialtyList = (params = {}) => vm.$u.get(apiApp.specialtyList, params)
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = {
// 用户相关
@ -68,6 +72,8 @@ const install = (Vue, vm) => {
batchDetail,
batchSubmit,
batchData,
batchDataDetail,
specialtyList,
};
}

@ -0,0 +1,340 @@
<template>
<view class="container safe-area-inset-bottom">
<view class="wrap">
<view class="picked-data">
<view>{{ detail.aspiration ? detail.aspiration.year : '-' }}</view>
<view>{{ (detail.aspiration && detail.aspiration.area) ? detail.aspiration.area.name : '-' }}</view>
</view>
<view class="card" v-for="batch in detail.data" :key="batch.batchId">
<view class="card__title">
<scroll-view scroll-x="true" >
<view class="batch__title">
{{ batch.name || '-' }}
</view>
</scroll-view>
</view>
<view class="card__body">
<view class="batch-sub" v-for="batchSub in batch.batchSubs" :key="batchSub.batchSubId">
<view class="batch-sub__title">
{{ batchSub.name || '-' }}
</view>
<view class="batch-sub__body">
<template v-if="hasSpecialty(batchSub.batchSubSchools)">
<view class="batch-sub-school" v-for="school in batchSub.batchSubSchools" :key="school.id">
<view class="batch-sub-school__form sub-form2">
<view class="sub-form2__row sub-form2-title">
<view class="sub-form2__col1">
志愿序号
</view>
<view class="sub-form2__col2">
代码
</view>
<view class="sub-form2__col3">
学校
</view>
</view>
<view class="sub-form2__row">
<view class="sub-form2__col1">
{{ school.name || '-' }}
</view>
<view class="sub-form2__col2">
{{ school.code || '-' }}
</view>
<view class="sub-form2__col3">
{{ school.value || '-' }}
</view>
</view>
</view>
<view class="batch-sub-school-specialty sub-form2" v-if="school.specialties && school.specialties.length > 0">
<view class="sub-form2__row sub-form2-title">
<view class="sub-form2__col1">
序号
</view>
<view class="sub-form2__col2">
代码
</view>
<view class="sub-form2__col3">
专业
</view>
</view>
<view class="sub-form2__row" v-for="(spec) in school.specialties" :key="spec.specialtyId">
<view class="sub-form2__col1">
{{ spec.name || '-' }}
</view>
<view class="sub-form2__col2">
{{ spec.code || '-' }}
</view>
<view class="sub-form2__col3">
{{ spec.value || '-' }}
</view>
</view>
</view>
<view class="batch-sub-is-obey" v-if="!batchSub.notShowSpecialtyObey">
<view>
其他专业是否服从
</view>
<u-radio-group disabled v-model="batchSub.specialtyObey">
<u-radio name="1"></u-radio>
<u-radio name="0"></u-radio>
</u-radio-group>
</view>
<view class="batch-sub-is-obey" v-if="!batchSub.notShowSchoolObey">
<view>
其他院校是否服从
</view>
<u-radio-group disabled v-model="batchSub.schoolObey">
<u-radio name="1"></u-radio>
<u-radio name="0"></u-radio>
</u-radio-group>
</view>
</view>
</template>
<template v-else>
<view class="batch-sub-school">
<view class="batch-sub-school__form sub-form1">
<view class="sub-form2__row sub-form1-title">
<view class="sub-form2__col1">
志愿序号
</view>
<view class="sub-form2__col2">
代码
</view>
<view class="sub-form2__col3">
学校
</view>
</view>
<view class="sub-form2__row" v-for="school in batchSub.batchSubSchools" :key="school.id">
<view class="sub-form2__col1">
{{ school.name || '-' }}
</view>
<view class="sub-form2__col2">
{{ school.code || '-' }}
</view>
<view class="sub-form2__col3">
{{ school.value || '-' }}
</view>
</view>
</view>
<view class="batch-sub-is-obey" v-if="!batchSub.notShowSpecialtyObey">
<view>
其他专业是否服从
</view>
<u-radio-group disabled v-model="batchSub.specialtyObey">
<u-radio name="1"></u-radio>
<u-radio name="0"></u-radio>
</u-radio-group>
</view>
<view class="batch-sub-is-obey" v-if="!batchSub.notShowSchoolObey">
<view>
其他院校是否服从
</view>
<u-radio-group disabled v-model="batchSub.schoolObey">
<u-radio name="1"></u-radio>
<u-radio name="0"></u-radio>
</u-radio-group>
</view>
</view>
</template>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detail: {}
};
},
methods: {
async getDetail(id) {
try {
const { list } = await this.$u.api.batchDataDetail({ id })
console.log(list)
this.detail = list
} catch (err) {
console.error(err)
}
}
},
computed: {
hasSpecialty() {
return function (schools) {
return schools.reduce((pre, cur) => cur.specialties.length > 0, false)
}
}
},
onLoad(options) {
if (options.id) {
this.getDetail(options.id)
}
},
}
</script>
<style lang="scss">
.u-radio__icon-wrap--disabled--checked {
background: #4177f6 !important;
}
.container {
min-height: 100vh;
background: #eaf8fe;
.wrap {
padding-top: 20rpx;
.picked-data {
display: flex;
align-items: center;
border-radius: 20rpx;
filter: drop-shadow(-2.179rpx 3.355rpx 2.5rpx rgba(208,209,209,0.3));
background-color: rgba(255, 255, 255, 0.5);
margin: 0 24rpx ;
padding: 26rpx 160rpx;
& > view {
flex: 1;
text-align: center;
font-size: 32rpx;
text-transform: uppercase;
color: #333333;
font-weight: bold;
white-space: nowrap;
}
& > view + view {
margin-left: 10rpx;
}
}
.card {
margin: 28rpx 24rpx 0;
border-radius: 20rpx;
filter: drop-shadow(-2.179rpx 3.355rpx 2.5rpx rgba(208,209,209,0.3));
background-color: #ffffff;
&__title {
background: #fbf1e8;
border-radius: 20rpx 20rpx 0 0;
padding: 0 16rpx;
}
&__body {
padding: 34rpx 28rpx 52rpx 28rpx;
}
}
.card + .card {
margin-top: 22rpx;
}
}
}
.batch__title {
text-align: center;
font-size: 28rpx;
text-transform: uppercase;
color: #e77817;
font-weight: 500;
padding: 30rpx 20rpx;
word-break: keep-all;
white-space: nowrap;
}
.batch-sub {
&__title {
font-size: 28rpx;
text-transform: uppercase;
color: #333333;
font-weight: 500;
padding: 0 0 0 32rpx;
}
&-is-obey {
display: flex;
align-items: center;
margin-top: 40rpx;
& > view:nth-child(1) {
font-size: 24rpx;
text-transform: uppercase;
color: #333333;
font-weight: 500;
margin-right: 110rpx;
}
}
}
.batch-sub + .batch-sub {
margin-top: 50rpx;
}
.batch-sub-school {
}
.batch-sub-school + .batch-sub-school {
margin-top: 50rpx;
}
.sub-form1 {
text-align: center;
margin-top: 34rpx;
&-title {
font-size: 24rpx;
padding: 20rpx 0;
text-transform: uppercase;
background-color: #f6f8f7;
color: #333333;
font-weight: 500;
text-align: center;
}
&__row {
display: flex;
align-items: center;
justify-content: space-between;
}
&__col1 {
flex-basis: 29%;
}
&__col2 {
flex-basis: 67.5%;
}
}
.sub-form2 {
text-align: center;
margin-top: 34rpx;
&-title {
font-size: 24rpx;
padding: 20rpx 0;
text-transform: uppercase;
color: #333333;
font-weight: 500;
background-color: #f6f8f7;
text-align: center;
border-bottom: none !important;
}
&__row {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #e0e0e0;
padding: 22rpx 0;
}
&__col1 {
flex-basis: 20%;
text-transform: uppercase;
color: #333333;
}
&__col2 {
flex-basis: 24.8%;
}
&__col3 {
flex-basis: 47.9%;
}
}
</style>

@ -16,7 +16,7 @@
}"
@click="isShowTime = true"></u-input>
</view>
<view class="user-form">
<view class="user-form" v-if="aspiration.need_sign">
<view class="user-form__input">
<u-form :model="form" ref="uForm" :label-style="{ 'font-weight': '500' }" label-width="auto">
<u-form-item label="学生姓名" required prop="name">
@ -93,10 +93,22 @@
</view>
<view class="sub-form1__row">
<view class="sub-form1__col1">
<u-input v-model="flatForm[`${currentBatch.id}-${item.id}-${school.id}-code`]" :height="50" border border-color="#e0e0e0" input-align="center" :clearable="false"></u-input>
<u-input
v-model="flatForm[`${currentBatch.id}-${item.id}-${school.id}-code`]"
:height="50"
border
border-color="#e0e0e0"
input-align="center"
:clearable="false"
@click="forSchoolName = { needSpec: (school.specialty && school.specialty.length > 0), code: `${currentBatch.id}-${item.id}-${school.id}-code`, value: `${currentBatch.id}-${item.id}-${school.id}-value` },isShowSchoolSelect = true"></u-input>
</view>
<view class="sub-form1__col2">
<u-input v-model="flatForm[`${currentBatch.id}-${item.id}-${school.id}-value`]" :height="50" border border-color="#e0e0e0" input-align="center" :clearable="false"></u-input>
<u-input
v-model="flatForm[`${currentBatch.id}-${item.id}-${school.id}-value`]"
:height="50" border border-color="#e0e0e0"
input-align="center"
:clearable="false"
@click="forSchoolName = { needSpec: (school.specialty && school.specialty.length > 0),code: `${currentBatch.id}-${item.id}-${school.id}-code`, value: `${currentBatch.id}-${item.id}-${school.id}-value` },isShowSchoolSelect = true"></u-input>
</view>
</view>
</view>
@ -119,10 +131,24 @@
{{ spec.number }}
</view>
<view class="sub-form2__col2">
<u-input v-model="flatForm[`${currentBatch.id}-${item.id}-${school.id}-${specIndex}-code`]" :height="50" border border-color="#e0e0e0" input-align="center" :clearable="false"></u-input>
<u-input
v-model="flatForm[`${currentBatch.id}-${item.id}-${school.id}-${specIndex}-code`]"
:height="50"
border
border-color="#e0e0e0"
input-align="center"
:clearable="false"
@click="forSpecName = { code: `${currentBatch.id}-${item.id}-${school.id}-${specIndex}-code`, value: `${currentBatch.id}-${item.id}-${school.id}-${specIndex}-value` },isShowSpecSelect = true"></u-input>
</view>
<view class="sub-form2__col3">
<u-input v-model="flatForm[`${currentBatch.id}-${item.id}-${school.id}-${specIndex}-name`]" :height="50" border border-color="#e0e0e0" input-align="center" :clearable="false"></u-input>
<u-input
v-model="flatForm[`${currentBatch.id}-${item.id}-${school.id}-${specIndex}-value`]"
:height="50"
border
border-color="#e0e0e0"
input-align="center"
:clearable="false"
@click="forSpecName = { code: `${currentBatch.id}-${item.id}-${school.id}-${specIndex}-code`, value: `${currentBatch.id}-${item.id}-${school.id}-${specIndex}-value` },isShowSpecSelect = true"></u-input>
</view>
</view>
</view>
@ -209,6 +235,9 @@
}"
@confirm="e => form.year = e.year"></u-picker>
<u-modal v-model="isShowModal" content="确认提交数据?" show-cancel-button @confirm="submit"></u-modal>
<u-select v-model="isShowSchoolSelect" mode="mutil-column-auto" :list="schoolList" @confirm="schoolListConfirm" @cancel="schoolListCancel"></u-select>
<u-select v-model="isShowSpecSelect" :list="specList" @confirm="specListConfirm" @cancel="specListCancel"></u-select>
</view>
</template>
@ -220,6 +249,19 @@ export default {
step: 1,
isShowTime: false,
areaList: [],
forSchoolName: {
code: '',
value: '',
needSpec: false,
},
isShowSchoolSelect: false,
schoolList: [],
isShowSpecSelect: false,
forSpecName: {
code: '',
value: '',
},
specList: [],
form: {
name: "",
finish_school: "",
@ -239,8 +281,83 @@ export default {
};
},
methods: {
specListCancel() {
if (this.forSpecName.code) {
this.flatForm[this.forSpecName.code] = ''
}
if (this.forSpecName.value) {
this.flatForm[this.forSpecName.value] = ''
}
},
specListConfirm(e) {
const { label, value, extra } = e[0]
if (this.forSpecName.code) {
this.flatForm[this.forSpecName.code] = value
}
if (this.forSpecName.value) {
this.flatForm[this.forSpecName.value] = label
}
},
schoolListCancel() {
if (this.forSchoolName.code) {
this.flatForm[this.forSchoolName.code] = ""
}
if (this.forSchoolName.value) {
this.flatForm[this.forSchoolName.value] = ""
}
this.forSchoolName.needSpec = false
},
schoolListConfirm(e) {
console.log(e)
if (e[1]) {
const { label, value, extra } = e[1]
if (this.forSchoolName.code) {
this.flatForm[this.forSchoolName.code] = value
}
if (this.forSchoolName.value) {
this.flatForm[this.forSchoolName.value] = label
}
if (this.forSchoolName.needSpec) {
this.getSpecialties(extra)
}
}
},
async getSpecialties(school_id) {
try {
const { list } = await this.$u.api.specialtyList({
page: 1,
page_size: 9999,
school_id
})
this.specList = list.map(i => ({ label: i.name, value: i.code, extra: i.id }))
} catch (err) {
console.error(err)
}
},
async getSchools() {
try {
const { list } = await this.$u.api.schoolList({
page: 1,
page_size: 9999
})
this.schoolList = this.areaList.map(area => ({
id: area.id,
value: area.id,
label: area.name,
children: list.data.filter(school => school.area_id === area.id)?.map(i => ({
value: i.code,
label: i.name,
extra: i.id
}))
}))
} catch (err) {
console.error(err)
}
},
async getBatchSub(batchId) {
if (!this.subForm.find(i => i.id === batchId)) {
if (!this.subForm.find(i => i.batchId === batchId)) {
this.subForm.push({
batchId,
name: this.batches.find(j => j.id === batchId)?.name,
@ -265,12 +382,13 @@ export default {
value: "",
specialties: subSchool.specialty?.map((spec, specIndex) => ({
specialtyId: specIndex,
name: spec.number,
code: "",
value: ""
}))
})),
specialtyObey: "1",
schoolObey: "1"
[resSub.show_specialty_obey ? 'specialtyObey' : 'notShowSpecialtyObey']: "1",
[resSub.show_school_obey ? 'schoolObey' : 'notShowSchoolObey']: "1"
}))
} catch (err) {
console.error(err)
@ -353,7 +471,7 @@ export default {
},
setTitle() {
uni.setNavigationBarTitle({
title: `志愿模拟填报 - Step ${this.step}${ this.step !== 1 ? ('/'+(this.batches.length+1)) : '' }`
title: `志愿模拟填报 - Step ${this.step}${ this.step !== 1 ? ('/'+(this.batches.length)) : '' }`
})
},
async getArea() {
@ -365,43 +483,42 @@ export default {
}
},
submit () {
const idName = ['batchId', 'batchSubId', 'batchSubSchoolId', 'specialtyId']
const linkName = ['batchSubs', 'batchSubSchools', 'specialties']
for (let key in this.flatForm) {
let target = null
let keys = key.split('-')
for (let i = 0;i < keys.length;i++) {
const val = keys[i]
if (i === 1) {
let myTarget = target.find(j => j[idName[i]] === Number(val))
submit() {
const idName = ['batchId', 'batchSubId', 'batchSubSchoolId', 'specialtyId'];
const linkName = ['batchSubs', 'batchSubSchools', 'specialties'];
const updateTargetProperty = (target, key, property) => {
if (target && target.hasOwnProperty(property)) {
target[property] = this.flatForm[key];
}
};
for (const key in this.flatForm) {
let target = null;
const keys = key.split('-');
keys.forEach((val, i) => {
if (i === 2) {
if (/school$/.test(key)) {
if (myTarget.hasOwnProperty('schoolObey')) {
myTarget['schoolObey'] = this.flatForm[key]
}
updateTargetProperty(target, key, 'schoolObey');
} else if (/specialty$/.test(key)) {
if (myTarget.hasOwnProperty('specialtyObey')) {
myTarget['specialtyObey'] = this.flatForm[key]
}
}
} else if (i === 2) {
let myTarget = target.find(j => j[idName[i]] === Number(val))
if (val === 'code') {
if (myTarget.hasOwnProperty('code')) {
myTarget['code'] = this.flatForm[key]
}
} else if (val === 'value') {
if (myTarget.hasOwnProperty('value')) {
myTarget['value'] = this.flatForm[key]
}
updateTargetProperty(target, key, 'specialtyObey');
}
}
if (isNaN(Number(val))) {
if (isNaN(Number(val))) {
if (i === 3 || i === 4) {
if (val === 'code' || val === 'value') {
updateTargetProperty(target, key, val);
}
}
} else {
target = target ? target.find(j => j[idName[i]] === Number(val))[linkName[i]] : this.subForm.find(j => j[idName[i]] === Number(val))[linkName[i]]
target = (target && target[linkName[i - 1]])
? target[linkName[i - 1]].find(j => j[idName[i]] === Number(val))
: this.subForm.find(j => j[idName[i]] === Number(val));
}
}
});
}
this.$u.api.batchSubmit({
aspiration_id: this.aspiration.id,
@ -414,10 +531,11 @@ export default {
url: '/package_sub/pages/FormSuccess/FormSuccess',
params: {
title: "志愿填报",
redirect: '/pages/list/list'
redirect: '/pages/list/list',
type: 'switchTab'
}
})
})
});
});
}
},
computed: {
@ -443,7 +561,9 @@ export default {
this.setTitle()
},
created() {
this.getArea()
this.getArea().then(_ => {
this.getSchools()
})
},
}
</script>

@ -24,7 +24,11 @@
'letter-spacing': '3rpx',
color: '#fff',
'margin-top': '10vh'
}">返回列表</u-button>
}"
@click="$u.route({
url: redirect,
type: type
})">返回列表</u-button>
</view>
</view>
</template>
@ -34,7 +38,8 @@ export default {
data() {
return {
title: "填报",
redirect: '/pages/index/index'
redirect: 'pages/index/index',
type: 'switchTab'
};
},
onLoad(options) {
@ -46,7 +51,12 @@ export default {
if (options.redirect) {
this.redirect = options.redirect
} else {
this.redirect = '/pages/index/index'
this.redirect = 'pages/index/index'
}
if (options.type) {
this.type = options.type
} else {
this.type = 'switchTab'
}
}
}

@ -1,22 +0,0 @@
<template>
<view class="container">
<view class="wrap">
</view>
</view>
</template>
<script>
export default {
data() {
return {};
}
}
</script>
<style lang="scss">
.container {
min-height: 100vh;
background: #eaf8fe;
}
</style>

@ -75,13 +75,6 @@
"enablePullDownRefresh": true
}
},
{
"path": "pages/ReportDetail/ReportDetail",
"style": {
"navigationBarTitleText": "我的模拟填报",
"enablePullDownRefresh": true
}
},
{
"path": "pages/IndependentRecruitment/IndependentRecruitment",
"style": {
@ -102,6 +95,13 @@
"navigationBarTitleText": "志愿填报",
"enablePullDownRefresh": false
}
},
{
"path": "pages/BatchDetail/BatchDetail",
"style": {
"navigationBarTitleText": "我的模拟填报",
"enablePullDownRefresh": false
}
}
]
}

@ -15,10 +15,10 @@
<view class="list-item__body">
<view class="list-item__body--row">
所属区域吴中区
所属区域{{ (item.aspiration && item.aspiration.area) ? item.aspiration.area.name : '-' }}
</view>
<view class="list-item__body--row">
填报年份2025
填报年份{{ item.aspiration ? item.aspiration.year : '' }}
</view>
</view>
@ -36,9 +36,9 @@
'font-size': '24rpx'
}"
@click="$u.route({
url: '/package_sub/pages/ReportDetail/ReportDetail',
url: '/package_sub/pages/BatchDetail/BatchDetail',
params: {
id: ''
id: item.id
}
})">查看</u-button>
</view>
@ -81,6 +81,7 @@ export default {
const res = await this.$u.api.batchData(this.select);
console.log(res);
this.list.push(...res.list)
this.total = res.list.length
if (this.list.length >= res.total) {
this.status = 'nomore'
} else {
@ -94,7 +95,7 @@ export default {
} catch (err) {
console.error(err)
} finally {
uni.hideNavigationBarLoading()
uni.stopPullDownRefresh()
}
}
},
@ -158,7 +159,7 @@ export default {
padding: 26rpx 28rpx;
}
}
&-item + &-item {
.list-item + .list-item {
margin-top: 24rpx;
}
}

@ -12,7 +12,7 @@
</view>
<view class="panel">
<view class="row" v-if="vuex_user.mobile">
<view class="row" v-if="vuex_user.mobile" @click="$u.route({ url: 'pages/list/list', type: 'switchTab' })">
<image class="row__icon" src="~@/static/me/ico1.png" mode="aspectFill"></image>
<view class="row__text">我的模拟填报</view>
<view class="row__arrow">

Loading…
Cancel
Save