Quellcode durchsuchen

调整PDF加载过渡、调整操作指导书审核列表筛选逻辑

yangguanjin vor 1 Woche
Ursprung
Commit
46c224fc3a

+ 1 - 1
env/.env

@@ -1,4 +1,4 @@
-VITE_APP_TITLE = 'JeecgBoot-uniapp'
+VITE_APP_TITLE = 'tjy-uniapp'
 VITE_APP_PORT = 9000
 
 VITE_UNI_APPID = '__UNI__E0CC280'

+ 1 - 1
env/.env.test

@@ -9,7 +9,7 @@ VITE_SHOW_SOURCEMAP = false
 
 VITE_SERVER_BASEURL = 'http://192.168.0.53:48080/appapi'
 
-VITE_FILE_URL = 'https://youdao.hofo.co/dexdev'
+VITE_FILE_URL = 'http://192.168.0.53:9110/dexdev'
 
 VITE_APP_PUBLIC_BASE = '/app-h5/'
 

Datei-Diff unterdrückt, da er zu groß ist
+ 18 - 0
env/.env.uat


+ 2 - 0
package.json

@@ -18,6 +18,7 @@
     "dev:custom": "uni -p",
     "dev": "uni",
     "dev:h5": "uni",
+    "dev:h5-uat": "uni --mode uat",
     "dev:h5:ssr": "uni --ssr",
     "dev:mp": "uni -p mp-weixin",
     "dev:mp-alipay": "uni -p mp-alipay",
@@ -37,6 +38,7 @@
     "build:app-ios": "uni build -p app-ios",
     "build:custom": "uni build -p",
     "build:h5": "uni build",
+    "build:h5-uat": "uni build --mode uat",
     "build": "uni build",
     "build:h5:ssr": "uni build --ssr",
     "build:mp-alipay": "uni build -p mp-alipay",

+ 46 - 83
src/components/PDFViewer/index.vue

@@ -1,61 +1,53 @@
 <template>
   <view class="pdf-viewer">
-    <view v-if="loading" class="pdf-loading">
-      <text class="loading-text">PDF加载中...</text>
-    </view>
-    <view v-else-if="errorMsg" class="pdf-error">
-      <text class="error-text">{{ errorMsg }}</text>
-    </view>
-    <template v-else>
-      <!-- #ifdef H5 -->
-      <scroll-view
-        scroll-y
-        scroll-x
-        class="pdf-content-area"
-        :style="{ height: viewerHeight }"
-      >
-        <view
-          v-if="contentReady"
-          class="pdf-scroll-wrapper"
-          :style="scrollWrapperStyle"
-        >
-          <view class="pdf-scale-layer" :style="scaleLayerStyle">
-            <view class="pdf-container" :id="containerId"></view>
-          </view>
-        </view>
-      </scroll-view>
-      <!-- #endif -->
-      <!-- #ifndef H5 -->
-      <scroll-view
-        scroll-y
-        scroll-x
-        class="pdf-content-area"
-        :style="{ height: viewerHeight }"
+    <!-- #ifdef H5 -->
+    <scroll-view
+      scroll-y
+      scroll-x
+      class="pdf-content-area"
+      :style="{ height: viewerHeight }"
+    >
+      <view
+        v-if="contentReady"
+        class="pdf-scroll-wrapper"
+        :style="scrollWrapperStyle"
       >
-        <view v-if="contentReady" class="pdf-scroll-wrapper" :style="scrollWrapperStyle">
-          <view class="pdf-scale-layer" :style="scaleLayerStyle">
-            <image
-              :src="imageSrc"
-              mode="widthFix"
-              class="pdf-image"
-              :style="{ width: contentWidth + 'px' }"
-            />
-          </view>
+        <view class="pdf-scale-layer" :style="scaleLayerStyle">
+          <view class="pdf-container" :id="containerId"></view>
         </view>
