From 2bd38f3c07fa4ec63c5b5fd99bca19d2b1b4ee2d Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期二, 19 三月 2024 14:54:50 +0800
Subject: [PATCH] refactor
---
src/views/system/check-result/index.vue | 116 +++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 94 insertions(+), 22 deletions(-)
diff --git a/src/views/system/check-result/index.vue b/src/views/system/check-result/index.vue
index 80dee17..34a1ad1 100644
--- a/src/views/system/check-result/index.vue
+++ b/src/views/system/check-result/index.vue
@@ -70,7 +70,6 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
- v-hasPermi="['system:checkResult:remove']"
>鍒犻櫎</el-button>
</el-col>
<el-col :span="1.5">
@@ -80,19 +79,34 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
- v-hasPermi="['system:checkResult:export']"
>瀵煎嚭</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
- <el-table v-loading="loading" :data="checkResultList" @selection-change="handleSelectionChange">
+ <el-card class="box-card" v-for="(item) in checkResultList">
+ <div slot="header" class="clearfix">
+ <span>{{ item.checkUnitName }}</span>
+ <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">璇︽儏</el-button>
+ </div>
+ <div class="text item">鑰冩牳<span class="time">{{ item.examineName }}</span></div>
+ <div class="text item">鑰冩牳鑼冨洿<span class="time">{{ item.examineRange }}</span></div>
+ <div class="text item">鑰冩牳棰戠巼<span class="time">{{ item.frequency }}</span></div>
+ <div class="text item">鑰冩牳鍒嗘暟<span class="time">{{ item.checkScore }}</span></div>
+ <div class="text item">鑰冩牳鏃堕棿
+ <span class="time">{{ item.checkTime }}</span>
+ <el-button size="small" round style="float: right;" @click="handlePublish(item)" v-show="item.publish != 1">纭鍙戝竷</el-button>
+ <el-button size="small" round style="float: right;" v-show="item.publish == 1" disabled="true">宸插彂甯�</el-button>
+ </div>
+ </el-card>
+
+ <!-- <el-table v-loading="loading" :data="checkResultList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="鑰冩牳瀵硅薄" align="center" prop="checkUnitName" />
<el-table-column label="鑰冩牳" align="center" prop="examineName" />
- <el-table-column label="鑰冩牳鑼冨洿" align="center" prop="examineRange" />
- <el-table-column label="鑰冩牳棰戠巼" align="center" prop="frequency" />
- <el-table-column label="鑰冩牳鍒嗘暟" align="center" prop="checkScore" />
+ <el-table-column label="鑰冩牳鑼冨洿":formatter="examineRangeFormatter" align="center" prop="examineRange" />
+ <el-table-column label="鑰冩牳棰戠巼" :formatter="frequencyFormatter" align="center" prop="frequency" />
+ <el-table-column label="鑰冩牳鍒嗘暟" falign="center" prop="checkScore" />
<el-table-column label="鑰冩牳鏃堕棿" align="center" prop="checkTime" />
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@@ -101,21 +115,18 @@
type="text"
icon="el-icon-view"
@click="handleDetail(scope.row)"
- v-hasPermi="['system:checkResult:detail']"
>璇︽儏</el-button>
- <el-button
- type="text"
- size="mini"
- icon="el-icon-edit"
- @click="handleSetManualScore(scope.row)"
- v-hasPermi="['system:checkResult:edit']"
- >浜哄伐鎵撳垎</el-button>
+ <el-button
+ type="text"
+ size="mini"
+ icon="el-icon-edit"
+ @click="handleSetManualScore(scope.row)"
+ >浜哄伐鎵撳垎</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
- v-hasPermi="['system:checkResult:remove']"
>鍒犻櫎</el-button>
</template>
</el-table-column>
@@ -127,10 +138,10 @@
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
- />
+ /> -->
<el-dialog :title="manualScoreTitle" :visible.sync="manualScoreOpen" width="500px" append-to-body>
- <el-input v-model="manualScoreForm.manualScore" type="number" placeholder="璇蜂负璇ュ崟浣嶆墦鍒�"></el-input>
+ <el-input v-model="manualScoreForm.manualScore" type="number" placeholder="璇蜂负璇ュ崟浣嶆墦鍒�"/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitManualScore">纭� 瀹�</el-button>
<el-button @click="cancelManualScore">鍙� 娑�</el-button>
@@ -173,7 +184,7 @@
<el-descriptions-item>
<template slot="label">
<i class="el-icon-medal"></i>
- 缁煎悎鍒嗘暟
+ 绯荤粺鍒嗘暟
</template>
<el-tag type="danger" size="small">{{detail.checkScore}}</el-tag>
</el-descriptions-item>
@@ -187,7 +198,14 @@
<el-descriptions-item>
<template slot="label">
<i class="el-icon-medal"></i>
- 绯荤粺鍒嗘暟
+ 杞﹁締鐐逛綅鍦ㄧ嚎鐜�
+ </template>
+ <el-tag type="danger" size="small">{{detail.carOnlineRate}}</el-tag>
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ <i class="el-icon-medal"></i>
+ 缁煎悎鍒嗘暟
</template>
<el-tag type="danger" size="small">{{detail.systemScore}}</el-tag>
</el-descriptions-item>
@@ -207,7 +225,7 @@
</template>
<script>
-import { listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore } from "@/api/platform/check-result";
+import { listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore, publishCheckResult } from "@/api/platform/check-result";
export default {
name: "CheckResult",
@@ -215,7 +233,9 @@
return {
detailTitle: '',
detailOpen: false,
- detail: {},
+ detail: {
+
+ },
manualScoreOpen: false,
manualScoreForm: {},
manualScoreTitle: '',
@@ -257,6 +277,22 @@
this.getList();
},
methods: {
+ frequencyFormatter(row) {
+ if (row.frequency === "1") {
+ return "鏈堝害鑰冩牳"
+ }
+ if (row.frequency === "2") {
+ return "瀛e害鑰冩牳"
+ }
+ },
+ examineRangeFormatter(row) {
+ if (row.examineRange === "1") {
+ return "鍒嗗眬鑰冩牳"
+ }
+ if (row.examineRange === "2") {
+ return "甯傚眬鑰冩牳"
+ }
+ },
/** 鏌ヨ鑰冩牳缁撴灉鍒楄〃 */
getList() {
this.loading = true;
@@ -304,18 +340,30 @@
manualScore(this.manualScoreForm).then(res => {
this.$modal.msgSuccess("鎿嶄綔鎴愬姛");
this.cancelManualScore();
+ this.getList();
})
},
handleSetManualScore(row) {
this.manualScoreForm.id = row.id;
- this.manualScoreForm.manualScore = row.manualScore;
+ this.manualScoreForm.manualScore = parseInt(row.manualScore);
this.manualScoreTitle = row.checkUnitName + '浜哄伐鎵撳垎'
this.manualScoreOpen = true;
},
handleDetail(row) {
this.detail = row;
+ this.detail.carOnlineRate = '97%';
this.detailTitle = row.checkUnitName + '鑰冩牳缁撴灉';
this.detailOpen = true;
+
+ },
+ handlePublish(row) {
+ const ids = row.id || this.ids;
+ this.$modal.confirm('鏄惁纭鍙戝竷鑰冩牳缁撴灉缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() {
+ return publishCheckResult(ids);
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("鍙戝竷鎴愬姛");
+ }).catch(() => {});
},
/** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -390,3 +438,27 @@
}
};
</script>
+<style>
+ .text {
+ font-size: 14px;
+ }
+ .time {
+ font-size: 13px;
+ color: #999;
+ margin-left: 10px;
+ }
+ .item {
+ margin-bottom: 18px;
+ }
+ .clearfix:before,
+ .clearfix:after {
+ display: table;
+ content: "";
+ }
+ .clearfix:after {
+ clear: both
+ }
+ .box-card {
+ width: 480px;
+ }
+</style>
--
Gitblit v1.8.0