From 9bc4c3cfe5a5e2a1404184fb2c2b5a96e58d31fd Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 09 九月 2025 14:47:47 +0800
Subject: [PATCH] 增加异常文件列表

---
 src/api/statreport/machinefileexception.js    |   18 ++++
 src/views/statreport/machinefileexception.vue |  199 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 217 insertions(+), 0 deletions(-)

diff --git a/src/api/statreport/machinefileexception.js b/src/api/statreport/machinefileexception.js
new file mode 100644
index 0000000..9f9594f
--- /dev/null
+++ b/src/api/statreport/machinefileexception.js
@@ -0,0 +1,18 @@
+/*
+ * @Date: 2025-08-24 22:38:05
+ * @LastEditors: yangys
+ * @LastEditTime: 2025-08-24 08:32:12
+ * @FilePath: /mdmweb/src/api/flowmgr/exceptiontask.js
+ */
+import request from '@/axios';
+export const getList = (current, size, params) => {
+  return request({
+    url: '/blade-mdm/statreport/exceptionfile/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    },
+  })
+};
\ No newline at end of file
diff --git a/src/views/statreport/machinefileexception.vue b/src/views/statreport/machinefileexception.vue
new file mode 100644
index 0000000..50136c9
--- /dev/null
+++ b/src/views/statreport/machinefileexception.vue
@@ -0,0 +1,199 @@
+<!--
+ 鏂囦欢寮傚父璁板綍
+ * @Date: 2025-06-18 09:17:09
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2025-08-13 21:23:34
+ * @FilePath: /mdmweb/src/views/tasks/machinereturnfileop.vue
+-->
+<template>
+    <basic-container>
+        <avue-crud :option="option" :table-loading="loading" :data="data" v-model:search="query" v-model:page="page" v-model="form" ref="crud"
+            @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange"
+            @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @selection-change="selectionChange">
+            <template #menu-left>
+                
+                <el-button type="primary" plain @click="exportExcel">瀵煎嚭鍒癊XCEL</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>
+    </basic-container>
+</template>
+
+<script>
+import { getList } from '@/api/statreport/machinefileexception.js';
+import { exportBlob } from '@/api/common';
+import { getToken } from '@/utils/auth';
+import NProgress from 'nprogress';
+import { downloadXls } from '@/utils/util';
+import 'nprogress/nprogress.css';
+export default {
+    name: 'MachineReturnFileOp',
+    data() {
+        return {
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+            },
+            form: {},
+            query: {},
+            loading: true,
+            data: [],
+            option: {
+                addBtn: false,
+                editBtn: false,
+                delBtn: false,
+                columnBtn: false,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 6,
+                dialogWidth: '60%',
+                // tree: true,
+                border: true,
+                index: true,
+                menu: false,
+                dialogClickModal: false,
+                column: [
+                    
+					{
+                        label: '鏂囦欢鍚嶇О',
+                        prop: 'name',
+                        search:true,
+                    },
+                    {
+                        label: '鏈哄簥',
+                        prop: 'machineCode',
+                    },
+                    {
+                        label: '寮傚父淇℃伅',
+                        prop: 'exceptionType',
+                        render: ({row}) => {
+                            
+                            var txt = '鏈煡';
+                            switch(row.exceptionType){
+                                case 1:
+                                    txt = '闈炴枃鏈�';
+                                    break;
+                                case 2:
+                                    txt = '鏂囦欢鍚嶆牸寮忛敊璇�';
+                                    break;
+                                case 3:
+                                    txt = '鏂囦欢纭け';
+                                    break;
+                                case 4:
+                                    txt = '娈垫暟涓庝笅鍙戣褰曚笉鍖归厤'
+                                    break;
+                                default:
+                                    txt = '鏈煡';
+                            }
+                            return txt;
+                        }
+                    },
+                    {
+                        label: '鏃堕棿', //鏂囦欢鍒拌揪鏃堕棿
+                        prop: 'fileCreateTime',
+                        type: 'datetime',
+                        search:true,
+                        searchSpan:8,
+                        searchRange: true,
+                        format: 'YYYY-MM-DD HH:mm:ss',
+                        valueFormat: 'YYYY-MM-DD HH:mm:ss',
+                    }
+                ],
+            },
+            selectedList: [],
+        }
+    },
+    methods: {
+        selectionChange (list) {
+            this.selectedList = list;
+        },
+        
+        exportExcel() {
+            if (this.selectedList.length === 0) {
+                this.$message.warning('璇峰厛閫夋嫨闇�瑕佸鍑虹殑鏁版嵁');
+                return;
+            }
+            this.$confirm('鏄惁瀵煎嚭?', '鎻愮ず', {
+                confirmButtonText: '纭畾',
+                cancelButtonText: '鍙栨秷',
+                type: 'warning',
+            }).then(() => {
+                NProgress.start();
+                exportBlob(
+                    `/blade-mdm/machinefile/filehandle/export-excel?${this.website.tokenHeader}=${getToken()}`
+                ).then(res => {
+                    downloadXls(res.data, `鏈哄簥鍥炰紶绋嬪簭鍒楄〃${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
+                    NProgress.done();
+                });
+            });
+        },
+        searchChange(params, done) {
+            let data = {}
+            data = {
+                name:this.query.name,
+                fileCreateTimeBegin: this.query.fileCreateTime?.[0]||'',
+                fileCreateTimeEnd: this.query.fileCreateTime?.[1]||'',
+            }
+            this.query = data
+            this.onLoad(this.page, data);
+            done();
+        },
+        searchReset() {
+            let data = {}
+            this.query = params;
+            this.page.currentPage = 1;
+            data = {
+                name:this.query.name,
+                fileCreateTimeBegin: params.fileCreateTimeBegin,
+                fileCreateTimeEnd: params.fileCreateTimeEnd,
+            }
+            this.onLoad(this.page, data);
+            done();
+        },
+        currentChange(currentPage) {
+            this.page.currentPage = currentPage;
+        },
+        sizeChange(pageSize) {
+            this.page.pageSize = pageSize;
+        },
+        refreshChange() {
+            this.onLoad(this.page, this.query);
+        },
+        /** * 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
+         */
+        onLoad(page, params = {}) {
+            console.log('onLoad', page, params);
+            const query = {
+                ...this.query,
+            };
+            /*
+            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;
+                this.page.total = data.total;
+                this.data = data.records;
+                this.loading = false;
+            }, () => {
+                this.data = [];
+                this.loading = false;
+            }).catch(err => {
+                this.data = [];
+                this.loading = false;
+            });
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped></style>
\ No newline at end of file

--
Gitblit v1.9.3