-      </scroll-view>
-      <!-- #endif -->
-      <view v-if="contentReady" class="pdf-zoom-bar">
-        <view class="zoom-btn" @click="zoomOut">
-          <text class="zoom-btn-text">−</text>
-        </view>
-        <view class="zoom-btn" @click="zoomIn">
-          <text class="zoom-btn-text">+</text>
-        </view>
-        <view class="zoom-btn zoom-btn-reset" @click="resetZoom">
-          <text class="zoom-btn-text">重置</text>
+      </view>
+    </scroll-view>
+    <!-- #endif -->
+    <!-- #ifndef H5 -->
+    <scroll-view
+      scroll-y
+      scroll-x
+      class="pdf-content-area"
+      :style="{ height: viewerHeight }"
+    >
+      <view v-if="contentReady" class="pdf-scroll-wrapper" :style="scrollWrapperStyle">
+        <view class="pdf-scale-layer" :style="scaleLayerStyle">
+          <image
+            :src="imageSrc"
+            mode="widthFix"
+            class="pdf-image"
+            :style="{ width: contentWidth + 'px' }"
+          />
         </view>
       </view>
-    </template>
+    </scroll-view>
+    <!-- #endif -->
+    <view v-if="contentReady" class="pdf-zoom-bar">
+      <view class="zoom-btn" @click="zoomOut">
+        <text class="zoom-btn-text">−</text>
+      </view>
+      <view class="zoom-btn" @click="zoomIn">
+        <text class="zoom-btn-text">+</text>
+      </view>
+      <view class="zoom-btn zoom-btn-reset" @click="resetZoom">
+        <text class="zoom-btn-text">重置</text>
+      </view>
+    </view>
   </view>
 </template>
 
@@ -218,6 +210,8 @@ const renderAllPages = async () => {
 
       container.appendChild(canvas)
     }
