|
@@ -2,7 +2,14 @@
|
|
|
<view style="padding: 30rpx;">
|
|
|
<uni-forms ref="formRef" :modelValue="formData" :rules="formRules" validateTrigger="bind" label-width="80px" label-align="right" label-position="left">
|
|
|
<uni-forms-item name="time" label="面试时间" required>
|
|
|
- <uni-datetime-picker v-model="formData.time" type="datetime" :border="true" returnType="timestamp" :hide-second="true" />
|
|
|
+ <uni-datetime-picker
|
|
|
+ v-model="formData.time"
|
|
|
+ type="datetime"
|
|
|
+ :border="true"
|
|
|
+ returnType="timestamp"
|
|
|
+ :hide-second="true"
|
|
|
+ @change="handleDate"
|
|
|
+ />
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item name="jobId" label="招聘职位" required>
|
|
|
<view style="max-width: calc(100vw - 110px);">
|
|
@@ -84,6 +91,18 @@ const handleChangeJob = (e) => {
|
|
|
if (channerl.value && Object.keys(channerl.value).length > 0) formData.value.positionInfo = job
|
|
|
}
|
|
|
|
|
|
+const handleDate = (val) => {
|
|
|
+ const selectedDate = new Date(val)
|
|
|
+ const currentDate = new Date()
|
|
|
+ if (selectedDate < currentDate) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '面试时间不得小于当前时间',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const channerl = ref({})
|
|
|
onLoad(async (options) => {
|
|
|
// 编辑面试、重新邀约
|
|
@@ -136,6 +155,17 @@ const handleSubmit = async () => {
|
|
|
const valid = await unref(formRef).validate()
|
|
|
if (!valid) return
|
|
|
|
|
|
+ const selectedDate = new Date(formData.value.time)
|
|
|
+ const currentDate = new Date()
|
|
|
+ if (selectedDate < currentDate) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '面试时间不得小于当前时间',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
uni.showLoading({ title: '提交中' })
|
|
|
try {
|
|
|
await saveInterviewInvite(formData.value)
|