Explorar o código

档案查询案卷相关修改

duy hai 4 meses
pai
achega
09ba03f236

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20250218105648"
+  "value": "20250320142022"
 }

+ 4 - 2
src/config/index.json

@@ -1,10 +1,12 @@
 {
     "version": "202304141558",
-    "target11": "http://192.168.0.109:8090",
+    "target": "http://219.151.181.73:8090",
     "target2": "http://192.168.0.125:8090",
     "target7": "http://39.108.216.210:8090",
-    "target": "http://39.108.216.210:8090",
+    "target11": "http://39.108.216.210:8090",
     "target9": "http://192.168.0.196:8090",
+    "targe77t": "http://192.168.0.110:8090",
+    "target8": "http://183.247.216.148:28090",
     "socket": "wss://measure.hczcxx.cn/websocket",
     "localModel": false,
     "smsPhone": "",

+ 43 - 4
src/plugins/HcPdfSign.js

@@ -14,6 +14,7 @@ export default class HcPdfSign {
     static pdfLoadFunc = null
     static batchSign = false
     static signNum = 0
+    static loadingTip = null
 
     /**
      * 初始化创建PDF预览
@@ -52,6 +53,9 @@ export default class HcPdfSign {
         if (!isNullES(load)) {
             this.addPdfLoadFunc(load)
         }
+           this.loadingTip.style.display = 'none'
+     
+        
     }
 
     // 获取DOM元素
@@ -100,6 +104,22 @@ export default class HcPdfSign {
         }
     }
 
+    // 创建loading提示条
+    static createLoadingTip() {
+        const tip = document.createElement('div')
+        tip.style.cssText = 'position: fixed; top: 0; left: 0; width: 100%;height:100%; background: red; color: white; text-align: center; padding: 8px; z-index: 1000; display: none;'
+        tip.textContent = '正在进行【批量签章】,请不要重复点击,请耐心等待,一分钟后戳章会显示出来'
+        tip.setAttribute('data-countdown', '10')
+        document.body.appendChild(tip)
+        return tip
+    }
+
+    static hideTip() {
+           this.loadingTip.style.display = 'none'
+           this.loadingTip = null
+
+    }
+
     // 创建iframe
     static createIframe(dom, url, isShowYinzhang) {
         const iframe = document.createElement('iframe')
@@ -114,6 +134,7 @@ export default class HcPdfSign {
         })
         dom.appendChild(iframe)
         this.iframeDom = iframe
+        this.loadingTip = this.createLoadingTip()
     }
 
     // 初始化变量
@@ -221,7 +242,7 @@ export default class HcPdfSign {
      */
     static setBatchSign(val = false) {
         this.batchSign = val
-        this.setPageScrolling()
+        // this.setPageScrolling()
     }
 
     // 让PDF页面全部渲染一下
@@ -288,10 +309,27 @@ export default class HcPdfSign {
         if (this.signType === '移动' || target.className !== 'textLayer') {
             return
         }
+        // 检查是否存在loadingIcon
+        const parent = target?.parentNode?.parentNode?.children ?? []
+
+        const checkLoading = async () => {
+            const hasLoadingIcon = Array.from(parent).some(child => child.classList?.contains('loadingIcon'))
+            if (hasLoadingIcon) {
+                this.loadingTip.style.display = 'block'
+                await new Promise(resolve => setTimeout(resolve, 500))
+                return checkLoading()
+            }
+            this.loadingTip.style.display = 'none'
+            return false
+        }
 
         this.signNum++
         if (this.batchSign) {
+            if (await checkLoading()) {
+                return
+            }
             const parent = target?.parentNode?.parentNode?.children ?? []
+        
             
             for (let i = 0; i < parent.length; i++) {
                 let obj = parent[i]?.children[1] ? parent[i]?.children[1] : parent[i]
@@ -450,10 +488,12 @@ export default class HcPdfSign {
 
     // 设置PDF节点签章
     static async setPdfNodeSign(node, textLayer, event) {
+
+        
         if (isNullES(node) || isNullES(textLayer) || isNullES(event)) {
             return
         }
-        console.log(node.children.length, 'setPdfNodeSign')
+       
         
 
         // 确保有一个容器来放置签名
@@ -473,8 +513,7 @@ export default class HcPdfSign {
 
         // 保存签章信息
         this.signList.push(this.createSignInfo(node, textLayer, event, signImgDom))
-        console.log( this.signList, ' this.signList1111111')
-        console.log(signImgDom, 'signImgDom1111111111')
+  
         
         return signImgDom
     }

+ 2 - 2
src/styles/page/using/query.scss

@@ -723,8 +723,8 @@
     position: relative;
     // background: #E7EEF4;
     border-radius: 10px;
-    padding: 12px;
-    height: 240px;
+    // padding: 12px;
+    // height: 240px;
 
     .header-box {
         position: relative;

+ 27 - 2
src/test/hc-pdf1.vue

@@ -27,6 +27,14 @@ const props = defineProps({
         type: Array,
         default: () => ([]),
     },
+    imgHeight:{
+        type: [Number, String],
+        default: '',
+    },
+    imgWidth:{
+        type: [Number, String],
+        default: '',
+    },
 })
 
 //事件
@@ -35,7 +43,21 @@ const pdf = ref(props.src)
 const uuid = getRandom(6)
 const signImg = ref(props.sign)
 const loading = ref(false)
+const imgWidth = ref(props.imgWidth)
+const imgHeight = ref(props.imgHeight)
+
 
+//监听
+watch(() => [
+props.imgWidth, props.imgHeight,
+], ([width, height]) => {
+    imgWidth.value = width
+    imgHeight.value = height
+
+    if (width && height) {
+        getPdf()
+    }
+})
 //监听PDFurl
 watch(() => props.src, (src) => {
     if (src) {
@@ -55,6 +77,7 @@ watch(() => props.sign, (val) => {
 
 //监听是否批量签章
 watch(() => props.batch, (val) => {
+    console.log(val)
     HcPdfSign.setBatchSign(val)
 }, { immediate: true })
 
@@ -65,7 +88,7 @@ onMounted(()=> {
 
 //设置PDF签章实例
 const getPdf = () => {
-    if (!pdf.value) {
+    if (!pdf.value ) {
         noPdfUrl()
         return false
     }
@@ -73,6 +96,8 @@ const getPdf = () => {
         ele: 'pdf-view-' + uuid, //挂载元素的id
         url: pdf.value, //pdf的url地址
         img: signImg.value, //签章图片的url地址
+        width: 308, //签章图片的宽度
+        height:231, //签章图片的宽度
         //加载完成
         load: () => {
             //恢复签章记录
@@ -85,7 +110,7 @@ const getPdf = () => {
         change: (data) => {
             emit('change', data)
         },
-        isShowYinzhang: signImg.value.length > 0,
+        isShowYinzhang:signImg.value.length > 0 ? true : false,
     })
 }
 

+ 13 - 4
src/test/index.vue

@@ -1,7 +1,11 @@
 <template>
     <div class="hc-page-box">
         <hc-new-card title="测试签章">
-            <HcSignPdf :batch="isBatch" :dom="hcSignImageArr" :sign="logoName" :src="pdfUrl" @change="pdfChange" />
+            <template #extra> 
+                <el-button v-if="isBatch" type="primary" @click="BatchClick(false)">不批量</el-button> 
+                <el-button v-else type="primary" @click="BatchClick(true)">批量</el-button> 
+            </template>
+            <HcSignPdf v-if="pdfUrl" :batch="isBatch" :dom="hcSignImageArr" :sign="logoName" :src="pdfUrl" :img-width="imgWidth" :img-height="imgHeight" @change="pdfChange" />
         </hc-new-card>
     </div>
 </template>
@@ -10,11 +14,16 @@
 import { ref } from 'vue'
 import HcSignPdf from './hc-pdf1.vue'
 
-const isBatch = ref(true)
-const pdfUrl = 'https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240816/c584d958a8cbcd7e3e3a163dc0976339.pdf'
+const isBatch = ref(false)
+const BatchClick = (val) => {
+    console.log(111111111111)
+    
+    isBatch.value = val
+}
+const pdfUrl = ref('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20250317/bc112743d3fd74da4347d25b7caeea99.pdf')
 
 const hcSignImageArr = ref([])
-const logoName = ref('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20231019/5cd4978468e45c123a37fd9515cb535f.png')
+const logoName = ref('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20250317/d0b11313e9bb1f0de41b165282215a72.png')
 
 const pdfChange = (data) => {
     console.log('签章数据', data)

+ 7 - 1
src/views/tasks/components/hc-pdf1.vue

@@ -5,7 +5,7 @@
 </template>
 
 <script setup>
-import { onMounted, ref, watch } from 'vue'
+import { onMounted, onUnmounted, ref, watch } from 'vue'
 import HcPdfSign from '~src/plugins/HcPdfSign'
 import { getArrValue, getRandom } from 'js-fast-way'
 
@@ -85,6 +85,12 @@ watch(() => props.batch, (val) => {
 onMounted(()=> {
     getPdf()
 })
+//
+onUnmounted(()=> {
+    console.log(111111111111)
+    
+    HcPdfSign.hideTip()
+})
 
 //设置PDF签章实例
 const getPdf = () => {

+ 1 - 0
src/views/tasks/hc-data.vue

@@ -245,6 +245,7 @@ const rowTaskName = async (row) => {
         taskReviewData.value = approvalFileList
         if (approvalFileList.length > 0) {
             batchPdfUrl.value = approvalFileList[0].pdfUrl
+          
             if (sbTableKey.value === 'key1' && row.type !== 2) {
                 queryCurrentUserData()
             } else {

+ 1 - 1
src/views/transfer/initial-expert.vue

@@ -63,7 +63,7 @@
         </hc-new-card>
 
         <!-- 历史报告 -->
-        <HcDrawer v-model="isSubmitReportDrawer" to-id="submit-report-layout-target" uis="hc-submit-report-target" @close="onSubmitReportDrawerClose">
+        <HcDrawer v-model="isSubmitReportDrawer" is-close to-id="submit-report-layout-target" uis="hc-submit-report-target" @close="onSubmitReportDrawerClose">
             <template #header>
                 <div class="hc-select-view w-52">
                     <el-select v-model="pdfDateId" placeholder="选择日期" @change="changePdfDate">

+ 20 - 14
src/views/transfer/inspects.vue

@@ -139,18 +139,18 @@
                         </div>
                     </div>
                     <div class="btn-box">
-                        <el-button hc-btn @click="onCarrySpotChecksDrawerClose">
+                        <el-button hc-btn type="warning" style="height: 40px; padding: 0 15px;" @click="onCarrySpotChecksDrawerClose">
                             <HcIcon name="close" />
                             <span>取消查阅</span>
                         </el-button>
-                        <el-button type="primary" hc-btn :loading="submitLoading" @click="submitOpinion">
+                        <el-button type="primary" hc-btn :loading="submitLoading" style="height: 40px; padding: 0 15px;" @click="submitOpinion">
                             <HcIcon name="check" />
                             <span>保存抽检意见</span>
                         </el-button>
                     </div>
                 </div>
                 <div v-if="checkId.length == 0" class="btn-box" style="text-align: center;">
-                    <el-button hc-btn @click="onCarrySpotChecksDrawerClose">
+                    <el-button hc-btn type="warning" style="height: 40px; padding: 0 15px;" @click="onCarrySpotChecksDrawerClose">
                         <HcIcon name="close" />
                         <span>取消查阅</span>
                     </el-button>
@@ -310,22 +310,22 @@ const tableRowClick = async ({ row }) => {
     //console.log(row)
     fileInfo.value = row
     // cscTableData1.value=getArrValue( row['approvalFileList'])
-    getArchiveFileListData()
+  await getArchiveFileListData()
     isCarrySpotChecksDrawer.value = true
     ishowAllopinion.value = true
-    checkId.value = ''
+    // checkId.value = ''
 
 
-    const url = await viewPdf(row.id)
-        pdfUrl.value = url
-        if (pdfUrl.value && pdfUrl?.value.length > 0 && isCarrySpotChecksDrawer.value) {
-            setTimeout(() => {
-                if (isCarrySpotChecksDrawer.value) {
-                    serReviewFile()
-                }
+    // const url = await viewPdf(row.id)
+    //     pdfUrl.value = url
+    //     if (pdfUrl.value && pdfUrl?.value.length > 0 && isCarrySpotChecksDrawer.value) {
+    //         setTimeout(() => {
+    //             if (isCarrySpotChecksDrawer.value) {
+    //                 serReviewFile()
+    //             }
 
-            }, 30000)
-        }
+    //         }, 30000)
+    //     }
 }
 //获取卷内文件数据
 const getArchiveFileListData = async ()=>{
@@ -340,12 +340,18 @@ const getArchiveFileListData = async ()=>{
         cscTableData1.value = getArrValue(data['approvalFileList'])
         if (cscTableData1.value.length > 0) {
             checkmetaFileId.value = cscTableData1.value[0].id
+            pdfUrl.value = cscTableData1.value[0]?.pdfFileUrl || ''
+            checkId.value = cscTableData1.value[0].id
+           
+            
             getmetaInfo()
         }
 
     } else {
 
         cscTableData1.value = []
+        pdfUrl.value = ''
+        checkId.value = ''
     }
 }
 //设置为已查阅

+ 35 - 24
src/views/using/query.vue

@@ -453,7 +453,7 @@
                 </div>
                 <div class="hc-csc-action-box-height">
                     <div class="btn-box">
-                        <el-button hc-btn @click="onCarrySpotChecksDrawerClose">
+                        <el-button hc-btn size="large" style="height: 40px; padding: 0 15px;" type="warning" @click="onCarrySpotChecksDrawerClose">
                             <HcIcon name="close" />
                             <span>取消查阅</span>
                         </el-button>
@@ -1110,18 +1110,24 @@ const tableFileColumn = ref([
 const tableFileData = ref([])
 //获取卷内文件数据
 const getArchiveFileListData = async () => {
+    tableFileLoading.value = true
     const { error, code, msg, data } = await archiveQueryApi.getArchiveFileList({
         id: fileInfo.value.id, //案卷id
     })
+    tableFileLoading.value = false
     //处理返回数据
     if (!error && code === 200) {
         fileInfo.value.pageNumber = data.pageNumber
         tableFileData.value = getArrValue(data['approvalFileList'])
         cscTableData1.value = getArrValue(data['approvalFileList'])
+        pdfUrl.value = tableFileData.value[0]?.pdfFileUrl
+        checkId.value = tableFileData.value[0]?.id
 
     } else {
         tableFileData.value = []
         cscTableData1.value = []
+        pdfUrl.value = ''
+        checkId.value = ''
     }
 }
 const tableFileLoading = ref(false)
@@ -1142,46 +1148,51 @@ const tableFileCloseClick = () => {
     tableAllShow.value = false
     tableFileShow.value = false
 }
-const viewPdf = async (id, outUrl) => {
-    if (outUrl.indexOf(',') === -1) {
-    return outUrl
-}
+const viewPdf = async (id, row) => {
+//     if (outUrl.indexOf(',') === -1) {
+//     return outUrl
+// }
+
+// window.$message?.info('预览案卷需要合并pdf,需要一点时间')
+// pdfLoading.value = true
+// const { error, code, data, msg } = await tuningApi.printArchive({
+//     id: id,
+// })
+// pdfLoading.value = false
+// if (!error && code === 200) {
+//     if (data) {
+//         return data
+//     } else {
+//         window.$message?.warning('文件不存在')
+//     }
+// }
+//展示卷内文件的第一个
 
-window.$message?.info('预览案卷需要合并pdf,需要一点时间')
-pdfLoading.value = true
-const { error, code, data, msg } = await tuningApi.printArchive({
-    id: id,
-})
-pdfLoading.value = false
-if (!error && code === 200) {
-    if (data) {
-        return data
-    } else {
-        window.$message?.warning('文件不存在')
-    }
-}
 
 }
 const isFile = ref('')//查阅案卷或者查阅文件
 const checkId = ref('')
 const consultFileClick = async (row, type) => {
-    isCarrySpotChecksDrawer.value = true
-    isFile.value = type
+  
     if (type === 1) {
         //查阅案卷
         getArchivesAutoView(row.id)
         fileInfo.value = row
-        getArchiveFileListData()
-        const url = await viewPdf(row.id, row.outUrl)
-        pdfUrl.value = url
-        checkId.value = ''
+     await getArchiveFileListData()
+     isCarrySpotChecksDrawer.value = true
+        // const url = await viewPdf(row.id, row)
+        // pdfUrl.value = url
+        // checkId.value = ''
 
 
     } else if (type == 2) {//查阅卷内文件
         checkId.value = row.id
         pdfUrl.value = row.pdfFileUrl
         getmetaInfo(checkId.value)
+        isCarrySpotChecksDrawer.value = true
     }
+    
+    isFile.value = type
 
 
 }