ZaiZai пре 2 година
родитељ
комит
b12e484977
5 измењених фајлова са 47 додато и 16 уклоњено
  1. 1 1
      config/index.js
  2. 20 3
      pages/data-fill/editTable.vue
  3. 20 1
      pages/ledger/editTable.vue
  4. 2 8
      pages/task/index.vue
  5. 4 3
      style/task/index.scss

+ 1 - 1
config/index.js

@@ -12,7 +12,7 @@ export default {
     //测试环境
     testApi: {
         api: 'http://192.168.0.109:8090/',  //请求地址
-        form: 'http://192.168.0.109:5173/', //表单地址
+        form: 'http://192.168.0.134:5174/', //表单地址
         //api: 'http://47.110.251.215:8090/', //请求地址
         //form: 'https://user.hcxxy.com/',    //表单地址
         wss: 'wss://business.hcxxy.com/wss/websocket/', //长连接地址

+ 20 - 3
pages/data-fill/editTable.vue

@@ -10,7 +10,7 @@
         <template v-if="webviewShow">
             <web-view :webview-styles="webViewStyle" :style="webViewStyle" :src="webSrc" name="exceliframe" @message="handleMessage"/>
         </template>
-        <view id="action-bar" class="action-bar">
+        <view id="action-bar" class="action-bar z-24">
             <button type="primary" class="action-bar-btn" @click="formSaveClick">保 存</button>
         </view>
     </hc-sys>
@@ -43,12 +43,18 @@ onLoad((option) => {
     // #endif
     const user = encodeURIComponent(JSON.stringify(getStorage('login_user_info')))
     if (option.node) {
+        uni.showLoading({title: '加载中...', mask: true});
         const res = JSON.parse(decodeURIComponent(option.node));
         uni.setNavigationBarTitle({
             title: res.title
         })
         pageNode.value = res
         webSrc.value = `${htmlsrc}&user=${user}&node=${option.node}`
+    } else {
+        errorToast('参数错误');
+        setTimeout(() => {
+            toBack()
+        },1500)
     }
 })
 
@@ -83,7 +89,6 @@ const setWebViewStyle = async () => {
     const {statusBarHeight} = uni.getSystemInfoSync()
     webViewStyle.value.top = statusBarHeight + 45 + titleBarHeight
     // #endif
-
     //底部
     const actionBar = await querySelect(instance,'action-bar')
     const actionBarHeight = actionBar?.height ?? 80
@@ -116,6 +121,7 @@ const handleMessage = (event) => {
     // #endif
     if (msg.source === 'web') {
         if (msg.type === 'formRender') {
+            uni.hideLoading();
             isFormRender.value = true
         }
         if (msg.type === 'back') {
@@ -126,6 +132,17 @@ const handleMessage = (event) => {
             uni.hideLoading();
             previewClick()
         }
+        //消息提示
+        if (msg.type === 'msg') {
+            uni.hideLoading();
+            const { title, icon } = msg.data
+            uni.showToast({
+                title: title,
+                duration: 2000,
+                icon: icon,
+                mask: true
+            });
+        }
     }
 }
 
@@ -240,7 +257,7 @@ const previewClick = async () => {
     })
     uni.hideLoading();
     if (!error && code === 200 && data) {
-        toPdfPreview(data)
+        toPdfPreview(data).then()
     } else {
         errorToast('获取失败:' + msg);
     }

+ 20 - 1
pages/ledger/editTable.vue

@@ -70,11 +70,17 @@ onLoad((option) => {
     // #endif
     const user = encodeURIComponent(JSON.stringify(getStorage('login_user_info')))
     if (option.node) {
+        uni.showLoading({title: '加载中...', mask: true});
         const res = JSON.parse(decodeURIComponent(option.node));
         uni.setNavigationBarTitle({title: res.title + '填报'})
         pageNode.value = res
         webSrc.value = `${htmlsrc}&user=${user}&node=${option.node}`
         checkTheLogTaskStatus()
+    } else {
+        errorToast('参数错误');
+        setTimeout(() => {
+            toBack()
+        },1500)
     }
 })
 
@@ -159,8 +165,9 @@ const handleMessage = (event) => {
 // 处理接收到的消息
 const isFormRender = ref(false)
 const setMsgData = ({type, data}) => {
-//表格数量
+    //表格数量
     if (type === 'formRender') {
+        uni.hideLoading();
         isFormRender.value = true
     }
     //表格数量
@@ -175,6 +182,7 @@ const setMsgData = ({type, data}) => {
     }
     //pdf预览
     if (type === 'formPdfUrl') {
+        uni.hideLoading();
         previewPdf(data)
     }
     //保存结果
@@ -182,6 +190,17 @@ const setMsgData = ({type, data}) => {
         uni.hideLoading();
         saveResData(data)
     }
+    //消息提示
+    if (type === 'msg') {
+        uni.hideLoading();
+        const { title, icon } = getObjValue(data)
+        uni.showToast({
+            title: title,
+            duration: 2000,
+            icon: icon,
+            mask: true
+        });
+    }
 }
 
 //页码

+ 2 - 8
pages/task/index.vue

@@ -2,7 +2,7 @@
     <z-paging class="hc-task-page" ref="pageRef" v-model="taskList" @query="getTaskList">
         <template #top>
             <view class="hc-paging-top-bar">
-                <hc-nav-bar class="task-nav-bar">
+                <view class="task-nav-bar">
                     <view class="segmented-bar">
                         <template v-for="item in taskTypeData">
                             <view class="task-tab-item" :class="item.key === taskType?'task-cur':''" @click="taskTypeChange(item)">{{item.name}}</view>
@@ -11,8 +11,7 @@
                     <view class="more-bar" v-if="taskType === 1 && taskList.length > 0" @click="moreBarClick">
                         <text class="i-ri-more-2-fill icon"/>
                     </view>
-                </hc-nav-bar>
-                <!--条件筛选-->
+                </view>
                 <view class="controls-bar-box">
                     <view class="controls-bar">
                         <view class="left">
@@ -91,7 +90,6 @@
 
 <script setup>
 import {nextTick, ref, watch} from "vue";
-import {onLoad} from '@dcloudio/uni-app'
 import mainApi from '~api/tasks/data';
 import {errorToast, successToast} from "@/utils/tools";
 import {arrToKey, getArrValue, getObjValue} from "js-fast-way";
@@ -104,10 +102,6 @@ const contractId = ref(store.contractId);
 
 const pageRef = ref(null)
 
-onLoad(() => {
-
-})
-
 //顶部类型切换
 const taskType = ref(1)
 const taskTypeData = [

+ 4 - 3
style/task/index.scss

@@ -3,10 +3,12 @@
         background: #554D84;
         color: white;
     }
-    :deep(.hc-nav-bar) {
+    .task-nav-bar {
+        position: relative;
         display: flex;
         align-items: center;
         padding: .6rem .9rem;
+        padding-top: calc(var(--status-bar-height) + 20rpx);
         .segmented-bar {
             position: relative;
             display: flex;
@@ -55,8 +57,7 @@
         }
     }
     .controls-bar-box {
-        position: sticky;
-        top: 0;
+        position: relative;
         .controls-bar {
             position: relative;
             display: flex;