|
@@ -441,41 +441,45 @@
|
|
|
})
|
|
|
return true
|
|
|
}
|
|
|
- if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "挂车行驶证主页不能为空!",
|
|
|
- })
|
|
|
- return true
|
|
|
- }
|
|
|
- if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "挂车行驶证副页不能为空!",
|
|
|
- })
|
|
|
- return true
|
|
|
- }
|
|
|
- if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "行驶证副页不能为空!",
|
|
|
- })
|
|
|
- return true
|
|
|
- }
|
|
|
- if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "挂车行驶证档案编号不能为空!",
|
|
|
- })
|
|
|
- return true
|
|
|
- }
|
|
|
- if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "挂车行驶证有效期不能为空!",
|
|
|
- })
|
|
|
- return true
|
|
|
+ if(this.radiovalue=='挂车司机'){
|
|
|
+ if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "挂车行驶证主页不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "挂车行驶证副页不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "挂车行驶证档案编号不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "挂车行驶证有效期不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
|
|
|
+ // this.$refs.uToast.show({
|
|
|
+ // type: 'error',
|
|
|
+ // message: "行驶证副页不能为空!",
|
|
|
+ // })
|
|
|
+ // return true
|
|
|
+ // }
|
|
|
+
|
|
|
if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
|
|
|
this.$refs.uToast.show({
|
|
|
type: 'error',
|
|
@@ -511,26 +515,28 @@
|
|
|
})
|
|
|
return true
|
|
|
}
|
|
|
- if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "挂车道路运输证不能为空!",
|
|
|
- })
|
|
|
- return true
|
|
|
- }
|
|
|
- if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "挂车道路运输证号不能为空!",
|
|
|
- })
|
|
|
- return true
|
|
|
- }
|
|
|
- if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "挂车道路运输证有效期不能为空!",
|
|
|
- })
|
|
|
- return true
|
|
|
+ if(this.radiovalue=='挂车司机'){
|
|
|
+ if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "挂车道路运输证不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "挂车道路运输证号不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "挂车道路运输证有效期不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|
|
|
return false
|
|
|
},
|
|
@@ -539,7 +545,7 @@
|
|
|
|
|
|
// 校验
|
|
|
if (this.validate()) return
|
|
|
- debugger
|
|
|
+ // debugger
|
|
|
if(this.dataDetails.driverSex=='男'){
|
|
|
this.dataDetails.driverCall = this.dataDetails.driverCall+'先生'
|
|
|
}else{
|
|
@@ -556,11 +562,12 @@
|
|
|
|
|
|
|
|
|
this.$request.baseRequest('post', '/driverInfo/api/addInfo', this.dataDetails).then(res => {
|
|
|
- if(res.data.code==200){
|
|
|
+ if(res.code==200){
|
|
|
uni.$u.route('/pages/mine/index');
|
|
|
+ }else{
|
|
|
+ uni.$u.toast(res.message);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
})
|
|
|
.catch(res => {
|
|
|
uni.$u.toast(res.message);
|