Kaynağa Gözat

立即更新立卷进度条接口

duy 2 yıl önce
ebeveyn
işleme
47291da750

+ 8 - 0
src/api/modules/archiveConfig/tuning.js

@@ -72,6 +72,14 @@ async splitArchive(form, msg = true) {
         method: 'post',
         params: form
     }, msg);
+  },
+  //更新立卷进度接口
+  async archiveAutoPercentComplete(form, msg = true) {
+    return httpApi({
+        url: '/api/blade-archive/archivesauto/archiveAutoPercentComplete',
+        method: 'post',
+        params: form
+    }, msg);
   },
     //档案整理
     async refreshFileNumber(form, msg = true) {

+ 60 - 6
src/views/archives/rolling.vue

@@ -31,7 +31,7 @@
                         <el-progress
                         :text-inside="true"
                         :stroke-width="30"
-                        :percentage="88"
+                        :percentage="propercent"
                         status="success"
                         />
                     </div>
@@ -79,13 +79,16 @@ import tuningApi from "~api/archiveConfig/tuning.js";
 //监听
 watch(() => [
     useAppState.getCollapse
-], ([Collapse]) => {
+], ([Collapse],count) => {
     isCollapse.value = Collapse
 })
 
 //渲染完成
 onMounted(() => {
     getClassIfyList()
+    
+    Verification()
+        
 })
 
 //树加载
@@ -238,6 +241,7 @@ const viewPdf=async(id)=>{
 }
 //更新立卷
 const updateArchiveLoad=ref(false)
+const propercent=ref(0)
 const updateArchive=async()=>{
     updateArchiveLoad.value=true
     const { error, code, data,msg } = await tuningApi.archiveAutoMethod({
@@ -246,13 +250,63 @@ const updateArchive=async()=>{
     })
     updateArchiveLoad.value=false
     if (!error && code === 200) {
-        window.$message?.success(msg)
+        window.$message?.success(data)
        
+        if( propercent.value!==100){
+            Verification()
+        }else if(propercent.value===100){
+            propercent.value=0
+            count.value=0
+            Verification()
+        }
+    } 
+    else {
+        window.$message?.warning(msg)
+    }
+}
+const timer=ref(null)
+let count = ref(0); // 倒计时
+//更新立卷进度
+const updateArchiveprogress=async()=>{
+
+    const { error, code, data,msg } = await tuningApi.archiveAutoPercentComplete({
+        projectId:projectId.value,
+        contractId:contractId.value
+    })
+
+    if (!error && code === 200) {
+        console.log(data);
+        if(data==100){
+            console.log(11111);
+            count.value=100
+        }
+        propercent.value=data
     } 
-    // else {
-    //     window.$message?.warning(msg)
-    // }
 }
+
+//循环请求接口
+const Verification = () => {
+        timer.value = setInterval(() => {
+            if(count.value==100){
+                console.log('停着');
+                clearInterval(timer.value);
+            }else{
+                updateArchiveprogress();// 请求数据 
+            }
+        
+       
+    }, 1000);
+    
+//    if(count.value===100){
+//     console.log(111111222);
+//     clearInterval(timer.value);
+//    }
+};
+
+   
+    
+    
+
 </script>
 
 <style lang="scss" scoped>