From e5d499ae6a4e6b320f71c49987b76cc11f6bc1e4 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 28 十月 2025 14:13:10 +0800
Subject: [PATCH] 首页问题
---
src/views/system/check/result/detail/detail.vue | 313 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 238 insertions(+), 75 deletions(-)
diff --git a/src/views/system/check/result/detail/detail.vue b/src/views/system/check/result/detail/detail.vue
index b6db3cf..cd5733a 100644
--- a/src/views/system/check/result/detail/detail.vue
+++ b/src/views/system/check/result/detail/detail.vue
@@ -1,28 +1,52 @@
<template>
- <div class="app-container">
- <el-page-header @back="goBack()" content="璇︽儏椤甸潰">
- </el-page-header>
-
+ <div style="padding: 0px 10px">
+ <div >
+ <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
+ >
+ <el-menu-item index="0">鐪佸巺鑰冩牳</el-menu-item>
+ <el-menu-item index="1">鍖哄幙鑰冩牳</el-menu-item>
+ <el-menu-item index="2" v-if ="examineCategory==1">鍏畨閮ㄨ�冩牳</el-menu-item>
+ </el-menu>
+ </div>
<el-container>
<el-main>
<h2>鑰冩牳瑙勫垯</h2>
- <el-table v-loading="loading" :data="checkRuleList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center"/>
- <el-table-column label="瑙勫垯鍚嶇О" align="center" prop="checkRuleName"/>
- <el-table-column label="瑙勫垯鏉冮噸" align="center" prop="weight"/>
- <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleRuleUpdate(scope.row)"
- >淇敼
- </el-button>
- </template>
- </el-table-column>
- </el-table>
-
+ <el-row :gutter="20">
+ <el-col
+ :xl="3"
+ :lg="3"
+ :md="6"
+ :sm="6"
+ :xs="12"
+ v-for="(item, index) in checkRuleList"
+ :key="index"
+ :style="item.name == '' ? 'display:none' : ''"
+ class="col-margin"
+ >
+ <el-card
+ style="
+ min-width: 150px;
+ width: 100%;
+ height: 150px;
+ text-align: center;
+ margin-bottom: 20px;
+ "
+ >
+ <div style="display: flex; flex-direction: row-reverse">
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-edit"
+ @click="handleRuleUpdate(item)"
+ v-hasPermi="['check:template:edit']"
+ >淇敼
+ </el-button>
+ </div>
+ <div style="font-size: 14px;height: 50px; font-weight: bold;">{{ item.checkRuleName }}</div>
+ <div style="font-size: 14px;">瑙勫垯鏉冮噸锛歿{ item.weight }}</div>
+ </el-card>
+ </el-col>
+ </el-row>
</el-main>
</el-container>
@@ -37,31 +61,84 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
- >瀵煎嚭
+ v-hasPermi="['check:result:detail:export']"
+ >瀵煎嚭
</el-button>
</el-col>
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
- <el-form-item label="鑰冩牳鏃ユ湡" prop="name">
- <el-date-picker v-model="date" format="yyyy-MM" value-format="yyyy-MM" type="month" placeholder="閫夋嫨鏃ユ湡"
- @change="dateChange">
+ <el-form
+ :model="queryParams"
+ ref="queryForm"
+ size="small"
+ :inline="true"
+ v-show="showSearch"
+ >
+ <el-form-item label="鑰冩牳鏃堕棿">
+ <el-date-picker
+ :clearable="false"
+ v-model="queryParams.quarter"
+ type="monthrange"
+ format="yyyy-MM"
+ value-format="yyyy-MM"
+ unlink-panels
+ range-separator="鑷�"
+ start-placeholder="寮�濮嬫湀浠�"
+ end-placeholder="缁撴潫鏈堜唤"
+ @change="quarterChange"
+ :picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+ <el-button
+ type="primary"
+ icon="el-icon-search"
+ size="mini"
+ @click="handleQuery"
+ >鎼滅储</el-button
+ >
</el-form-item>
</el-form>
-
</el-row>
- <el-table v-loading="loading" :data="dataMap" @selection-change="handleSelectionChange">
- <el-table-column label="鑰冩牳鏃ユ湡" align="center" prop="create_time" width="120px" fixed>
+ <el-table
+ v-loading="loading"
+ :data="dataMap"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column
+ label="鑰冩牳鏃ユ湡"
+ align="center"
+ prop="create_time"
+ width="120px"
+ fixed
+ >
<template slot-scope="scope">
- <span>{{ scope.row.create_time.split('T')[0] }}</span>
+ <span>{{ scope.row.create_time.split("T")[0] }}</span>
</template>
</el-table-column>
- <el-table-column label="鑰冩牳瀵硅薄" align="center" prop="dept_id" width="120px" fixed>
+ <el-table-column
+ label="鑰冩牳瀵硅薄"
+ align="center"
+ prop="dept_id"
+ width="120px"
+ fixed
+ >
<template slot-scope="scope">
<span>{{ translateDeptId(scope.row.dept_id) }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鑰冩牳鏍囩"
+ align="center"
+ prop="dept_id"
+ width="120px"
+ fixed
+ >
+ <template slot-scope="scope">
+ {{
+ scope.row.examine_tag === 0 ? '鐪佸巺鑰冩牳' :
+ scope.row.examine_tag === 1 ? '鍖哄幙鑰冩牳' :
+ scope.row.examine_tag === 2 ? '鍏畨閮ㄨ�冩牳' : '鏈煡'
+ }}
</template>
</el-table-column>
<template v-for="item in tableData">
@@ -72,7 +149,7 @@
width="180px"
>
<template slot-scope="scope">
- <span>{{ scope.row[item.ruleIndex] }}</span>
+ <span>{{ (scope.row[item.ruleIndex] * 100).toFixed(2) + '%'}}</span>
</template>
</el-table-column>
</template>
@@ -91,23 +168,42 @@
</el-container>
<!-- 淇敼鑰冩牳鏉冮噸瀵硅瘽妗� -->
- <el-dialog :title="title" :visible.sync="ruleOpen" width="600px" append-to-body>
+ <el-dialog
+ :title="title"
+ :visible.sync="ruleOpen"
+ width="600px"
+ append-to-body
+ >
<el-form ref="form" :model="ruleForm" :rules="rules" label-width="80px">
<el-form-item label="瑙勫垯鍚嶇О" prop="checkRuleName">
- <el-input v-model="ruleForm.checkRuleName" placeholder="璇疯緭鍏ヨ鍒欏悕绉�" disabled/>
+ <el-input
+ v-model="ruleForm.checkRuleName"
+ placeholder="璇疯緭鍏ヨ鍒欏悕绉�"
+ disabled
+ />
</el-form-item>
<el-form-item label="瑙勫垯鏉冮噸" prop="weight">
- <el-input-number v-model="ruleForm.weight" :precision="1" :step="0.1" placeholder="璇疯緭鍏ヨ鍒欐潈閲�"/>
+ <el-input-number
+ v-model="ruleForm.weight"
+ :precision="1"
+ :step="0.1"
+ placeholder="璇疯緭鍏ヨ鍒欐潈閲�"
+ />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
<el-button @click="cancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
</div>
</el-dialog>
<!-- 淇敼鑰冩牳鎸囨爣瀵硅瘽妗� -->
- <el-dialog :title="title" :visible.sync="indexOpen" width="600px" append-to-body>
+ <el-dialog
+ :title="title"
+ :visible.sync="indexOpen"
+ width="600px"
+ append-to-body
+ >
<el-form ref="form" :model="indexForm" :rules="rules" label-width="150px">
<el-form-item label="鑰冩牳鏃ユ湡" prop="create_time">
<el-input v-model="formattedCreateTime" placeholder="" disabled>
@@ -115,32 +211,68 @@
</el-form-item>
<div v-for="item in tableData" :key="item.ruleIndex">
<el-form-item :label="item.ruleName" :prop="item.ruleIndex">
- <el-input-number v-model="indexForm[item.ruleIndex]" :precision="4" :step="0.1" placeholder="璇疯緭鍏ユ寚鏍�"></el-input-number>
+ <el-input-number
+ v-model="indexForm[item.ruleIndex]"
+ :precision="4"
+ :step="0.1"
+ placeholder="璇疯緭鍏ユ寚鏍�"
+ ></el-input-number>
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
<el-button @click="cancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
-
-import {listScore, getScoreIndex, delScore, addScore, updateScore} from "@/api/platform/check-score";
-import {updateWeight} from "@/api/platform/check-template";
-import {areaSelect} from '@/api/system/dept'
+import {
+ listScore,
+ getScoreIndex,
+ delScore,
+ addScore,
+ updateScore,
+} from "@/api/platform/check-score";
+import { updateWeight } from "@/api/platform/check-template";
+import { areaSelect } from "@/api/system/dept";
export default {
name: "CheckResult",
- dicts: ['platform_audit_state'],
+ dicts: ["platform_audit_state"],
data() {
return {
+ pickerOptions: {
+ shortcuts: [{
+ text: '绗竴瀛e害',
+ onClick(picker) {
+ picker.$emit('pick', [new Date(new Date().getFullYear() + "-01"), new Date(new Date().getFullYear() + "-03")]);
+ }
+ },
+ {
+ text: '绗簩瀛e害',
+ onClick(picker) {
+ picker.$emit('pick', [new Date(new Date().getFullYear() + "-04"), new Date(new Date().getFullYear() + "-06")]);
+ }
+ },
+ {
+ text: '绗笁瀛e害',
+ onClick(picker) {
+ picker.$emit('pick', [new Date(new Date().getFullYear() + "-07"), new Date(new Date().getFullYear() + "-09")])
+ }
+ },
+ {
+ text: '绗洓瀛e害',
+ onClick(picker) {
+ picker.$emit('pick', [new Date(new Date().getFullYear() + "-10"), new Date(new Date().getFullYear() + "-12")])
+ }
+ }]
+ },
id: null,
examineCategory: null,
- date: '',
+ date: "",
examineTag: null,
deptId: null,
areaList: [],
@@ -148,7 +280,7 @@
dataMap: [],
manualScoreOpen: false,
manualScoreForm: {},
- manualScoreTitle: '',
+ manualScoreTitle: "",
// 閬僵灞�
loading: true,
// 閫変腑鏁扮粍
@@ -178,22 +310,36 @@
queryParams: {
id: null,
date: null,
+ quarter: null,
+ examineTag: null,
+ examineTags: [],
+ deptId: null
},
// 琛ㄥ崟鏍¢獙
- rules: {}
+ rules: {},
};
},
computed: {
formattedCreateTime() {
// 濡傛灉 create_time 瀛樺湪锛屽垯杩斿洖鏃ユ湡閮ㄥ垎锛屽惁鍒欒繑鍥炵┖瀛楃涓�
- return this.indexForm.create_time ? this.indexForm.create_time.split('T')[0] : '';
+ return this.indexForm.create_time
+ ? this.indexForm.create_time.split("T")[0]
+ : "";
},
},
created() {
//鑰冩牳鎴愮哗璇︽儏璺宠浆鍙傛暟鎺ユ敹
if (this.$route.query.id) {
- this.queryParams.id = this.$route.query.id
+ this.queryParams.id = this.$route.query.id;
}
+ if(this.$route.query.deptId){
+ this.queryParams.deptId = this.$route.query.deptId;
+ }
+ this.examineCategory = this.$route.query.examineCategory;
+ let examineTag = this.$route.query.examineTag;
+ this.activeIndex = examineTag;
+ this.queryParams.examineTag = examineTag;
+ this.queryParams.examineTags.push(examineTag);
// 鑰冩牳绉垎鍒楄〃
this.getList();
this.areaSelect();
@@ -202,10 +348,10 @@
/** 鏌ヨ鑰冩牳璁″垎鍒楄〃 */
getList() {
this.loading = true;
- getScoreIndex(this.queryParams).then(response => {
+ getScoreIndex(this.queryParams).then((response) => {
this.checkRuleList = response.data.checkRuleList;
this.dataMap = response.data.scoreMap.dataMap;
- this.tableData = response.data.scoreMap.tableData
+ this.tableData = response.data.scoreMap.tableData;
this.loading = false;
});
},
@@ -226,18 +372,25 @@
this.resetForm(formName);
},
translateDeptId(deptId) {
- const department = this.areaList.find(dept => dept.id == deptId);
- return department ? department.value : '鏈煡';
+ const department = this.areaList.find((dept) => dept.id == deptId);
+ return department ? department.value : "鏈煡";
},
// 鍖哄煙涓嬫媺鏁版嵁
areaSelect() {
- areaSelect().then(res => {
+ areaSelect().then((res) => {
this.areaList = res.data;
- })
+ });
},
/** 杩斿洖鎸夐挳 */
goBack() {
- const obj = { path: "/check/detail", query: { index: this.$route.query.deptId, examineTag: this.$route.query.examineTag, pageNum: this.$route.query.pageNum } };
+ const obj = {
+ path: "/check/detail",
+ query: {
+ index: this.$route.query.deptId,
+ examineTag: this.$route.query.examineTag,
+ pageNum: this.$route.query.pageNum,
+ },
+ };
this.$tab.closeOpenPage(obj);
},
// 鍏抽棴褰撳墠tab椤电锛屾墦寮�鏂伴〉绛�
@@ -248,8 +401,11 @@
}
},
dateChange() {
- this.queryParams.date = this.date;
- console.log(this.queryParams);
+ this.queryParams.quarter = null;
+ this.getList();
+ },
+ quarterChange() {
+ this.queryParams.date = null;
this.getList();
},
/** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -264,9 +420,9 @@
},
// 澶氶�夋閫変腑鏁版嵁
handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id)
- this.single = selection.length !== 1
- this.multiple = !selection.length
+ this.ids = selection.map((item) => item.id);
+ this.single = selection.length !== 1;
+ this.multiple = !selection.length;
},
/** 鏂板鎸夐挳鎿嶄綔 */
handleAdd() {
@@ -281,19 +437,28 @@
this.indexOpen = true;
this.title = "淇敼鑰冩牳鎸囨爣";
},
+ /** 瀵艰埅鍒囨崲 */
+ handleSelect(key) {
+ this.activeIndex = key;
+ this.queryParams.examineTag = key;
+ // 鑰冩牳绉垎鍒楄〃
+ this.getList();
+
+
+ },
/** 淇敼鎸夐挳鎿嶄綔 */
handleRuleUpdate(row) {
this.reset("ruleForm");
- this.ruleForm = row;
+ this.ruleForm = JSON.parse(JSON.stringify(row));
this.ruleOpen = true;
this.title = "淇敼鑰冩牳瑙勫垯";
},
/** 鎻愪氦鎸夐挳 */
submitForm() {
- this.$refs["form"].validate(valid => {
+ this.$refs["form"].validate((valid) => {
if (valid) {
if (this.ruleForm.id != null) {
- updateWeight(this.ruleForm).then(response => {
+ updateWeight(this.ruleForm).then((response) => {
this.$modal.msgSuccess("淇敼鎴愬姛");
this.ruleOpen = false;
this.getList();
@@ -304,21 +469,19 @@
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
- this.download('/check/score/export', {
- ...this.queryParams
- }, `鑰冩牳鎸囨爣_${new Date().getTime()}.xlsx`)
+ this.download(
+ "/check/score/detailExport",
+ {
+ ...this.queryParams,
+ },
+ `鑰冩牳鎸囨爣_${new Date().getTime()}.xlsx`
+ );
},
- handleSelect(key, keyPath) {
- console.log(key, keyPath);
- },
- }
+ },
};
</script>
<style scoped>
-
-
.header-container h2 {
margin-right: 10px; /* 鏍规嵁闇�瑕佽皟鏁存爣棰樺拰鑿滃崟涔嬮棿鐨勯棿璺� */
}
-
</style>
--
Gitblit v1.8.0