From b14bf62abb3480d95beee8314fcb08c0d893813b Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期一, 22 九月 2025 14:18:19 +0800
Subject: [PATCH] 文件下发,回传文件处理的查看下载

---
 src/views/flowmgr/programexport.vue |  134 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 99 insertions(+), 35 deletions(-)

diff --git a/src/views/flowmgr/programexport.vue b/src/views/flowmgr/programexport.vue
index 17c7331..5ea9bbf 100644
--- a/src/views/flowmgr/programexport.vue
+++ b/src/views/flowmgr/programexport.vue
@@ -8,32 +8,25 @@
     <basic-container>
         <el-tabs v-model="activeName" type="card" class="demo-tabs" @tab-click="tabsClick">
             <el-tab-pane label="寰呭姙" name="todo">
-                <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" @current-change="currentChange"
-                    @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange">
+                <avue-crud :option="option" :search="searchData" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" @current-change="currentChange"
+                    @size-change="sizeChange" @refresh-change="refreshChange" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange">
                     <template #menu-left>
-                        <!-- <el-button type="primary" plain @click="exportWebSite">瀵煎嚭鍥炰紶娑夊瘑缃�</el-button> -->
-                        <!-- <el-button type="primary" plain @click="reassign">鎸傝浇杞﹀簥绋嬪簭搴�</el-button> -->
-                        <el-button type="primary" plain @click="exportExcel">瀵煎嚭</el-button>
+                      <!-- @on-load="onLoad"-->
+                        <el-button type="primary" :disabled="this.selection.length==0" plain @click="exportExcel">瀵煎嚭</el-button>
                     </template>
                     <template #menu="scope">
-                        <!-- <el-button type="primary" text size="default"
-                            @click.stop="handleAction(scope.row, scope.index)">澶勭悊鎰忚
-                        </el-button> -->
                     </template>
                 </avue-crud>
             </el-tab-pane>
             <el-tab-pane label="宸插姙" name="completed">
-                <avue-crud :option="optionCompleted" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" @current-change="currentChange"
-                    @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange">
+                <avue-crud :option="optionCompleted" :search="searchData" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud1" @current-change="currentChange"
+                    @size-change="sizeChange" @refresh-change="refreshChange" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange">
                     <template #menu-left>
-                        <!-- <el-button type="primary" plain @click="exportWebSite">瀵煎嚭鍥炰紶娑夊瘑缃�</el-button> -->
+                        <!-- <el-button type="primary" plain @click="exportWebSite">瀵煎嚭鍥炰紶娑夊瘑缃�</el-button> @on-load="onLoad" -->
                         <!-- <el-button type="primary" plain @click="reassign">鎸傝浇杞﹀簥绋嬪簭搴�</el-button> -->
-                        <el-button type="primary" plain @click="exportExcel">瀵煎嚭</el-button>
+                        <el-button type="primary" :disabled="this.selection.length==0" plain @click="exportExcel">瀵煎嚭</el-button>
                     </template>
                     <template #menu="scope">
-                        <!-- <el-button type="primary" text size="default"
-                            @click.stop="handleAction(scope.row, scope.index)">澶勭悊鎰忚
-                        </el-button> -->
                     </template>
                 </avue-crud>
             </el-tab-pane>
@@ -46,6 +39,7 @@
     import NProgress from 'nprogress';
     import { exportBlobPost } from '@/api/common';
     import { getToken } from '@/utils/auth';
+    import {todoChangeNotify} from '@/api/flow/todolist';
     import { downloadFile } from '@/utils/util';
     export default {
     name: 'programexport',
@@ -59,6 +53,7 @@
                 total: 0,
             },
             form: {},
+            searchData:{},
             query: {},
             loading: true,
             data: [],
@@ -70,15 +65,13 @@
                 viewBtn: true,
                 columnBtn: false,
                 tip: false,
-                // simplePage: true,
                 searchShow: true,
                 searchMenuSpan: 6,
+                searchEnter:true,
                 dialogWidth: '60%',
-                // tree: true,
                 border: true,
                 index: true,
                 selection: true,
-                // viewBtn: true,
                 menuWidth: 200,
                 menu: false,
                 dialogClickModal: false,
