From e4c84d44e70e09ec6d69716bd6c722a953f980da Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 25 九月 2025 20:31:28 +0800
Subject: [PATCH] 顶部提示0时隐藏,工控网任务页面
---
src/views/tasks/machinereturnfiles.vue | 122 +++++++++++++++++++++++++++++++---------
1 files changed, 95 insertions(+), 27 deletions(-)
diff --git a/src/views/tasks/machinereturnfiles.vue b/src/views/tasks/machinereturnfiles.vue
index 1a3492c..b52aab9 100644
--- a/src/views/tasks/machinereturnfiles.vue
+++ b/src/views/tasks/machinereturnfiles.vue
@@ -1,6 +1,6 @@
<template>
<div class="gongkongMain">
- <div>
+ <div >
<el-tree :data="treeData" :props="defaultProps" node-key="id" :default-expand-all="false" :default-expanded-keys="defaultKeys" @node-click="handleNodeClick" />
</div>
<div>
@@ -23,12 +23,16 @@
>
<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" text size="default" icon="el-icon-document-delete" @click.stop="rejectBtn(scope.row, scope.index)">鎷掔粷</el-button>
- <el-button type="primary" 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>
</div>
@@ -36,9 +40,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 +53,8 @@
selection: [],
search: {
keyword: "",
- machineGroupCode: ""
+ machineGroupCode: "",
+ dirType:"",
},
loading: true,
treeData: [],
@@ -64,8 +70,10 @@
total: 0,
},
option: {
+ size:'small',
index: true,
selection: true,
+ selectionWidth:30,
addBtn: false,
editBtn: false,
delBtn: false,
@@ -73,35 +81,56 @@
emptyBtn: false,
searchLabelWidth: "120",
searchSpan: 8,
+ menu:false,
+ width:'100%',
column: [
- {
- label: '浠诲姟缂栫爜',
- prop: 'programName',
- hide: true
- },
- {
+ {
label: '鏂囦欢鍚嶇О',
prop: 'name',
+ showOverflowTooltip:true,
},
{
label: '鏈哄簥鍙�',
prop: 'machineCode',
+ showOverflowTooltip:true,
},
-
{
- label: '鏂囦欢鍥哄寲鐘舵��',
- prop: 'isCured',
+ label: '绋嬪簭鐘舵��',
+ prop: 'programStatus',
+ showOverflowTooltip:true,
+ 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',
+ showOverflowTooltip:true,
+ prop: 'fileCreateTime',
},/*
{
label: '鏂囦欢鏁版嵁搴撶紪鍙�',
prop: '',
},*/
{
- label: '鍏抽敭淇℃伅',
+ label: '鍏抽敭瀛�',
prop: 'keyword',
search: true,
hide: true,
@@ -128,6 +157,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 +196,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 +216,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 +236,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 +255,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();
@@ -220,9 +272,11 @@
},
currentChange(current) {
this.mypage.current = current;
+ this.onLoad();
},
sizeChange(size) {
this.mypage.size = size;
+ this.onLoad();
},
refreshChange() {
@@ -239,12 +293,15 @@
dirType:this.currentNode.dirType,
machineCode: this.currentNode.machineCode,
}
+ console.log('myupage',this.mypage)
axios({
- url: '/blade-mdm/machineback/file/page',
+ url: '/blade-mdm/machinefile/collect/file-page-for-acceept',
method: 'get',
params: obj,
}).then(
res => {
+ var screenHeight = window.innerHeight;
+ this.option.maxHeight = (screenHeight - 390) + 'px';
const data = res.data.data;
this.mypage.total = data.total;
this.data = data.records;
@@ -259,13 +316,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 +340,7 @@
},
mounted() {
this.treeLoad();
+ this.search.dirType = getQueryString("dirType");
}
};
</script>
@@ -299,7 +356,7 @@
}
}
.gongkongMain > div:nth-child(1) {
- width:25%;
+ width:17%;
border-right: 1px solid #ccc;
}
.gongkongMain div:nth-child(2) {
@@ -310,4 +367,15 @@
display: flex;
justify-content: flex-end;
}
+/*
+.Avue-crud{
+ :deep(.el-table) {
+ .el-table__body-wrapper,
+ .el-table__fixed-body-wrapper {
+ max-height:calc(100vh - 630px)!important;
+ overflow-y: auto;
+ }
+ }
+}
+*/
</style>
\ No newline at end of file
--
Gitblit v1.9.3