From 1eb06fe948b92d9a3248f2f36da9cea819528b64 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期三, 20 八月 2025 14:24:12 +0800
Subject: [PATCH] 增加临时发起页面

---
 src/views/flowmgr/programexport.vue |  192 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 168 insertions(+), 24 deletions(-)

diff --git a/src/views/flowmgr/programexport.vue b/src/views/flowmgr/programexport.vue
index 0a18d27..47cb60d 100644
--- a/src/views/flowmgr/programexport.vue
+++ b/src/views/flowmgr/programexport.vue
@@ -1,24 +1,43 @@
 <!--
  * @Date: 2025-06-20 20:48:17
  * @LastEditors: gaoshp
- * @LastEditTime: 2025-07-07 23:00:25
+ * @LastEditTime: 2025-08-17 10:17:27
  * @FilePath: /mdmweb/src/views/flowmgr/programexport.vue
 -->
 <template>
     <basic-container>
-        <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">
-            <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>
-            </template>
-            <template #menu="scope">
-                <!-- <el-button type="primary" text size="default"
-                    @click.stop="handleAction(scope.row, scope.index)">澶勭悊鎰忚
-                </el-button> -->
-            </template>
-        </avue-crud>
+        <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">
+                    <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>
+                    </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">
+                    <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>
+                    </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-tabs>
     </basic-container>
 </template>
 
@@ -32,6 +51,7 @@
     name: 'programexport',
     data() {
         return {
+            activeName: "todo",
             // Define your data properties here
             page: {
                 pageSize: 10,
@@ -63,29 +83,49 @@
                 menu: false,
                 dialogClickModal: false,
                 column: [
-                    {
-                        label: '鍥惧彿',
-                        prop: 'partNo',
+					{
+                        label: '娴佺▼鏍囬',
+                        prop: 'title',
+                        with: 250
                     },
                     {
-                        label: '鍥惧彿鐗堟',
-                        prop: 'partNoEdition',
+                        label: '闆剁粍浠跺彿',
+                        prop: 'drawingNo',
+                    },
+                    {
+                        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: '閫氳繃鏃堕棿',
                         prop: 'createTime',
                     },
                     {
-                        label: '瀹屾垚鏃堕棿',
+                        label: '閫氳繃鏃堕棿',
                         prop: 'passTime',
                         search: true,
                         hide: true,
@@ -96,10 +136,97 @@
                         searchSpan: 8,
                     },
                 ],
+            },
+            optionCompleted: {
+                addBtn: false,
+                editBtn: false,
+                delBtn: false,
+                viewBtn: true,
+                columnBtn: false,
+                tip: false,
+                // simplePage: true,
+                searchShow: 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);
+        },
         selectionChange(list) {
             this.selection = list;
         },
@@ -138,12 +265,13 @@
         /** * 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
          */
         onLoad(page, params = {}) {
-            console.log('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) {
@@ -171,15 +299,31 @@
                 type: 'warning',
             }).then(() => {
                 console.log(this.selection)
+				if(this.selection == null || this.selection.length == 0){
+					this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉″鍑�');
+					return;
+				}
                 NProgress.start();
                 exportBlobPost(
                     `/blade-mdm/program/exchange/export-dnc`,
                     {},
                     {ids: this.selection.map(item => item.id)},
                 ).then(res => {
-                    console.log(res);
-                    downloadFile(res.data, `瀵煎嚭DNC${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.zip`);
+				    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}`);
+						
+					}else{
+						this.$message.error('瀵煎嚭閿欒');
+						console.log(res);
+					}
                     NProgress.done();
+                    this.onLoad(this.page, this.query);
                 });
             });
         },

--
Gitblit v1.9.3