From f2fbb3b07155274408d68084e2d607760c765ad6 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 14 三月 2025 11:09:51 +0800
Subject: [PATCH] 前端跳转路由修改
---
src/views/CNAS/resourceDemand/device/component/maintenance.vue | 53 +++++++++++++++++------------------------------------
1 files changed, 17 insertions(+), 36 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/maintenance.vue b/src/views/CNAS/resourceDemand/device/component/maintenance.vue
index 8510263..87d2588 100644
--- a/src/views/CNAS/resourceDemand/device/component/maintenance.vue
+++ b/src/views/CNAS/resourceDemand/device/component/maintenance.vue
@@ -17,7 +17,8 @@
</div>
</div>
<div class="tables" style="margin-top: 10px;">
- <el-table ref="table" :data="MaintainParam" height="calc(100vh - 20em)">
+ <el-table ref="table" :data="MaintainParam" height="calc(100vh - 20em)"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border>
<el-table-column label="搴忓彿" type="index" width="120">
<template v-slot="scope">
<span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span>
@@ -118,8 +119,10 @@
<script>
import {
exportMaintenanceRecord,
- deviceMaintainDelete,
+ deleteDeviceMaintenance,
selectDeviceByCode,
+ addDeviceMaintenance,
+ getDeviceMaintenancePage,
} from '@/api/cnas/resourceDemand/device.js'
export default {
props: {
@@ -180,33 +183,7 @@
exportMaintenanceRecord({ deviceId: this.clickNodeVal.value }).then(res => {
this.outLoading = false
const blob = new Blob([res], { type: 'application/octet-stream' });
- this.$message.success('瀵煎嚭鎴愬姛')
- //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆
- let reader = new FileReader();
- reader.readAsText(blob, 'utf-8');
- reader.onload = () => {
- try {
- let result = JSON.parse(reader.result);
- if (result.message) {
- this.$message.error(result.message);
- } else {
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- link.download = '璁惧缁存姢淇濆吇璁板綍.doc';
- link.click();
- this.$message.success('瀵煎嚭鎴愬姛')
- }
- } catch (err) {
- console.log(err);
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- link.download = '璁惧缁存姢淇濆吇璁板綍.doc';
- link.click();
- this.$message.success('瀵煎嚭鎴愬姛')
- }
- }
+ this.$download.saveAs(blob, '璁惧缁存姢淇濆吇璁板綍.doc')
})
},
//鎿嶄綔璇︽儏鍒犻櫎
@@ -216,9 +193,10 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- deviceMaintainDelete(row.id).then(res => {
+ deleteDeviceMaintenance({ id: row.id }).then(res => {
})
- this.MaintainParam.splice(index, 1);
+ // this.MaintainParam.splice(index, 1);
+ this.getAllMessage(this.clickNodeVal.value)
this.$message({
type: 'success',
message: '鍒犻櫎鎴愬姛!'
@@ -246,15 +224,15 @@
this.$refs['form'].validate((valid) => {
if (valid) {
this.formData.deviceId = this.clickNodeVal.value;
- this.$axios.post(this.$api.deviceCheck.deviceMaintainAdd, this.formData).then(res => {
+ addDeviceMaintenance(this.formData).then(res => {
if (res.code == 200) {
this.$message.success('娣诲姞鎴愬姛');
this.getAllMessage(this.clickNodeVal.value)
+ this.dialogVisible = false;
+ this.formData = {}; //娓呯┖琛ㄥ崟
}
})
- this.MaintainParam.push(this.formData)
- this.dialogVisible = false;
- this.formData = {}; //娓呯┖琛ㄥ崟
+ // this.MaintainParam.push(this.formData)
}
})
},
@@ -269,7 +247,10 @@
},
//鑾峰彇琛ㄥ崟璁惧缁存姢淇℃伅
getAllMessage(deviceId) {
- this.$axios.get(this.$api.deviceCheck.getDeviceMaintenancePage + "?deviceId=" + deviceId + "&size=" + this.search.size + "¤t=" + this.search.current + "&deviceNumber=" + this.search.deviceNumber).then(res => {
+ getDeviceMaintenancePage({
+ deviceId,
+ ...this.search
+ }).then(res => {
if (res.code == 200) {
this.MaintainParam = res.data.records
this.search.total = res.data.total
--
Gitblit v1.9.3