完善报名单逻辑处理

main
jinna 2 years ago
parent d30135a833
commit 4d3be3c090
  1. 52
      pages/pages_zhentou/form/form.vue

@ -249,9 +249,9 @@
{ {
validateFunction: function(rule, value, data, callback) { validateFunction: function(rule, value, data, callback) {
// const moblie = /^(0{1}|[1-9]\d{0,3}|.{0})$/; // const moblie = /^(0{1}|[1-9]\d{0,3}|.{0})$/;
const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/ const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{0})?$/
if (!moblie.test(value)) { if (!moblie.test(value)) {
callback('请填写正确的身高'); callback('身高应为大于10的整数');
} else { } else {
return true; return true;
} }
@ -268,7 +268,7 @@
validateFunction: function(rule, value, data, callback) { validateFunction: function(rule, value, data, callback) {
const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/; const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/;
if (!moblie.test(value)) { if (!moblie.test(value)) {
callback('请填写正确的体重'); callback('体重应大于10斤且小数点最多为两位');
} else { } else {
return true; return true;
} }
@ -279,7 +279,8 @@
neckShoulderWidth:{ neckShoulderWidth:{
rules:[{ rules:[{
validateFunction: function(rule, value, data, callback) { validateFunction: function(rule, value, data, callback) {
const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/; // const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/;
const moblie = /^(\d|([1-9]\d+))(\.\d{1,2})?$/;
if (!moblie.test(value)) { if (!moblie.test(value)) {
callback('请填写正确的肩颈宽度'); callback('请填写正确的肩颈宽度');
} else { } else {
@ -291,7 +292,7 @@
neckLength:{ neckLength:{
rules:[{ rules:[{
validateFunction: function(rule, value, data, callback) { validateFunction: function(rule, value, data, callback) {
const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/; const moblie = /^(\d|([1-9]\d+))(\.\d{1,2})?$/;
if (!moblie.test(value)) { if (!moblie.test(value)) {
callback('请填写正确的颈椎长度'); callback('请填写正确的颈椎长度');
} else { } else {
@ -549,8 +550,11 @@
}, },
handlePrev() { handlePrev() {
this.currentNum = this.currentNum - 1; this.currentNum = this.currentNum - 1;
this.alreadyForm = JSON.parse(JSON.stringify(this.valiFormData)) ; // this.valiFormData = this.orderData[this.currentNum - 1];
this.valiFormData = this.orderData[this.currentNum - 1]; if(this.currentNum == this.orderData.length){
this.alreadyForm = JSON.parse(JSON.stringify(this.valiFormData)) ;
}
if (!this.valiFormData) { if (!this.valiFormData) {
this.valiFormData = {}; this.valiFormData = {};
this.$nextTick(() =>{ this.$nextTick(() =>{
@ -589,13 +593,36 @@
icon:'none' icon:'none'
}) })
}else{ }else{
this.currentNum = this.currentNum + 1 this.currentNum = this.currentNum + 1;
this.isDisabled = false; console.log('this.alreadyForm ==>',this.alreadyForm)
if(JSON.stringify(this.alreadyForm) == '{}'){ console.log('currentNum==>',this.currentNum)
this.valiFormData = this.valiFormData if(this.currentNum > this.orderData.length){
this.valiFormData = JSON.parse(JSON.stringify(this.orderData[this.currentNum - 2]));
this.valiFormData.id = '';
this.isDisabled = false;
console.log('123')
if(JSON.stringify(this.alreadyForm) == '{}'){
console.log('456')
this.valiFormData = this.valiFormData
}else{
this.valiFormData = this.alreadyForm
}
}else{ }else{
this.valiFormData = this.alreadyForm this.valiFormData = JSON.parse(JSON.stringify(this.orderData[this.currentNum - 1]));
this.isDisabled = true;
} }
// this.valiFormData = this.orderData[this.currentNum - 1];
// if (!this.valiFormData) {
// }else{
// this.isDisabled = true;
// }
// if(JSON.stringify(this.alreadyForm) == '{}'){
// this.valiFormData = this.valiFormData
// }else{
// this.valiFormData = this.alreadyForm
// }
} }
// console.log(this.currentNum) // console.log(this.currentNum)
// this.currentNum = this.currentNum + 1 // this.currentNum = this.currentNum + 1
@ -804,6 +831,7 @@
icon: 'none' icon: 'none'
}); });
this.valiFormData = {}, this.valiFormData = {},
this.alreadyForm = {}
this.multiIndex[0, 0, 0]; this.multiIndex[0, 0, 0];
this.city = '' this.city = ''
this.province = ''; this.province = '';

Loading…
Cancel
Save