|
|
|
|
@ -16,6 +16,21 @@
|
|
|
|
|
}"
|
|
|
|
|
@click="isShowTime = true"></u-input>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="user-form">
|
|
|
|
|
<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">
|
|
|
|
|
<u-input v-model="form.name" placeholder="请输入" input-align="right" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="准考证" required prop="examination_number">
|
|
|
|
|
<u-input v-model="form.examination_number" placeholder="请输入" input-align="right" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="毕业学校" required prop="finish_school">
|
|
|
|
|
<u-input v-model="form.finish_school" placeholder="请输入" input-align="right" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-form>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="area-pick">
|
|
|
|
|
<view class="area-pick__title">所在区域</view>
|
|
|
|
|
<view class="area-pick__panel">
|
|
|
|
|
@ -78,10 +93,10 @@
|
|
|
|
|
</view>
|
|
|
|
|
<view class="sub-form1__row">
|
|
|
|
|
<view class="sub-form1__col1">
|
|
|
|
|
<u-input :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"></u-input>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="sub-form1__col2">
|
|
|
|
|
<u-input :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"></u-input>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -99,15 +114,15 @@
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="sub-form2__row" v-for="spec in school.specialty" :key="spec.number">
|
|
|
|
|
<view class="sub-form2__row" v-for="(spec, specIndex) in school.specialty" :key="spec.number">
|
|
|
|
|
<view class="sub-form2__col1">
|
|
|
|
|
{{ spec.number }}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="sub-form2__col2">
|
|
|
|
|
<u-input :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"></u-input>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="sub-form2__col3">
|
|
|
|
|
<u-input :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}-name`]" :height="50" border border-color="#e0e0e0" input-align="center" :clearable="false"></u-input>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -116,9 +131,9 @@
|
|
|
|
|
<view>
|
|
|
|
|
其他专业是否服从
|
|
|
|
|
</view>
|
|
|
|
|
<u-radio-group>
|
|
|
|
|
<u-radio name="是">是</u-radio>
|
|
|
|
|
<u-radio name="是">否</u-radio>
|
|
|
|
|
<u-radio-group v-model="flatForm[`${currentBatch.id}-${item.id}-specialty`]">
|
|
|
|
|
<u-radio name="1">是</u-radio>
|
|
|
|
|
<u-radio name="0">否</u-radio>
|
|
|
|
|
</u-radio-group>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -127,9 +142,9 @@
|
|
|
|
|
<view>
|
|
|
|
|
其他院校是否服从
|
|
|
|
|
</view>
|
|
|
|
|
<u-radio-group>
|
|
|
|
|
<u-radio name="是">是</u-radio>
|
|
|
|
|
<u-radio name="是">否</u-radio>
|
|
|
|
|
<u-radio-group v-model="flatForm[`${currentBatch.id}-${item.id}-school`]">
|
|
|
|
|
<u-radio name="1">是</u-radio>
|
|
|
|
|
<u-radio name="0">否</u-radio>
|
|
|
|
|
</u-radio-group>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -176,7 +191,7 @@
|
|
|
|
|
'color': '#fff',
|
|
|
|
|
'margin-left': '64rpx'
|
|
|
|
|
}"
|
|
|
|
|
@click="">提交</u-button>
|
|
|
|
|
@click="isShowModal = true">提交</u-button>
|
|
|
|
|
</template>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -193,6 +208,7 @@
|
|
|
|
|
second: false
|
|
|
|
|
}"
|
|
|
|
|
@confirm="e => form.year = e.year"></u-picker>
|
|
|
|
|
<u-modal v-model="isShowModal" content="确认提交数据?" show-cancel-button @confirm="submit"></u-modal>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -200,10 +216,14 @@
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
isShowModal: false,
|
|
|
|
|
step: 1,
|
|
|
|
|
isShowTime: false,
|
|
|
|
|
areaList: [],
|
|
|
|
|
form: {
|
|
|
|
|
name: "",
|
|
|
|
|
finish_school: "",
|
|
|
|
|
examination_number: "",
|
|
|
|
|
area_id: "",
|
|
|
|
|
year: new Date().getFullYear().toString(),
|
|
|
|
|
aspiration_id: ""
|
|
|
|
|
@ -215,6 +235,7 @@ export default {
|
|
|
|
|
batchSub: {},
|
|
|
|
|
|
|
|
|
|
subForm: [],
|
|
|
|
|
flatForm: {},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -242,13 +263,14 @@ export default {
|
|
|
|
|
name: subSchool.number,
|
|
|
|
|
code: "",
|
|
|
|
|
value: "",
|
|
|
|
|
specialties: subSchool.specialty?.map(spec => ({
|
|
|
|
|
specialties: subSchool.specialty?.map((spec, specIndex) => ({
|
|
|
|
|
specialtyId: specIndex,
|
|
|
|
|
code: "",
|
|
|
|
|
value: ""
|
|
|
|
|
}))
|
|
|
|
|
})),
|
|
|
|
|
isSpecialtyObey: 1,
|
|
|
|
|
isSchoolObey: 1
|
|
|
|
|
specialtyObey: "1",
|
|
|
|
|
schoolObey: "1"
|
|
|
|
|
}))
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err)
|
|
|
|
|
@ -256,7 +278,45 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.currentBatchId = batchId
|
|
|
|
|
|
|
|
|
|
console.log(44, this.subForm)
|
|
|
|
|
const resolveData = (batch) => {
|
|
|
|
|
const myBatchId = batch.batchId
|
|
|
|
|
if (batch.batchSubs && batch.batchSubs.length > 0) {
|
|
|
|
|
batch.batchSubs.forEach(batchSub => {
|
|
|
|
|
const myBatchSubId = batchSub.batchSubId
|
|
|
|
|
if (!this.flatForm.hasOwnProperty(`${myBatchId}-${myBatchSubId}-specialty`)) {
|
|
|
|
|
this.flatForm[`${myBatchId}-${myBatchSubId}-specialty`] = "1"
|
|
|
|
|
}
|
|
|
|
|
if (!this.flatForm.hasOwnProperty(`${myBatchId}-${myBatchSubId}-school`)) {
|
|
|
|
|
this.flatForm[`${myBatchId}-${myBatchSubId}-school`] = "1"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (batchSub.batchSubSchools && batchSub.batchSubSchools.length > 0) {
|
|
|
|
|
batchSub.batchSubSchools.forEach(batchSubSchool => {
|
|
|
|
|
const myBatchSubSchoolId = batchSubSchool.batchSubSchoolId
|
|
|
|
|
if (!this.flatForm.hasOwnProperty(`${myBatchId}-${myBatchSubId}-${myBatchSubSchoolId}-value`)) {
|
|
|
|
|
this.flatForm[`${myBatchId}-${myBatchSubId}-${myBatchSubSchoolId}-value`] = ''
|
|
|
|
|
}
|
|
|
|
|
if (!this.flatForm.hasOwnProperty(`${myBatchId}-${myBatchSubId}-${myBatchSubSchoolId}-code`)) {
|
|
|
|
|
this.flatForm[`${myBatchId}-${myBatchSubId}-${myBatchSubSchoolId}-code`] = ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (batchSubSchool.specialties && batchSubSchool.specialties.length > 0) {
|
|
|
|
|
batchSubSchool.specialties.forEach(specialty => {
|
|
|
|
|
const mySpecialtyId = specialty.specialtyId
|
|
|
|
|
if (!this.flatForm.hasOwnProperty(`${myBatchId}-${myBatchSubId}-${myBatchSubSchoolId}-${mySpecialtyId}-value`)) {
|
|
|
|
|
this.flatForm[`${myBatchId}-${myBatchSubId}-${myBatchSubSchoolId}-${mySpecialtyId}-value`] = ''
|
|
|
|
|
}
|
|
|
|
|
if (!this.flatForm.hasOwnProperty(`${myBatchId}-${myBatchSubId}-${myBatchSubSchoolId}-${mySpecialtyId}-code`)) {
|
|
|
|
|
this.flatForm[`${myBatchId}-${myBatchSubId}-${myBatchSubSchoolId}-${mySpecialtyId}-code`] = ''
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.subForm.forEach(batch => resolveData(batch))
|
|
|
|
|
},
|
|
|
|
|
async getConfig () {
|
|
|
|
|
try {
|
|
|
|
|
@ -304,6 +364,61 @@ export default {
|
|
|
|
|
console.error(err)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
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))
|
|
|
|
|
if (/school$/.test(key)) {
|
|
|
|
|
if (myTarget.hasOwnProperty('schoolObey')) {
|
|
|
|
|
myTarget['schoolObey'] = this.flatForm[key]
|
|
|
|
|
}
|
|
|
|
|
} 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]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isNaN(Number(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]]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$u.api.batchSubmit({
|
|
|
|
|
aspiration_id: this.aspiration.id,
|
|
|
|
|
data: this.subForm,
|
|
|
|
|
name: this.form.name,
|
|
|
|
|
finish_school: this.form.finish_school,
|
|
|
|
|
examination_number: this.form.examination_number,
|
|
|
|
|
}).then(_ => {
|
|
|
|
|
this.$u.route({
|
|
|
|
|
url: '/package_sub/pages/FormSuccess/FormSuccess',
|
|
|
|
|
params: {
|
|
|
|
|
title: "志愿填报",
|
|
|
|
|
redirect: '/pages/list/list'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
formArea() {
|
|
|
|
|
@ -374,6 +489,27 @@ export default {
|
|
|
|
|
margin-left: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.user-form {
|
|
|
|
|
background: #fff;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin: 40rpx 24rpx 0;
|
|
|
|
|
padding: 32rpx 75rpx 32rpx 46rpx;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
filter: drop-shadow(-2.179rpx 3.355rpx 2.5rpx rgba(208, 209, 209, 0.3));
|
|
|
|
|
|
|
|
|
|
&__title {
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
color: #333333;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&__input {
|
|
|
|
|
flex: 1;
|
|
|
|
|
margin-left: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.area-pick {
|
|
|
|
|
margin: 0 24rpx;
|
|
|
|
|
|