From ac13062b358196b4c11ca6b4fc553bf9187d3f83 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 23 八月 2025 12:23:50 +0800
Subject: [PATCH] 导出工控网增加相同程序的验证

---
 src/views/flowmgr/programexport.vue |   81 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 71 insertions(+), 10 deletions(-)

diff --git a/src/views/flowmgr/programexport.vue b/src/views/flowmgr/programexport.vue
index 73d902b..d352741 100644
--- a/src/views/flowmgr/programexport.vue
+++ b/src/views/flowmgr/programexport.vue
@@ -73,6 +73,7 @@
                 // simplePage: true,
                 searchShow: true,
                 searchMenuSpan: 6,
+                searchEnter:true,
                 dialogWidth: '60%',
                 // tree: true,
                 border: true,
@@ -86,23 +87,39 @@
 					{
                         label: '娴佺▼鏍囬',
                         prop: 'title',
+                        with: 250
                     },
                     {
-                        label: '鍥惧彿',
+                        label: '闆剁粍浠跺彿',
                         prop: 'drawingNo',
                     },
                     {
-                        label: '鍥惧彿鐗堟',
-                        prop: 'drawingNoEdition',
+                        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,
+                        with: 100
                     },
                     {
                         label: '閫氳繃鏃堕棿',
@@ -130,6 +147,7 @@
                 tip: false,
                 // simplePage: true,
                 searchShow: true,
+                searchEnter:true,
                 searchMenuSpan: 6,
                 dialogWidth: '60%',
                 // tree: true,
@@ -144,21 +162,35 @@
 					{
                         label: '娴佺▼鏍囬',
                         prop: 'title',
+                        with: 200
                     },
                     {
-                        label: '鍥惧彿',
+                        label: '闆剁粍浠跺彿',
                         prop: 'drawingNo',
                     },
                     {
-                        label: '鍥惧彿鐗堟',
-                        prop: 'drawingNoEdition',
+                        label: '宸ュ簭鍙�',
+                        prop: 'processNo',
+                        width: 70
+                    },
+                    {
+                        label: '宸ュ簭鐗堟',
+                        prop: 'processEdition',
+                        width: 85
                     },
                     {
                         label: '宸ュ簭鍚嶇О',
                         prop: 'processName',
+                        width: 85
                     },
                     {
-                        label: '绋嬪簭鍚嶇О',
+                        label: '鍥惧彿鐗堟',
+                        prop: 'drawingNoEdition',
+                        width: 85
+                    },
+                    
+                    {
+                        label: '绋嬪簭鍖呭悕',
                         prop: 'name',
                         search: true,
                     },
@@ -166,6 +198,11 @@
                         label: '閫氳繃鏃堕棿',
                         prop: 'createTime',
                         sortable: true,
+                    },
+                    {
+                        label: '瀵煎嚭浜�',
+                        prop: 'exporter',
+                        width: 70
                     },
                     {
                         label: '宸插姙鏃堕棿',
@@ -257,13 +294,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;
@@ -274,11 +334,12 @@
                     {},
                     {ids: this.selection.map(item => item.id)},
                 ).then(res => {
-				    //console.log('status='+res.status)
+				    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}`);
 						

--
Gitblit v1.9.3