refector: 时间范围校验及默认选择
This commit is contained in:
parent
03990b8fba
commit
f3fccd4da2
|
@ -116,6 +116,7 @@
|
|||
|
||||
<script>
|
||||
var that;
|
||||
import getStartAndEnd from '../../../utils/getTime.js';
|
||||
import baTreePicker from "../../comm/ba-tree-picker/ba-tree-picker.vue";
|
||||
import nonNullCheck from '../../../utils/nonNullCheck.js';
|
||||
import resetData from '../../../utils/common.js';
|
||||
|
@ -181,6 +182,7 @@
|
|||
this.showBtns = false;
|
||||
}
|
||||
}else{
|
||||
this.datetimerange = getStartAndEnd()
|
||||
this.showBtns = true;
|
||||
}
|
||||
},
|
||||
|
@ -357,6 +359,14 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
if (this.formData.start_time>=this.formData.end_time){
|
||||
uni.showToast({
|
||||
title: '时间选择范围错误',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!nonNullCheck(this.formData.state_work)) {
|
||||
uni.showToast({
|
||||
title: '请选择生产状态',
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import getStartAndEnd from '../../../utils/getTime.js';
|
||||
import nonNullCheck from '../../../utils/nonNullCheck.js';
|
||||
import baTreePicker from "../../comm/ba-tree-picker/ba-tree-picker.vue";
|
||||
export default {
|
||||
|
@ -144,6 +145,7 @@
|
|||
this.showBtns = false;
|
||||
}
|
||||
}else{
|
||||
this.datetimerange = getStartAndEnd()
|
||||
this.showBtns = true;
|
||||
}
|
||||
},
|
||||
|
@ -277,6 +279,13 @@
|
|||
})
|
||||
return false;
|
||||
}
|
||||
if (this.formData.come_time>=this.formData.leave_time){
|
||||
uni.showToast({
|
||||
title: '时间选择范围错误',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
// if (!nonNullCheck(this.formData.belong_dept)) {
|
||||
// uni.showToast({
|
||||
|
|
|
@ -112,6 +112,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import getStartAndEnd from '../../../utils/getTime.js';
|
||||
import nonNullCheck from '../../../utils/nonNullCheck.js';
|
||||
import resetData from '../../../utils/common.js';
|
||||
export default {
|
||||
|
@ -176,6 +177,7 @@
|
|||
this.formData.visit_time = this.datetimerange[0]
|
||||
this.formData.leave_time = this.datetimerange[1]
|
||||
},
|
||||
|
||||
},
|
||||
onLoad(params) {
|
||||
if (params.visit) {
|
||||
|
@ -188,6 +190,7 @@
|
|||
this.showBtns = true;
|
||||
}
|
||||
} else {
|
||||
this.datetimerange = getStartAndEnd()
|
||||
this.showBtns = true;
|
||||
}
|
||||
},
|
||||
|
@ -324,6 +327,13 @@
|
|||
})
|
||||
return false;
|
||||
}
|
||||
if (this.formData.visit_time>=this.formData.leave_time){
|
||||
uni.showToast({
|
||||
title: '时间选择范围错误',
|
||||
icon: "none"
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (!nonNullCheck(this.formData.receptionist) && this.formData.purpose!=50) {
|
||||
uni.showToast({
|
||||
title: '请选择接待人',
|
||||
|
|
Loading…
Reference in New Issue