From 2781142ab67deba83925da706ca26b7f8ea1a759 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 04 九月 2025 15:42:24 +0800
Subject: [PATCH] 审批用户列表改为树形

---
 src/views/tasks/machinereturnfiles.vue |   91 +++++++++++++++++++++++++++++++++------------
 1 files changed, 67 insertions(+), 24 deletions(-)

diff --git a/src/views/tasks/machinereturnfiles.vue b/src/views/tasks/machinereturnfiles.vue
index 1ed01a5..f92b572 100644
--- a/src/views/tasks/machinereturnfiles.vue
+++ b/src/views/tasks/machinereturnfiles.vue
@@ -23,11 +23,13 @@
     >
       <template #menu-left>
         <!-- el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">瀵煎嚭</el-button> -->
-        <el-button type="primary" :disabled="this.selection.length==0" size="default" icon="el-icon-circle-plus" plain @click="receiveBtn">鎵归噺鎺ユ敹</el-button>
+        <el-button type="primary" v-if="this.search.dirType!='REC'" size="default" icon="el-icon-circle-plus" plain @click="receiveAll">鍏ㄩ儴鎺ユ敹</el-button>
+        <el-button type="primary" v-if="this.search.dirType!='REC'" :disabled="this.selection.length==0" size="default" icon="el-icon-circle-plus" plain @click="receiveBtn">鎺ユ敹宸查��</el-button>
+        <el-button type="primary" v-if="this.search.dirType!='REC'" :disabled="this.selection.length==0" size="default" icon="el-icon-circle-plus" plain @click="rejectBtn">鎷掔粷</el-button>
       </template>
       <template #menu="scope">
-        <el-button type="primary" v-if="scope.row.dirType==='REC'" text size="default" icon="el-icon-document-delete" @click.stop="rejectBtn(scope.row, scope.index)">鎷掔粷</el-button>
-        <el-button type="primary" v-if="scope.row.dirType==='REC'" text size="default" icon="el-icon-document-add" @click.stop="acceptBtn(scope.row, scope.index)">鎺ユ敹</el-button>
+        <el-button type="primary" v-if="scope.row.dirType==='TEMP'" text size="default" icon="el-icon-document-delete" @click.stop="rejectBtn(scope.row, scope.index)">鎷掔粷</el-button>
+        <el-button type="primary" v-if="scope.row.dirType==='TEMP'" text size="default" icon="el-icon-document-add" @click.stop="acceptBtn(scope.row, scope.index)">鎺ユ敹</el-button>
       </template>
     </avue-crud>
   </basic-container>
@@ -36,9 +38,10 @@
 </template>
 
 <script>
-  import { ElMessage } from 'element-plus';
+import { ElMessage } from 'element-plus';
 import { exportBlob } from '@/api/common';
-import { downloadXls } from '@/utils/util';
+import { downloadXls ,getQueryString} from '@/utils/util';
+
 import { getToken } from '@/utils/auth';
 import NProgress from 'nprogress';
 import 'nprogress/nprogress.css';
@@ -48,7 +51,8 @@
       selection: [],
       search: {
         keyword: "",
-        machineGroupCode: ""
+        machineGroupCode: "",
+        dirType:"",
       },
       loading: true,
       treeData: [],
@@ -73,13 +77,9 @@
         emptyBtn: false,
         searchLabelWidth: "120",
         searchSpan: 8,