@@ -86,6 +79,7 @@
 					{
                         label: '娴佺▼鏍囬',
                         prop: 'title',
+                        with: 250
                     },
                     {
                         label: '闆剁粍浠跺彿',
@@ -94,25 +88,40 @@
                     {
                         label: '宸ュ簭鍙�',
                         prop: 'processNo',
+                        with: 75
                     },
                     
                     {
                         label: '宸ュ簭鐗堟',
                         prop: 'processEdition',
+                        with: 85
                     },
                     {
                         label: '宸ュ簭鍚嶇О',
                         prop: 'processName',
+                        with: 85
                     },
                     {
-                        label: '鍥惧彿鐗堟',
+                        label: '鍥剧焊鐗堟',
                         prop: 'drawingNoEdition',
+                        with: 85
                     },
                     
                     {
                         label: '绋嬪簭鍖呭悕',
                         prop: 'name',
                         search: true,
+                        searchSpan:6,
+                        with: 100
+                    },
+                     {
+                        label: '鏌ヨ鑼冨洿',
+                        prop: 'queryType',
+                        type: 'select',
+                        search: true,
+                        clearable:false,
+                        searchSpan:4,
+                        with: 100,
                     },
                     {
                         label: '閫氳繃鏃堕棿',
@@ -140,6 +149,7 @@
                 tip: false,
                 // simplePage: true,
                 searchShow: true,
+                searchEnter:true,
                 searchMenuSpan: 6,
                 dialogWidth: '60%',
                 // tree: true,
@@ -154,6 +164,7 @@
 					{
                         label: '娴佺▼鏍囬',
                         prop: 'title',
+                        with: 200
                     },
                     {
                         label: '闆剁粍浠跺彿',
@@ -162,18 +173,22 @@
                     {
                         label: '宸ュ簭鍙�',
                         prop: 'processNo',
+                        width: 70
                     },
                     {
                         label: '宸ュ簭鐗堟',
                         prop: 'processEdition',
+                        width: 85
                     },
                     {
                         label: '宸ュ簭鍚嶇О',
                         prop: 'processName',
+                        width: 85
                     },
                     {
-                        label: '鍥惧彿鐗堟',
+                        label: '鍥剧焊鐗堟',
                         prop: 'drawingNoEdition',
+                        width: 85
                     },
                     
                     {
@@ -185,6 +200,11 @@
                         label: '閫氳繃鏃堕棿',
                         prop: 'createTime',
                         sortable: true,
+                    },
+                    {
+                        label: '瀵煎嚭浜�',
+                        prop: 'exporter',
+                        width: 70
                     },
                     {
                         label: '宸插姙鏃堕棿',
@@ -204,10 +224,11 @@
                         sortable: true,
                     },
                 ],
-            }
+            },
         };
     },
     methods: {
+        
         tabsClick(tab,event) {
             this.onLoad(this.page, this.query);
         },
@@ -227,16 +248,18 @@
         },
         searchChange(params, done) {
             let data = {}
+            
             this.query = params;
             this.page.currentPage = 1;
-            console.log('searchChange', params);
+            //console.log('searchChange', params);
             params.passTimeBegin = params?.passTime?.[0] || '';
             params.passTimeEnd = params?.passTime?.[1] || '';
-            console.log(params);
+            //console.log(params);
             data = {
                 createTimeBegin: params.passTimeBegin,
                 createTimeEnd: params.passTimeEnd,
-                name: params.name || ''
+                name: params.name || '',
+                queryType:this.query.queryType
             }
             this.query = data
             this.onLoad(this.page, data);
@@ -244,6 +267,7 @@
         },
         searchReset() {
             this.query = {};
+            this.query.queryType = this.searchData.queryType;
             this.onLoad(this.page);
         },
         /** * 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
@@ -251,17 +275,10 @@
         onLoad(page, params = {}) {
             const query = {
                 ...this.query,
-                // category: params.category ? flowCategory(params.category) : null,
-                mode: this.mode,
             };
             var status = this.activeName == 'todo'?null:2;
             params.status = status;
-            try {
-                delete query.confirmTime; // 鍒犻櫎涓嶅繀瑕佺殑鏌ヨ鏉′欢
-            } catch (error) {
-                console.error('鏃ユ湡鏍煎紡鍖栭敊璇�', error);
-            }
-
+           
             this.loading = true;
             getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => {
                 const data = res.data.data;
@@ -276,13 +293,36 @@
                 this.loading = false;
             });
         },
+        findDuplicates(arr) {
+            const seen = new Set();
+            const duplicates = new Set();
+            
+            arr.forEach(item => {
+                if (seen.has(item)) {
+                duplicates.add(item);
+                } else {
+                seen.add(item);
+                }
+            });
+            
+            return Array.from(duplicates);
+        },
         exportExcel() {
             this.$confirm('鏄惁瀵煎嚭?', '鎻愮ず', {
                 confirmButtonText: '纭畾',
                 cancelButtonText: '鍙栨秷',
                 type: 'warning',
             }).then(() => {
-                console.log(this.selection)
+                //console.log(this.selection)
+                let selectArray = [];
+                for(var i=0;i<this.selection.length;i++){
+                    selectArray.push(this.selection[i].name+"-"+this.selection[i].processEdition)
+                }
+                let dupData = this.findDuplicates(selectArray);
+                if(dupData.length > 0){
+                    this.$message.error('涓嶈兘鍦ㄤ竴娆″鍑轰腑閫夋嫨涓�涓▼搴忕殑涓嶅悓鐗堟湰:['+dupData.join()+"]");
+                    return;
+                }
 				if(this.selection == null || this.selection.length == 0){
 					this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉″鍑�');
 					return;
@@ -295,9 +335,8 @@
                 ).then(res => {
 				    console.log('status='+res.status)
 					if(res.status == 200){
-					   //console.log(res.data);
-						
 						let name = res.headers['content-disposition'].split('filename=')[1]
+						name = decodeURI(name)
 						//console.log(res.headers['content-disposition'].split('filename=')[1]);
 						downloadFile(res.data, `${name}`);
 						
@@ -305,14 +344,39 @@
 						this.$message.error('瀵煎嚭閿欒');
 						console.log(res);
 					}
+                    todoChangeNotify();
                     NProgress.done();
                     this.onLoad(this.page, this.query);
                 });
             });
         },
     },
+    computed: {
+       ...mapGetters(['permission']),
+       
+    },
     mounted() {
+        let queryTypeDicData = [
+                            {
+                                label: '鍚岀粍缂栧埗',
+                                value:'group',
+                            },
+                            {
+                                label: '鏈汉缂栧埗',
+                                value:'self',
+                            }
+                        ];
+       
+        //console.log('this.permission.program_allexpor',this.permission.program_allexport)
+        if(this.permission.program_allexport==true){
+            queryTypeDicData.push({label:'鍏ㄩ儴鏁版嵁',value:'all'});
+            this.searchData.queryType = 'all'
+        }else{
+            this.searchData.queryType = 'self';
+        }
+        this.option.column[7].dicData = queryTypeDicData;
 
+        this.onLoad(this.page, this.searchData);
     }
 }
 </script>

--
Gitblit v1.9.3