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 | 226 +++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 196 insertions(+), 30 deletions(-)
diff --git a/src/views/tasks/machinereturnfiles.vue b/src/views/tasks/machinereturnfiles.vue
index f825989..b52aab9 100644
--- a/src/views/tasks/machinereturnfiles.vue
+++ b/src/views/tasks/machinereturnfiles.vue
@@ -1,4 +1,9 @@
<template>
+ <div class="gongkongMain">
+ <div >
+ <el-tree :data="treeData" :props="defaultProps" node-key="id" :default-expand-all="false" :default-expanded-keys="defaultKeys" @node-click="handleNodeClick" />
+ </div>
+ <div>
<basic-container>
<avue-crud
:addBtn="false"
@@ -13,40 +18,62 @@
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
+ @selection-change="selectionChange"
@on-load="onLoad"
>
<template #menu-left>
- <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">瀵煎嚭</el-button>
+ <!-- el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">瀵煎嚭</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>
+ </div>
</template>
<script>
+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';
export default {
data() {
return {
+ selection: [],
search: {
keyword: "",
- machineGroupCode: ""
+ machineGroupCode: "",
+ dirType:"",
},
loading: true,
+ treeData: [],
+ defaultProps: {
+ children: 'children',
+ label: 'name',
+ isLeaf: (data) => !data.hasChildren
+ },
+ currentNode:{},//褰撳墠鑺傜偣鏁版嵁
mypage: {
size: 10,
current: 1,
total: 0,
},
option: {
+ size:'small',
index: true,
+ selection: true,
+ selectionWidth:30,
addBtn: false,
editBtn: false,
delBtn: false,
@@ -54,38 +81,56 @@
emptyBtn: false,
searchLabelWidth: "120",
searchSpan: 8,
+ menu:false,
+ width:'100%',
column: [
- {
- label: '浠诲姟缂栫爜',
- prop: 'programName',
- hide: true
- },
- {
- label: '鏂囦欢缂栧彿',
- prop: ''
+ {
+ label: '鏂囦欢鍚嶇О',
+ prop: 'name',
+ showOverflowTooltip:true,
},
{
label: '鏈哄簥鍙�',
prop: 'machineCode',
+ showOverflowTooltip:true,
},
{
- label: '鏂囦欢鍚嶇О',
- prop: 'name',
+ 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: 'isCured',
+ label: '鏂囦欢澶у皬',
+ prop: 'fileSizeDisplay',
},
{
label: '鏂囦欢鍒拌揪鏃堕棿',
- prop: 'arrivedTime',
- },
+ showOverflowTooltip:true,
+ prop: 'fileCreateTime',
+ },/*
{
label: '鏂囦欢鏁版嵁搴撶紪鍙�',
prop: '',
- },
+ },*/
{
- label: '鍏抽敭淇℃伅',
+ label: '鍏抽敭瀛�',
prop: 'keyword',
search: true,
hide: true,
@@ -109,6 +154,59 @@
};
},
methods: {
+ 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'})
+ }
+ var ids = [];
+ this.selection.forEach(item=> {
+ ids.push(item.id);
+ })
+ this.$confirm('纭畾瑕佹帴鏀跺悧?', { //鍚屾帴鏀舵帴鍙g浉鍚�
+ confirmButtonText: '鏄�',
+ cancelButtonText: '鍚�',
+ type: 'warning',
+ }).then(() => {
+ //璋冪敤鎺ュ彛
+ this.loading = true;
+ axios({
+ url: '/blade-mdm/machinefile/collect/temp-accept',
+ method: 'post',
+ params: {ids: ids.join(',')},
+ }).then(
+ res => {
+ this.loading = false;
+ this.onLoad();
+ }
+ );
+ })
+ },
acceptBtn(row) {
this.$confirm('纭畾瑕佹帴鏀跺悧?', {
confirmButtonText: '鏄�',
@@ -118,9 +216,9 @@
//璋冪敤鎺ュ彛
this.loading = true;
axios({
- url: '/blade-mdm/machineback/file/accept',
+ url: '/blade-mdm/machinefile/collect/temp-accept',
method: 'post',
- data: {ids: row.id},
+ params: {ids: row.id},
}).then(
res => {
this.loading = false;
@@ -138,8 +236,8 @@
//璋冪敤鎺ュ彛
this.loading = true;
axios({
- url: '/blade-mdm/machineback/file/page',
- method: 'get',
+ url: '/blade-mdm/machinefile/collect/temp-reject',
+ method: 'post',
params: {ids: row.id},
}).then(
res => {
@@ -157,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();
@@ -174,9 +272,11 @@
},
currentChange(current) {
this.mypage.current = current;
+ this.onLoad();
},
sizeChange(size) {
this.mypage.size = size;
+ this.onLoad();
},
refreshChange() {
@@ -188,13 +288,20 @@
machineSpec: this.search.machineSpec,
current: this.mypage.current,
size: this.mypage.size,
+ nodeType: this.currentNode.nodeType,
+ nodeId: this.currentNode.nodeType!='dir'?this.currentNode.id:undefined,
+ 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;
@@ -205,11 +312,70 @@
}
);
- }
+ },
+ handleNodeClick(treeNode,b,c,d) {
+ console.log(treeNode)
+ this.currentNode = treeNode;
+ this.search.dirType = treeNode.dirType;
+ this.onLoad();
+ },
+ treeLoad () {
+ axios({
+ url: '/blade-mdm/gkw/node/load-tree?includeSend=0',
+ method: 'get',
+ }).then(
+ res => {
+ this.treeData = res.data.data;
+ var firstIndex = 0;
+ res.data.data.forEach((item,index)=> {
+ if(item.children.length != 0) {
+ firstIndex = index;
+ }
+ })
+ //defaultKeys.push(item.id);
+ this.defaultKeys = [res.data.data[firstIndex].id];
+ }
+ )
+ },
},
+ mounted() {
+ this.treeLoad();
+ this.search.dirType = getQueryString("dirType");
+ }
};
</script>
-
<style lang="scss">
-
+.gongkongMain {
+ display: flex;
+ padding: 0px;
+ margin: 0px 7px 10px 7px;
+ background-color: #fff;
+ border-top: 1px solid #ccc;
+ > div {
+ padding: 12px;
+ }
+}
+.gongkongMain > div:nth-child(1) {
+ width:17%;
+ border-right: 1px solid #ccc;
+}
+.gongkongMain div:nth-child(2) {
+ flex: 1;
+}
+.paginationTree {
+ margin-top: 12px;
+ 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