huangbin před 4 roky
rodič
revize
674b6279f9

+ 3 - 1
src/views/order/spot_warran/components/spot_warrant_spot_details/components/pick_up/interface.ts

@@ -1,5 +1,7 @@
+import { Moment } from 'moment';
+import { Ref } from 'vue';
 export interface FormParam {
-    AppointmentDate: string,
+    AppointmentDate: Ref<Moment | undefined>,
     ContactName: string,
     ContactNum: string,
     AppointmentRemark: string,

+ 8 - 2
src/views/order/spot_warran/components/spot_warrant_spot_details/components/pick_up/setup.ts

@@ -1,17 +1,23 @@
+import { validateCommon } from "@/common/setup/validate";
+import { RuleObject } from "ant-design-vue/lib/form/interface";
+import { Moment } from "moment";
 import { reactive, ref, UnwrapRef } from "vue";
 import { FormParam } from "./interface";
 
 export function handleForm() {
     const formRef = ref();
     const formState: UnwrapRef<FormParam> = reactive({
-        AppointmentDate: '',
+        AppointmentDate: ref<Moment>(),
         ContactName: '',
         ContactNum: '',
         AppointmentRemark: '',
         OutQty: 0,
     })
+    const v_group = async (rule: RuleObject, value: number) => {
+        return validateCommon(value, '请选择预约日期');
+    };
     const rules = {
-        AppointmentDate: [{ required: true, message: '请输入预约日期', trigger: 'change' }],
+        AppointmentDate: [{ required: true, validator: v_group, trigger: 'change' }],
         ContactName: [{ required: true, message: '请输入提货人', trigger: 'blur' }],
         ContactNum: [{ required: true, message: '请输入联系方式', trigger: 'blur' }],
         OutQty: [{ required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number', min: 1, }],