From 655aee70727fe0479442d02cec27114eaed15872 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 21 三月 2025 14:40:19 +0800
Subject: [PATCH] 人员-样式优化
---
src/views/CNAS/resourceDemand/device/component/maintenance.vue | 57 +++++++++++++++++++--------------------------------------
1 files changed, 19 insertions(+), 38 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/maintenance.vue b/src/views/CNAS/resourceDemand/device/component/maintenance.vue
index 8510263..2b1ebbe 100644
--- a/src/views/CNAS/resourceDemand/device/component/maintenance.vue
+++ b/src/views/CNAS/resourceDemand/device/component/maintenance.vue
@@ -8,8 +8,8 @@
@keyup.enter.native="getAllMessage(clickNodeVal.value)"></el-input></div>
</div>
<div class="search_thing" style="padding-left: 30px;">
- <el-button size="small" @click="resetSearch">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="getAllMessage(clickNodeVal.value)">鏌� 璇�</el-button>
+ <el-button size="mini" type="primary" @click="getAllMessage(clickNodeVal.value)">鏌ヨ</el-button>
+ <el-button size="mini" @click="resetSearch">閲嶇疆</el-button>
</div>
<div class="btns">
<el-button size="small" type="primary" @click="dialogVisible = true; add()">娣诲姞缁存姢璁板綍</el-button>
@@ -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