...
|
...
|
@@ -696,10 +696,10 @@ export default { |
|
|
this.$refs['product'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.table.showValidateOtherProps = false;
|
|
|
resolve();
|
|
|
resolve(true);
|
|
|
} else {
|
|
|
this.table.showValidateOtherProps = true;
|
|
|
reject();
|
|
|
resolve(false);
|
|
|
}
|
|
|
})
|
|
|
}).catch(() => {});
|
...
|
...
|
@@ -737,10 +737,10 @@ export default { |
|
|
|
|
|
if (errors.length !== 0) {
|
|
|
_this.table.showValidateTable = false;
|
|
|
return resolve();
|
|
|
return resolve(false);
|
|
|
} else {
|
|
|
_this.table.showValidateTable = true;
|
|
|
return reject(errors);
|
|
|
return reject(true);
|
|
|
}
|
|
|
|
|
|
}).catch((err) => {
|
...
|
...
|
@@ -752,11 +752,11 @@ export default { |
|
|
return new Promise((resolve, reject) => {
|
|
|
if (_this.table.selectedColors.length === 0) {
|
|
|
this.table.showValidateColor = true;
|
|
|
return reject({message: '颜色不能为空'})
|
|
|
return resolve(false);
|
|
|
}
|
|
|
|
|
|
this.table.showValidateColor = false;
|
|
|
return resolve();
|
|
|
return resolve(true);
|
|
|
}).catch((err) => {
|
|
|
});
|
|
|
|
...
|
...
|
@@ -765,29 +765,27 @@ export default { |
|
|
return new Promise((resolve, reject) => {
|
|
|
if (this.table.selectedSizes.length === 0) {
|
|
|
this.table.showValidateSize = true;
|
|
|
return reject({message: '尺码不能为空'});
|
|
|
return reject(false);
|
|
|
}
|
|
|
|
|
|
this.table.showValidateSize = false;
|
|
|
return resolve();
|
|
|
return resolve(true);
|
|
|
}).catch(() => {
|
|
|
});
|
|
|
},
|
|
|
validate: function() {
|
|
|
return this.validateOtherProps()
|
|
|
.then(this.validateColor)
|
|
|
.then(this.validateSize)
|
|
|
.then(this.validateTable)
|
|
|
.then(() => {
|
|
|
if (!this.showValidateColor
|
|
|
&& !this.showValidateSize
|
|
|
&& !this.showValidateOtherProp
|
|
|
&& !this.showValidateTable) {
|
|
|
return Promise.resolve();
|
|
|
} else {
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
});
|
|
|
return Promise.all([
|
|
|
this.validateOtherProps(),
|
|
|
this.validateColor(),
|
|
|
this.validateSize(),
|
|
|
this.validateTable()
|
|
|
]).then((valid) => {
|
|
|
if (valid[0] && valid[1] && valid[2] && valid[3] && valid[4]) {
|
|
|
return Promise.resolve();
|
|
|
} else {
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
...
|
...
|
|