+
+    emit('loaded', pdfDoc.numPages)
   } catch (error) {
     console.error('PDF页面渲染失败:', error)
     errorMsg.value = 'PDF页面渲染失败'
@@ -285,7 +279,6 @@ const loadPDFFromArrayBuffer = async (data: ArrayBuffer) => {
     await applyFitScale()
 
     loading.value = false
-    emit('loaded', pdf.numPages)
 
     await nextTick()
     if (isMounted) {
@@ -427,36 +420,6 @@ defineExpose({
   width: 100%;
 }
 
-.pdf-loading {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  width: 100%;
-  height: 300px;
-  background-color: #f5f5f5;
-  border-radius: 8px;
-
-  .loading-text {
-    font-size: 14px;
-    color: #999;
-  }
-}
-
-.pdf-error {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  width: 100%;
-  height: 200px;
-  background-color: #fff5f5;
-  border-radius: 8px;
-
-  .error-text {
-    font-size: 14px;
-    color: #f56c6c;
-  }
-}
-
 .pdf-content-area {
   width: 100%;
   background-color: #f5f5f5;

+ 62 - 1
src/components/SpreadDesigner/SpreadPDFViewer.vue

@@ -1,5 +1,20 @@
 <template>
   <view class="spread-pdf-viewer">
+    <view v-if="loading" class="pdf-loading">
+      <wd-loading />
+      <text class="loading-text">PDF加载中...</text>
+    </view>
+    <view v-else-if="errorMsg" class="pdf-error">
+      <text class="error-text">{{ errorMsg }}</text>
+    </view>
+    <PDFViewer
+      v-show="!loading && !errorMsg"
+      ref="pdfViewerRef"
+      :source="pdfSource"
+      :viewer-height="viewerHeight"
+      @loaded="handlePDFLoaded"
+      @error="handlePDFError"
+    />
     <view class="pdf-preview" style="display: none; width: 100%; height: 500px">
       <SpreadPDFConverter
         ref="spreadPdfViewerRef"
@@ -10,7 +25,6 @@
         @save-file="handleSpreadSaveFile"
       />
     </view>
-    <PDFViewer ref="pdfViewerRef" :source="pdfSource" :viewer-height="viewerHeight" />
   </view>
 </template>
 
@@ -43,6 +57,9 @@ const spreadPdfViewerRef = ref<any>(null)
 const pdfViewerRef = ref<any>(null)
 const pdfSource = ref<ArrayBuffer | Blob | null>(null)
 
+const loading = ref(true)
+const errorMsg = ref('')
+
 const handleSpreadDataLoaded = () => {
   spreadPdfViewerRef.value?.saveExcel()
 }
@@ -58,10 +75,22 @@ const handleSpreadSaveFile = async (blob: Blob) => {
     }
   } catch (error) {
     console.error('[SpreadPDFViewer] PDF转换失败:', error)
+    errorMsg.value = 'PDF转换失败'
+    loading.value = false
     emit('error', 'PDF转换失败')
   }
 }
 
+const handlePDFLoaded = () => {
+  loading.value = false
+}
+
+const handlePDFError = (message: string) => {
+  errorMsg.value = message
+  loading.value = false
+  emit('error', message)
+}
+
 const getPDF = (formData: FormData): Promise<ArrayBuffer> => {
   const apiPath = '/pressure2/standard-file/getPdfLocal'
   // #ifdef H5
@@ -134,4 +163,36 @@ defineExpose({
 .spread-pdf-viewer {
   width: 100%;
 }
+
+.pdf-loading {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  gap: 12px;
+  width: 100%;
+  height: 300px;
+  background-color: #f5f5f5;
+  border-radius: 8px;
+
+  .loading-text {
+    font-size: 14px;
+    color: #999;
+  }
+}
+
+.pdf-error {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  height: 200px;
+  background-color: #fff5f5;
+  border-radius: 8px;
+
+  .error-text {
+    font-size: 14px;
+    color: #f56c6c;
+  }
+}
 </style>

+ 1 - 1
src/manifest.json

@@ -1,5 +1,5 @@
 {
-  "name": "JeecgBoot-uniapp",
+  "name": "tjy-uniapp",
   "appid": "__UNI__E0CC280",
   "description": "",
   "versionName": "1.0.0",

+ 1 - 0
src/pages/home/index.vue

@@ -260,6 +260,7 @@ const getVerificationListNum = async () => {
     pageNo: 1,
     pageSize: 10,
     recheckStrIds: userInfo.value.id,
+    recheckStatus: '100',
   })
 
   if (result?.code == 0 && result?.data?.total) {

+ 7 - 2
src/pages/inspectionPlanAudit/list/InspectionPlanAuditList.vue

@@ -75,7 +75,7 @@ params.bpmUserId = userInfo.value?.id || ''
 
 const rightType = ref('100')
 const rightTypeList = [
-  { value: '全部', id: '' },
+  // { value: '全部', id: '' },
   { value: '已通过', id: '200' },
   { value: '审核中', id: '100' },
   { value: '已拒绝', id: '300' },
@@ -88,8 +88,13 @@ const fetchList = async (refresh = false) => {
   if (params.status && params.status !== '100') {
     params.bpmUserId = null
     params.approverId = userInfo.value?.id
-  } else{
+  } else if (params.status && params.status === '100') {
     params.bpmUserId = userInfo.value?.id || ''
+    params.approverId = ''
+  } else if (!params.status) {
+    params.bpmUserId = userInfo.value?.id || ''
+    params.approverId = null
+    params.status = null
   }
 
   params.pageNo = refresh ? 1 : params.pageNo + 1

+ 1 - 1
src/pages/pendingVerification/list/BoilerItem.vue

@@ -59,7 +59,7 @@
     </view>
 
     <view class="btn-group">
-      <button class="main-btn" @click="handleOperation">
+      <button v-show="item.recheckStatus == '100'" class="main-btn" @click="handleOperation">
           <text class="main-btn-text">{{ operateText }}</text>
       </button>
     </view>

+ 33 - 0
src/pages/pendingVerification/list/PendingVerificationList.vue

@@ -24,6 +24,16 @@
       @query-action="queryAction"
     />
 
+    <!-- 筛选条件栏 -->
+    <view class="filter-bar">
+      <RadioFilterBar
+        v-model="statusFilter"
+        :options="statusFilterList"
+        type="radio"
+        @change="handleStatusFilterChange"
+      />
+    </view>
+
     <!-- 列表 -->
     <scroll-view class="list-scroll" scroll-y @scrolltolower="loadMore">
       <view v-for="item in listData" :key="item.reportId" class="item-box">
@@ -53,6 +63,7 @@ import QueryView from '@/pages/pendingVerification/components/QueryView.vue'
 import BoilerItem from '@/pages/pendingVerification/list/BoilerItem.vue'
 import PipeItem from '@/pages/pendingVerification/list/PipeItem.vue'
 import NavBar from '@/components/NavBar/NavBar.vue'
+import RadioFilterBar from '@/components/RadioFilterBar/RadioFilterBar.vue'
 import { requestFunc, TaskOrderFuncName } from '@/api/ApiRouter/taskOrder'
 import { onShow } from '@dcloudio/uni-app'
 import { EquipmentType } from '@/utils/dictMap'
@@ -65,10 +76,18 @@ defineOptions({
 const listData = ref<any[]>([])
 const loading = ref(false)
 const hasMore = ref(true)
+const statusFilter = ref('100')
+const statusFilterList = [
+  { value: '全部', id: '' },
+  { value: '校核中', id: '100' },
+  { value: '已通过', id: '200' },
+  { value: '已退回', id: '300' },
+]
 const params = reactive({
   pageNo: 1,
   pageSize: 10,
   recheckStrIds: '',
+  recheckStatus: '100',
 })
 
 const userStore = useUserStore()
@@ -141,6 +160,13 @@ const queryAction = (exParams: Record<string, any>) => {
   refreshList()
 }
 
+// 状态筛选
+const handleStatusFilterChange = (value: string | number | boolean) => {
+  statusFilter.value = value as string
+  params.recheckStatus = statusFilter.value
+  refreshList()
+}
+
 // 生成报告列表
 const reportDOList = (item: any) => {
   const recheckList = item.recheckList || []
@@ -233,4 +259,11 @@ onShow(() => {
   background-color: #fff;
   border-radius: 5px;
 }
+
+.filter-bar {
+  display: flex;
+  justify-content: space-between;
+  flex-shrink: 0;
+  background-color: white;
+}
 </style>

+ 8 - 1
src/pages/sign/index.vue

@@ -99,7 +99,10 @@
     <!-- 底部按钮 -->
     <view class="footer-bar">
       <button class="footer-btn more-btn" @click="handlePushOrder">更多操作</button>
-      <button class="footer-btn confirm-btn" @click="signSubmit">{{ signButtonText }}</button>
+      <button class="footer-btn confirm-btn" @click="signSubmit">
+        {{ signButtonText }}
+      </button>
+      <!-- <button v-show="isSigned == '1'" class="footer-btn confirm-btn">重新签名</button> -->
     </view>
 
     <!-- 底部操作面板 -->
@@ -946,6 +949,10 @@ onMounted(() => {
   .confirm-btn {
     background-color: #00a811;
   }
+
+  .resign-btn {
+    background-color: #ffffff;
+  }
 }
 
 // 弹窗

+ 7 - 2
src/pages/workInstructionAudit/list/WorkInstructionAuditList.vue

@@ -67,7 +67,7 @@ const equipType = useConfigStore().getEquipType()
 
 const rightType = ref('100')
 const rightTypeList = [
-  { value: '全部', id: '' },
+  // { value: '全部', id: '' },
   { value: '已通过', id: '200' },
   { value: '审核中', id: '100' },
   { value: '已拒绝', id: '300' },
@@ -79,8 +79,13 @@ const fetchList = async (refresh = false) => {
   if (params.status && params.status !== '100') {
     params.bpmUserId = null
     params.approverId = userInfo.value?.id
-  } else {
+  } else if (params.status && params.status === '100') {
     params.bpmUserId = userInfo.value?.id || ''
+    params.approverId = ''
+  } else if (!params.status) {
+    params.bpmUserId = userInfo.value?.id || ''
+    params.approverId = null
+    params.status = null
   }
   params.pageNo = refresh ? 1 : params.pageNo + 1
   loading.value = true