From 057ce688e9fe904c1a74b2505531d5afc7acf43e Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期三, 10 九月 2025 23:03:56 +0800
Subject: [PATCH] 修复bug

---
 src/views/flowmgr/programexport.vue |  163 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 149 insertions(+), 14 deletions(-)

diff --git a/src/views/flowmgr/programexport.vue b/src/views/flowmgr/programexport.vue
index 6437a6f..c5ba897 100644
--- a/src/views/flowmgr/programexport.vue
+++ b/src/views/flowmgr/programexport.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2025-06-20 20:48:17
- * @LastEditors: 鏉庡枂(寮�鍙戠粍) lzhe@yxqiche.com
- * @LastEditTime: 2025-08-11 16:26:01
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2025-08-17 10:17:27
  * @FilePath: /mdmweb/src/views/flowmgr/programexport.vue
 -->
 <template>
@@ -13,7 +13,7 @@
                     <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>
+                        <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"
@@ -23,12 +23,12 @@
                 </avue-crud>
             </el-tab-pane>
             <el-tab-pane label="宸插姙" name="completed">
-                <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" @current-change="currentChange"
+                <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">
                     <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>
+                        <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"
@@ -46,6 +46,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',
@@ -73,6 +74,7 @@
                 // simplePage: true,
                 searchShow: true,
                 searchMenuSpan: 6,
+                searchEnter:true,
                 dialogWidth: '60%',
                 // tree: true,
                 border: true,
@@ -86,23 +88,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: '閫氳繃鏃堕棿',
@@ -120,12 +138,97 @@
                         searchSpan: 8,
                     },
                 ],
+            },
+            optionCompleted: {
+                addBtn: false,
+                editBtn: false,
+                delBtn: false,
+                viewBtn: true,
+                columnBtn: false,
+                tip: false,
+                // simplePage: true,
+                searchShow: true,
+                searchEnter:true,
+                searchMenuSpan: 6,
+                dialogWidth: '60%',
+                // tree: true,
+                border: true,
+                index: true,
+                selection: true,
+                // viewBtn: true,
+                menuWidth: 200,
+                menu: false,
+                dialogClickModal: false,
+                column: [
+					{
+                        label: '娴佺▼鏍囬',
+                        prop: 'title',
+                        with: 200
+                    },
+                    {
+                        label: '闆剁粍浠跺彿',
+                        prop: 'drawingNo',
+                    },
+                    {
+                        label: '宸ュ簭鍙�',
+                        prop: 'processNo',
+                        width: 70
+                    },
+                    {
+                        label: '宸ュ簭鐗堟',
+                        prop: 'processEdition',
+                        width: 85
+                    },
+                    {
+                        label: '宸ュ簭鍚嶇О',
+                        prop: 'processName',
+                        width: 85
+                    },
+                    {
+                        label: '鍥剧焊鐗堟',
+                        prop: 'drawingNoEdition',
+                        width: 85
+                    },
+                    
+                    {
+                        label: '绋嬪簭鍖呭悕',
+                        prop: 'name',
+                        search: true,
+                    },
+                    {
+                        label: '閫氳繃鏃堕棿',
+                        prop: 'createTime',
+                        sortable: true,
+                    },
+                    {
+                        label: '瀵煎嚭浜�',
+                        prop: 'exporter',
+                        width: 70
+                    },
+                    {
+                        label: '宸插姙鏃堕棿',
+                        prop: 'updateTime',
+                        sortable: true,
+                    },
+                    {
+                        label: '閫氳繃鏃堕棿',
+                        prop: 'passTime',
+                        search: true,
+                        hide: true,
+                        type: 'datetime',
+                        format: 'YYYY-MM-DD HH:mm:ss',
+                        valueFormat: 'YYYY-MM-DD HH:mm:ss',
+                        searchRange: true,
+                        searchSpan: 8,
+                        sortable: true,
+                    },
+                ],
             }
         };
     },
     methods: {
         tabsClick(tab,event) {
-            //this.onLoad(this.page, this.query);
+            this.onLoad(this.page, this.query);
         },
         selectionChange(list) {
             this.selection = list;
@@ -192,13 +295,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;
@@ -209,9 +335,18 @@
                     {},
                     {ids: this.selection.map(item => item.id)},
                 ).then(res => {
-                    let name = res.headers['content-disposition'].split('filename=')[1]
-                    console.log(res.headers['content-disposition'].split('filename=')[1]);
-                    downloadFile(res.data, `${name}`);
+				    console.log('status='+res.status)
+					if(res.status == 200){
+						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}`);
+						
+					}else{
+						this.$message.error('瀵煎嚭閿欒');
+						console.log(res);
+					}
+                    todoChangeNotify();
                     NProgress.done();
                     this.onLoad(this.page, this.query);
                 });

--
Gitblit v1.9.3