Browse Source

计量期必填

duy 1 year ago
parent
commit
acab2e25f7
1 changed files with 11 additions and 2 deletions
  1. 11 2
      src/views/debit-pay/admin/components/certificate/addModal.vue

+ 11 - 2
src/views/debit-pay/admin/components/certificate/addModal.vue

@@ -39,7 +39,7 @@
 <script setup>
 import { ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
-import { getArrValue } from 'js-fast-way'
+import { formValidate, getArrValue } from 'js-fast-way'
 import mainApi from '~api/debit-pay/admin/certificate'
 
 //事件
@@ -104,10 +104,19 @@ watch(isShow, (val) => {
 //表单数据
 const formRef = ref(null)
 const formModel = ref({})
-const formRules = {}
+const formRules = {
+    contractPeriodId: {
+        required: true,
+        trigger: 'blur',
+        message: '请选择计量期',
+    },
+
+}
 
 //保存
 const addModalSave = async () => {
+    const isValidate = await formValidate(formRef.value)
+    if (!isValidate) return false
     const form = formModel.value
     form.projectId = projectId.value
     form.contractId = contractId.value