+        menuWidth: 150,
         column: [
-          {
-            label: '浠诲姟缂栫爜',
-            prop: 'programName',
-            hide: true
-          },
-		  {
+		    {
             label: '鏂囦欢鍚嶇О',
             prop: 'name',
           },
@@ -87,14 +87,34 @@
             label: '鏈哄簥鍙�',
             prop: 'machineCode',
           },
-          
           {
-            label: '鏂囦欢鍥哄寲鐘舵��',
-            prop: 'isCured',
+            label: '绋嬪簭鐘舵��',
+            prop: 'programStatus',
+            render: ({ row,value }) => {
+              var txt = '鏈煡';
+              switch(row.programStatus){
+                case 1:
+                  txt = '璇曞垏';
+                  break;
+                case 2:
+                  txt = '鍥哄寲';
+                  break;
+                case 3:
+                  txt = '鍋忕';
+                  break;
+                default:
+                  txt = '鏈煡';
+              }
+              return txt;
+            }
+          },
+          {
+            label: '鏂囦欢澶у皬',
+            prop: 'fileSizeDisplay',
           },
           {
             label: '鏂囦欢鍒拌揪鏃堕棿',
-            prop: 'arrivedTime',
+            prop: 'fileCreateTime',
           },/*
           {
             label: '鏂囦欢鏁版嵁搴撶紪鍙�',
@@ -128,6 +148,29 @@
     selectionChange(selection) {
       this.selection = selection;
     },
+
+    receiveAll() {
+      //鎺ユ敹绗﹀悎鏉′欢鐨勬墍鏈夋暟鎹�
+      this.$confirm('纭畾瑕佹帴鏀剁鍚堟潯浠剁殑鎵�鏈夋枃浠跺悧?', {  //鍚屾帴鏀舵帴鍙g浉鍚�
+        confirmButtonText: '鏄�',
+        cancelButtonText: '鍚�',
+        type: 'warning',
+      }).then(() => {
+        //璋冪敤鎺ュ彛
+        this.loading = true;
+        axios({
+          url: '/blade-mdm/machinefile/file/temp-accept-all',
+          method: 'post',
+          params: {}
+        }).then(
+          res => {
+            this.loading = false;
+            this.onLoad();
+          }
+        );
+      })
+    },
+
     receiveBtn() {
       if(this.selection.length == 0) {
         ElMessage({message: '璇烽�夋嫨鏁版嵁',type: 'error'})
@@ -144,7 +187,7 @@
         //璋冪敤鎺ュ彛
         this.loading = true;
         axios({
-          url: '/blade-mdm/machineback/file/accept',
+          url: '/blade-mdm/machinefile/collect/temp-accept',
           method: 'post',
           params: {ids: ids.join(',')},
         }).then(
@@ -164,7 +207,7 @@
         //璋冪敤鎺ュ彛
         this.loading = true;
         axios({
-          url: '/blade-mdm/machineback/file/accept',
+          url: '/blade-mdm/machinefile/collect/temp-accept',
           method: 'post',
           params: {ids: row.id},
         }).then(
@@ -184,7 +227,7 @@
         //璋冪敤鎺ュ彛
         this.loading = true;
         axios({
-          url: '/blade-mdm/machineback/file/reject',
+          url: '/blade-mdm/machinefile/collect/temp-reject',
           method: 'post',
           params: {ids: row.id},
         }).then(
@@ -203,7 +246,7 @@
       }).then(() => {
         NProgress.start();
         exportBlob(
-          `/blade-mdm/machineback/file/export-excel?${this.website.tokenHeader}=${getToken()}`
+          `/blade-mdm/machinefile/file/export-excel?${this.website.tokenHeader}=${getToken()}`
         ).then(res => {
           downloadXls(res.data, `鏈哄簥鍥炰紶鏂囦欢鏁版嵁${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
           NProgress.done();
@@ -240,7 +283,7 @@
         machineCode: this.currentNode.machineCode,
       }
       axios({
-        url: '/blade-mdm/machineback/file/page',
+        url: '/blade-mdm/machinefile/collect/file-page-for-acceept',
         method: 'get',
         params: obj,
       }).then(
@@ -259,13 +302,12 @@
     handleNodeClick(treeNode,b,c,d) {
       console.log(treeNode)
       this.currentNode = treeNode;
+      this.search.dirType = treeNode.dirType;
       this.onLoad();
-      //this.fileName = "";
-      //this.searchTable(TreeNode);
     },
     treeLoad () {
       axios({
-        url: '/blade-mdm/gkw/node/load-tree',
+        url: '/blade-mdm/gkw/node/load-tree?includeSend=0',
         method: 'get',
       }).then(
         res => {
@@ -284,6 +326,7 @@
   },
   mounted() {
     this.treeLoad();
+    this.search.dirType = getQueryString("dirType");
   }
 };
 </script>

--
Gitblit v1.9.3