ZaiZai 2 vuotta sitten
vanhempi
commit
7c9fc1359e
2 muutettua tiedostoa jossa 45 lisäystä ja 2 poistoa
  1. 29 2
      pages/data-fill/editTable.vue
  2. 16 0
      pages/ledger/editTable.vue

+ 29 - 2
pages/data-fill/editTable.vue

@@ -1,6 +1,6 @@
 <template>
     <hc-sys id="app-sys" class="h-full hc-uni-app-table-form" :isNavBar="false">
-        <view id="title-bar" class="title-bar">
+        <view id="title-bar" class="title-bar z-24">
             <button type="primary" class="title-bar-btn" @click="editTypeClick">切换</button>
             <button type="primary" class="title-bar-btn" @click="toCopyClick">复制</button>
             <button type="primary" class="title-bar-btn" @click="toHideClick">隐藏</button>
@@ -24,7 +24,6 @@ import {getStorage} from "@/utils/storage";
 import {useAppStore} from "@/store";
 import wbsApi from '~api/data-fill/wbs';
 import {getFormApiUrl} from '@/config/envApi';
-import {date} from "@/uni_modules/uv-ui-tools/libs/function/test";
 
 const store = useAppStore()
 const instance = getCurrentInstance().proxy
@@ -104,6 +103,7 @@ const initWebview = async () => {
     })
 }
 
+const isFormRender = ref(false)
 const handleMessage = (event) => {
     let msg = {};
     // #ifdef H5
@@ -115,6 +115,9 @@ const handleMessage = (event) => {
     msg = event.detail.data[0]
     // #endif
     if (msg.source === 'web') {
+        if (msg.type === 'formRender') {
+            isFormRender.value = true
+        }
         if (msg.type === 'back') {
             toBack() //收到通知,刷新列表去
         }
@@ -140,6 +143,10 @@ onUnload(()=>{
 //切换显示模式
 const editType = ref('form')
 const editTypeClick = () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     const type = editType.value === 'form' ? 'table' : 'form'
     // #ifdef H5
     window.frames["exceliframe"].postMessage({
@@ -156,6 +163,10 @@ const editTypeClick = () => {
 
 //复制本表
 const toCopyClick = async () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     const { pkeyId, status } = pageNode.value
     if (!pkeyId) {
         errorToast('pkeyId为空');
@@ -181,6 +192,10 @@ const toCopyClick = async () => {
 
 //隐藏表单
 const toHideClick = async () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     const { pkeyId, status } = pageNode.value
     if (!pkeyId) {
         errorToast('pkeyId为空');
@@ -207,6 +222,10 @@ const toHideClick = async () => {
 
 //预览表单
 const previewClick = async () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     const { pkeyId, isBussShow, isTabPdf, pdfUrl } = pageNode.value
     if (!pkeyId) {
         errorToast('pkeyId为空');
@@ -229,6 +248,10 @@ const previewClick = async () => {
 
 //保存
 const formSaveClick = () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     uni.showLoading({title: '保存中...', mask: true})
     // #ifdef H5
     window.frames["exceliframe"].postMessage({
@@ -244,6 +267,10 @@ const formSaveClick = () => {
 
 //上传
 const toFileUp = () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     const { pkeyId, status } = pageNode.value
     if (!pkeyId) {
         errorToast('pkeyId为空');

+ 16 - 0
pages/ledger/editTable.vue

@@ -209,6 +209,10 @@ const toBack = () => {
 //切换显示模式
 const editType = ref('form')
 const editTypeClick = () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     const type = editType.value === 'form' ? 'table' : 'form'
     postMsg({
         type: 'editTypeClick',
@@ -220,6 +224,10 @@ const editTypeClick = () => {
 
 //关联工序
 const linkTabClick = () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     uni.navigateTo({
         url: '/pages/ledger/linkTab?id=' + itemFormId.value,
         events: {
@@ -242,6 +250,10 @@ const linkTabFinish = (data) => {
 
 //新增表格
 const addFormClick = () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     postMsg({
         type: 'addForm',
         fun: `addFormTap()`
@@ -278,6 +290,10 @@ const copyTimeLogModal = () => {
 
 //删除当前页
 const delCurrentPage = () => {
+    if (isFormRender.value === false) {
+        errorToast('表单未渲染完成,请稍后再试');
+        return
+    }
     postMsg({
         type: 'delForm',
         fun: `delFormTap()`