8
0
ZaiZai 10 месяцев назад
Родитель
Сommit
03879e3114
2 измененных файлов с 13 добавлено и 7 удалено
  1. 4 3
      src/views/project/info/detail.vue
  2. 9 4
      src/views/project/info/info.vue

+ 4 - 3
src/views/project/info/detail.vue

@@ -2,7 +2,7 @@
     <hc-drawer v-model="isShow" to-id="hc-project-list" is-close @close="drawerClose">
         <div class="hc-project-info-drawer relative h-full">
             <hc-tab-card scrollbar :tabs="tabsData" :tab-key="tabsKey" is-action-btn :disabled="isDisabled" @change="tabsChange">
-                <HcInfo v-if="tabsKey === '1'" v-model="basicForm" />
+                <HcInfo v-if="tabsKey === '1'" ref="infoRef" v-model="basicForm" />
                 <template #action>
                     <el-button hc-btn class="mr-4" :loading="submitLoading" @click="saveAndExit">保存并退出</el-button>
                     <el-button hc-btn type="primary" :loading="submitLoading" @click="saveAndNextStep">保存并进入下一步</el-button>
@@ -14,9 +14,9 @@
 
 <script setup>
 import { ref, watch } from 'vue'
-import { getArrValue, isNullES } from 'js-fast-way'
 import HcInfo from './info.vue'
 import mainApi from '~api/project/tree'
+import { getArrValue, isNullES } from 'js-fast-way'
 
 const props = defineProps({
     data: {
@@ -78,9 +78,10 @@ const saveAndNextStep = async () => {
 }
 
 //保存数据
+const infoRef = ref(null)
 const submitLoading = ref(false)
 const saveDataApi = async () => {
-
+    console.log('saveDataApi', basicForm.value)
 }
 
 //关闭抽屉

+ 9 - 4
src/views/project/info/info.vue

@@ -86,7 +86,7 @@
 </template>
 
 <script setup>
-import { getArrValue } from 'js-fast-way'
+import { formValidate, getArrValue } from 'js-fast-way'
 import { onMounted, ref, watch } from 'vue'
 import { getDictionaryData } from '~uti/tools'
 import measureApi from '~api/measure/template'
@@ -136,8 +136,13 @@ const getBusinessUserOpinion = async () => {
     const { data } = await measureApi.queryBusinessUserOpinionList()
     meterTemplateOption.value = getArrValue(data)
 }
-</script>
 
-<style scoped lang="scss">
+//验证表单
+const isForm = async () => {
+    return await formValidate(formRef.value)
+}
 
-</style>
+defineExpose({
+    isForm,
+})
+</script>