|
|
@@ -332,22 +332,35 @@ export default {
|
|
|
this.isFocusOne = false;
|
|
|
this.$nextTick(()=>{
|
|
|
|
|
|
+ //取消
|
|
|
if (val.index === 0) {
|
|
|
- this.delAllEvent(this.customData)
|
|
|
+ if(this.customData.bigCount>0 || this.customData.smallCount>0){
|
|
|
+ }else{
|
|
|
+ this.delAllEvent(this.customData)
|
|
|
+ }
|
|
|
this.modalCancel();
|
|
|
return false
|
|
|
}
|
|
|
- if(this.customData.bigCount==0 && this.customData.smallCount==0){
|
|
|
- uni.showToast({title: '请填写花材数量',icon: "none"})
|
|
|
- return
|
|
|
+
|
|
|
+ //二个都不是数值
|
|
|
+ if(/(^[1-9]\d*$)/.test(this.customData.bigCount) == false && /(^[1-9]\d*$)/.test(this.customData.smallCount) == false){
|
|
|
+ this.delAllEvent(this.customData)
|
|
|
+ this.modalCancel();
|
|
|
+ return;
|
|
|
}
|
|
|
- if(this.customData.bigCount==null && this.customData.smallCount==null){
|
|
|
- uni.showToast({title: '请填写花材数量',icon: "none"})
|
|
|
- return
|
|
|
+
|
|
|
+ if(/(^[1-9]\d*$)/.test(this.customData.bigCount)){
|
|
|
+ if(this.customData.bigCount<=0){
|
|
|
+ uni.showToast({title:"数量要大于0",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
- if(this.customData.bigCount<0 || this.customData.smallCount<0){
|
|
|
- uni.showToast({title: '数量填写错误',icon: "none"})
|
|
|
- return
|
|
|
+
|
|
|
+ if(/(^[1-9]\d*$)/.test(this.customData.smallCount)){
|
|
|
+ if(this.customData.smallCount<=0){
|
|
|
+ uni.showToast({title:"数量要大于0",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.customData;
|