|
@@ -13,7 +13,18 @@
|
|
|
</template>
|
|
|
|
|
|
|
|
|
- 表单填报页内容
|
|
|
+ <div class="hc-content-box h-full">
|
|
|
+ <div class="hc-table-form-box h-full">
|
|
|
+ <HcTableForm
|
|
|
+ ref="tableFormRef"
|
|
|
+ :form="tableFormData"
|
|
|
+ :html="excelHtmlData"
|
|
|
+ :loading="loading"
|
|
|
+ :pkey="excelIdVal"
|
|
|
+ @render="tableFormRender"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</hc-card>
|
|
|
</template>
|
|
|
<template #tab-two>
|
|
@@ -25,6 +36,8 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref } from 'vue'
|
|
|
+import { getExcelHtml } from '~api/other'
|
|
|
+import { isString } from 'js-fast-way'
|
|
|
//类型处理
|
|
|
const tabsKey = ref('one')
|
|
|
const tabsData = ref([
|
|
@@ -36,6 +49,10 @@ const tabsData = ref([
|
|
|
|
|
|
const tabsChange = (item) => {
|
|
|
console.log(item)
|
|
|
+ if (tabsKey.value === 'one') {
|
|
|
+ getExcelHtmlData()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
const pdfUrl = ref('')
|
|
|
const saveClick = () => {
|
|
@@ -45,6 +62,36 @@ const saveClick = () => {
|
|
|
const reportClick = () => {
|
|
|
console.log('上报')
|
|
|
}
|
|
|
+//表单填报
|
|
|
+const tableFormRef = ref(null)
|
|
|
+const tableFormData = ref({})
|
|
|
+
|
|
|
+const excelIdVal = ref('')
|
|
|
+const loading = ref(false)
|
|
|
+const isTableForm = ref(false)
|
|
|
+
|
|
|
+const excelHtmlData = ref('')
|
|
|
+const getExcelHtmlData = async (excelId) => {
|
|
|
+
|
|
|
+ //获取数据
|
|
|
+ const { error, code, data } = await getExcelHtml({
|
|
|
+
|
|
|
+ pkeyId: '1905193952357646337',
|
|
|
+ }, false)
|
|
|
+ //处理数据
|
|
|
+ const resData = isString(data) ? data || '' : ''
|
|
|
+ if (!error && code === 200 && resData) {
|
|
|
+ excelHtmlData.value = resData
|
|
|
+ } else {
|
|
|
+ excelHtmlData.value = ''
|
|
|
+ isTableForm.value = false
|
|
|
+ window?.$message?.warning('暂无表单')
|
|
|
+ }
|
|
|
+ }
|
|
|
+//渲染表单完成
|
|
|
+const tableFormRender = (form) => {
|
|
|
+ isTableForm.value = form.isRenderForm
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style>
|