|
|
@ -73,7 +73,7 @@ |
|
|
|
<view class="lab">业务类型</view> |
|
|
|
<view class="rightCon"> |
|
|
|
<u-radio-group |
|
|
|
v-model="form.radiovalue1" |
|
|
|
v-model="form.businessType" |
|
|
|
> |
|
|
|
<u-radio |
|
|
|
:customStyle="{marginRight: '24rpx'}" |
|
|
@ -88,28 +88,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="card"> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">是否异地转入</view> |
|
|
|
<view class="rightCon" style="margin-left: 40rpx;"> |
|
|
|
<u-radio-group |
|
|
|
v-model="form.radiovalue2" |
|
|
|
@change="changeVal" |
|
|
|
> |
|
|
|
<u-radio |
|
|
|
:customStyle="{marginRight: '24rpx'}" |
|
|
|
v-for="(item, index) in radiolist2" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:name="item.id" |
|
|
|
> |
|
|
|
</u-radio> |
|
|
|
</u-radio-group> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="card" v-if="form.radiovalue1==2"> |
|
|
|
<view class="card" v-if="form.businessType==1"> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab long">原驾驶证号</view> |
|
|
|
<view class="rightCon"> |
|
|
@ -123,7 +102,7 @@ |
|
|
|
<view class="rightCon"> |
|
|
|
<view class="row" @click="showFirstLicenceTime=true" > |
|
|
|
<view class="val"> |
|
|
|
<mySelect :value="form.firstLicenceTime"/> |
|
|
|
<mySelect :value="form.firstDriveDate"/> |
|
|
|
</view> |
|
|
|
<view class="arrow"> |
|
|
|
<u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon> |
|
|
@ -146,6 +125,27 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="card"> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">是否异地转入</view> |
|
|
|
<view class="rightCon" style="margin-left: 40rpx;"> |
|
|
|
<u-radio-group |
|
|
|
v-model="form.radiovalue2" |
|
|
|
@change="changeVal" |
|
|
|
> |
|
|
|
<u-radio |
|
|
|
:customStyle="{marginRight: '24rpx'}" |
|
|
|
v-for="(item, index) in radiolist2" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:name="item.id" |
|
|
|
> |
|
|
|
</u-radio> |
|
|
|
</u-radio-group> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="card" v-if="form.radiovalue2==1"> |
|
|
|
<view class="row" @click="cityShowFn"> |
|
|
|
<view class="lab">来源城市</view> |
|
|
@ -165,7 +165,7 @@ |
|
|
|
<view class="rightCon"> |
|
|
|
<view class="row" @click="showSubjectPass=true"> |
|
|
|
<view class="val"> |
|
|
|
<mySelect :value="form.subjectPass"/> |
|
|
|
<mySelect :value="form.finishSubject"/> |
|
|
|
</view> |
|
|
|
<view class="arrow"> |
|
|
|
<u-icon name="arrow-right" size="14" color="#686B73" style="margin-left: 12rpx;" ></u-icon> |
|
|
@ -193,15 +193,7 @@ |
|
|
|
<view class="lab">学费</view> |
|
|
|
<view class="rightCon"> |
|
|
|
<view class="row"> |
|
|
|
<view class="val">¥100</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="row"> |
|
|
|
<view class="lab">合计</view> |
|
|
|
<view class="rightCon"> |
|
|
|
<view class="row"> |
|
|
|
<view class="val blue">¥100</view> |
|
|
|
<view class="val">¥{{ $u.utils.priceTo(form.totalAmount) }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -251,7 +243,7 @@ |
|
|
|
<view class="btnBg" @click="confirmClick">确认</view> |
|
|
|
</view> |
|
|
|
<u-popup :show="showPopup" mode="center" :round="8" > |
|
|
|
<comfigPopup @comfigClick="comfigClick"/> |
|
|
|
<comfigPopup @comfigClick="comfigClick" :info="form"/> |
|
|
|
</u-popup> |
|
|
|
|
|
|
|
<u-popup :show="showSchool" mode="bottom" :round="8" @close="showSchool=false"> |
|
|
@ -259,7 +251,7 @@ |
|
|
|
</u-popup> |
|
|
|
|
|
|
|
<!-- 选择班型 --> |
|
|
|
<u-picker :show="showClassModel" :columns="columnsClassModel" keyName="label" @confirm="confirmClassModel" @cancel="showClassModel=false"></u-picker> |
|
|
|
<u-picker :show="showClassModel" :columns="columnsClassModel" keyName="name" @confirm="confirmClassModel" @cancel="showClassModel=false"></u-picker> |
|
|
|
<!-- 选择车型 --> |
|
|
|
<u-picker :show="showCar" :columns="columnsCar" keyName="label" @confirm="confirmCar" :closeOnClickOverlay="true" @cancel="showCar=false"></u-picker> |
|
|
|
<!-- 原驾驶证初领日期 --> |
|
|
@ -270,7 +262,7 @@ |
|
|
|
</u-popup> |
|
|
|
<!-- 已过科目 --> |
|
|
|
<u-picker :show="showSubjectPass" :columns="columnsSubject" keyName="label" @confirm="confirmSubjectPass" @cancel="showSubjectPass=false"></u-picker> |
|
|
|
<!-- 待科目 --> |
|
|
|
<!-- 待学科目 --> |
|
|
|
<u-picker :show="showSubjectTreat" :columns="columnsSubject" keyName="label" @confirm="confirmTreat" @cancel="showSubjectTreat=false"></u-picker> |
|
|
|
<!-- 城市 --> |
|
|
|
<u-picker :show="showCity" ref="uPicker" :columns="[cityArr]" @confirm="confirmCity" @change="changeHandler" keyName="name"></u-picker> |
|
|
@ -282,7 +274,7 @@ |
|
|
|
import comfigPopup from './comp/comfigPopup' |
|
|
|
import searchSchool from './comp/searchSchool' |
|
|
|
import oldDrive from './comp/oldDrive' |
|
|
|
import { areaTree } from '@/config/api.js' |
|
|
|
import { areaTree, applyOnline, schoolClass } from '@/config/api.js' |
|
|
|
export default { |
|
|
|
components: { comfigPopup, searchSchool, oldDrive }, |
|
|
|
data() { |
|
|
@ -295,18 +287,7 @@ |
|
|
|
showOldDriveModel: false, |
|
|
|
showSubjectPass: false, |
|
|
|
showSubjectTreat: false, |
|
|
|
columnsClassModel: [ |
|
|
|
[ |
|
|
|
{ |
|
|
|
label: '普通班型', |
|
|
|
id: 1 |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'vip班型', |
|
|
|
id: 2 |
|
|
|
} |
|
|
|
] |
|
|
|
], |
|
|
|
columnsClassModel: [],//班型 |
|
|
|
columnsSubject: [ |
|
|
|
[ |
|
|
|
{label: '科目一', id: 1}, |
|
|
@ -320,26 +301,41 @@ |
|
|
|
classModel: '', |
|
|
|
car: '', |
|
|
|
coach: '', |
|
|
|
cardType: 1, |
|
|
|
idcard: '431027199009012316', |
|
|
|
nationality: '中国', |
|
|
|
businessType: '',//业务类型 |
|
|
|
certificateCodeShow: '原驾驶证号xxx', |
|
|
|
firstLicenceTime: '', |
|
|
|
oldDriveModel: '', |
|
|
|
driveLicence: '',//原驾驶证号 给后端的 |
|
|
|
firstDriveDate: '',//原驾驶证初领日期 |
|
|
|
sex: 2, |
|
|
|
phone: '18267412456', |
|
|
|
applyType: 1, |
|
|
|
name: '大乔', |
|
|
|
oldTrainType: '',//原准驾车型 |
|
|
|
subjectPass: '', |
|
|
|
subjectTreat: '', |
|
|
|
radiovalue2: 1, |
|
|
|
radiovalue1: 1, |
|
|
|
photoPath: '123.png', |
|
|
|
address: '湖南省,郴州市', |
|
|
|
totalAmount: 0 |
|
|
|
|
|
|
|
}, |
|
|
|
showSchool: false, |
|
|
|
radiolist1: [ {name: '初领', id: 1}, {name: '增驾', id: 2}], |
|
|
|
radiolist1: [ {name: '初领', id: 0}, {name: '增驾', id: 1}],//0:初领,1:增驾, |
|
|
|
radiolist2: [ {name: '是', id: 1}, {name: '否', id: 2}], |
|
|
|
radiolist3: [ {name: '全款', id: 1}, {name: '预付款', id: 2}], |
|
|
|
cityArr: [], |
|
|
|
cityArr2: [[]] |
|
|
|
cityArr2: [], |
|
|
|
cityArr3: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.form.accountId = this.userId |
|
|
|
this.form.userId = this.userId |
|
|
|
uni.$on('upDateCoachItem',(item)=>{ |
|
|
|
console.log(item) |
|
|
|
this.form.coach = item.name |
|
|
|
this.form.coachId = item.id |
|
|
|
}) |
|
|
|
this.areaTreeFn() |
|
|
|
let schoolClass = this.$store.state.school.schoolClass |
|
|
@ -359,14 +355,29 @@ |
|
|
|
this.form.schoolId = schoolCoach.schoolId |
|
|
|
// this.form.car = schoolClass.carType |
|
|
|
} |
|
|
|
if(this.form.schoolId) { |
|
|
|
this.schoolClassFn() |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async schoolClassFn() { |
|
|
|
const {data: res} = await schoolClass({pageNo: 1,pageSize: 100, schoolId: this.form.schoolId}) |
|
|
|
this.columnsClassModel = [res.list] |
|
|
|
console.log(this.columnsClassModel) |
|
|
|
}, |
|
|
|
cityShowFn() { |
|
|
|
this.showCity = true |
|
|
|
this.$nextTick(()=>{ |
|
|
|
let picker = this.$refs.uPicker |
|
|
|
picker.setColumnValues(1, this.cityArr2[0]) |
|
|
|
picker.setColumnValues(2, this.cityArr3[0][0]) |
|
|
|
}) |
|
|
|
|
|
|
|
// picker = this.$refs.uPicker |
|
|
|
}, |
|
|
|
changeHandler(e) { |
|
|
|
const { |
|
|
|
indexs, |
|
|
|
columnIndex, |
|
|
|
value, |
|
|
|
values, // values为当前变化列的数组内容 |
|
|
@ -378,7 +389,18 @@ |
|
|
|
if (columnIndex === 0) { |
|
|
|
// picker为选择器this实例,变化第二列对应的选项 |
|
|
|
picker.setColumnValues(1, this.cityArr2[index]) |
|
|
|
picker.setColumnValues(2, this.cityArr3[index][0]) |
|
|
|
} |
|
|
|
if (columnIndex === 1) { |
|
|
|
let index3 = indexs[0] |
|
|
|
// picker为选择器this实例,变化第二列对应的选项 |
|
|
|
picker.setColumnValues(2, (this.cityArr3[index3])[index]) |
|
|
|
} |
|
|
|
console.log(indexs[0]) |
|
|
|
// console.log(this.cityArr3[index3]) |
|
|
|
// console.log(value) |
|
|
|
// console.log(values) |
|
|
|
// console.log(columnIndex) |
|
|
|
}, |
|
|
|
// 回调参数为包含columnIndex、value、values |
|
|
|
confirmCity(e) { |
|
|
@ -387,17 +409,49 @@ |
|
|
|
}, |
|
|
|
// 获取地区 |
|
|
|
async areaTreeFn() { |
|
|
|
// this.cityArr2.push(this.traverse(item.children)) |
|
|
|
const {data: res} = await areaTree() |
|
|
|
this.cityArr = res.map(item=>{ |
|
|
|
let obj = { |
|
|
|
id: item.id, |
|
|
|
name: item.name |
|
|
|
} |
|
|
|
this.cityArr2[0].push(this.traverse(item.children)) |
|
|
|
return obj |
|
|
|
}) |
|
|
|
console.log(this.cityArr) |
|
|
|
console.log(this.cityArr2) |
|
|
|
|
|
|
|
this.cityArr2 = res.map(item2=>{ |
|
|
|
let arr2 = item2.children |
|
|
|
return arr2.map(val=>{ |
|
|
|
let obj = { |
|
|
|
id: val.id, |
|
|
|
name: val.name |
|
|
|
} |
|
|
|
return obj |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.cityArr3 = res.map(item2=>{ |
|
|
|
let arr2 = item2.children |
|
|
|
return arr2.map(val=>{ |
|
|
|
return val.children.map(val3=>{ |
|
|
|
let obj = { |
|
|
|
id: val3.id, |
|
|
|
name: val3.name |
|
|
|
} |
|
|
|
return obj |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
// for(let i=0; i<res.length; i++) { |
|
|
|
// let obj = { |
|
|
|
// id: res[i].id, |
|
|
|
// name: res[i].name |
|
|
|
// } |
|
|
|
// this.cityArr.push(obj) |
|
|
|
|
|
|
|
// console.log(this.cityArr) |
|
|
|
// console.log(this.cityArr2) |
|
|
|
console.log(this.cityArr3) |
|
|
|
// this.showCity = res |
|
|
|
}, |
|
|
|
traverse(arr, result=[]) { |
|
|
@ -421,13 +475,16 @@ |
|
|
|
this.columnsCar = [item.businessScope.split(',')] |
|
|
|
console.log(this.columnsCar) |
|
|
|
this.showSchool = false |
|
|
|
this.schoolClassFn() |
|
|
|
}, |
|
|
|
// 选择班型 |
|
|
|
confirmClassModel(val) { |
|
|
|
let item = val.value[0] |
|
|
|
console.log(item) |
|
|
|
this.showClassModel = false |
|
|
|
this.form.classModel = item.label |
|
|
|
this.form.classModel = item.name |
|
|
|
this.form.schoolClassId = item.id |
|
|
|
this.form.totalAmount = item.totalAmount |
|
|
|
}, |
|
|
|
// 选择车型 |
|
|
|
confirmCar(val) { |
|
|
@ -435,6 +492,7 @@ |
|
|
|
console.log(item) |
|
|
|
this.showCar = false |
|
|
|
this.form.car = item |
|
|
|
this.form.trainType = item |
|
|
|
}, |
|
|
|
showCarClick() { |
|
|
|
if(!this.form.school) return this.$u.toast('请先选择驾校') |
|
|
@ -448,19 +506,19 @@ |
|
|
|
// 选择原驾驶证初领日期 |
|
|
|
confirmFirstLicenceTime(val) { |
|
|
|
console.log(val) |
|
|
|
this.form.firstLicenceTime = uni.$u.timeFormat(val.value, 'yyyy-mm-dd'); |
|
|
|
this.form.firstDriveDate = uni.$u.timeFormat(val.value, 'yyyy-mm-dd'); |
|
|
|
this.showFirstLicenceTime = false |
|
|
|
}, |
|
|
|
// 选择原准驾车型 |
|
|
|
pickerOldDrive(val) { |
|
|
|
this.form.oldDriveModel = val |
|
|
|
this.form.oldTrainType = val |
|
|
|
this.showOldDriveModel = false |
|
|
|
console.log(val) |
|
|
|
}, |
|
|
|
// 选择已过科目 |
|
|
|
confirmSubjectPass(val) { |
|
|
|
let item = val.value[0] |
|
|
|
this.form.subjectPass = item.label |
|
|
|
this.form.finishSubject = item.label |
|
|
|
this.showSubjectPass = false |
|
|
|
}, |
|
|
|
// 选择已过科目 |
|
|
@ -488,9 +546,10 @@ |
|
|
|
this.showPopup = true |
|
|
|
}, |
|
|
|
|
|
|
|
comfigClick(val) { |
|
|
|
async comfigClick(val) { |
|
|
|
console.log(val) |
|
|
|
this.showPopup = false |
|
|
|
const {data: res} = await applyOnline(this.form) |
|
|
|
if(val) { |
|
|
|
this.$goPage('/pages/indexEntry/enroll/signContract/signContract') |
|
|
|
} |
|
|
|