From 14c7c489dccd062244410afd27c7235db3d27d63 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 24 四月 2024 16:00:08 +0800
Subject: [PATCH] 考核结果一级页面
---
src/views/system/result/index.vue | 371 ++++++++++++++----------------------
src/api/platform/check-score.js | 9
src/views/system/result/detail/index1.vue | 133 +++++++------
src/router/index.js | 26 +-
src/views/system/template/index.vue | 2
5 files changed, 241 insertions(+), 300 deletions(-)
diff --git a/src/api/platform/check-score.js b/src/api/platform/check-score.js
index 8724889..2871241 100644
--- a/src/api/platform/check-score.js
+++ b/src/api/platform/check-score.js
@@ -35,6 +35,15 @@
})
}
+// 淇敼鑰冩牳绉垎鏄庣粏
+export function publishScore(data) {
+ return request({
+ url: '/check/score/publish',
+ method: 'put',
+ data: data
+ })
+}
+
// 鍒犻櫎鑰冩牳绉垎鏄庣粏
export function delScore(id) {
return request({
diff --git a/src/router/index.js b/src/router/index.js
index 1d08e0d..0056dd9 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -72,19 +72,19 @@
}
]
},
- {
- path: '/contract/score',
- component: Layout,
- hidden: true,
- children: [
- {
- path: 'index',
- name: 'score',
- component: () => import('@/views/system/score/default/index'),
- meta: { title: '鍚堝悓绉垎', activeMenu: '/system/score' }
- }
- ]
- },
+ // {
+ // path: '/contract/score',
+ // component: Layout,
+ // hidden: true,
+ // children: [
+ // {
+ // path: 'index',
+ // name: 'score',
+ // component: () => import('@/views/system/score/default/index'),
+ // meta: { title: '鍚堝悓绉垎', activeMenu: '/system/score' }
+ // }
+ // ]
+ // },
{
path: '/check-result/contract',
component: Layout,
diff --git a/src/views/system/result/detail/index1.vue b/src/views/system/result/detail/index1.vue
index 6417889..9a13836 100644
--- a/src/views/system/result/detail/index1.vue
+++ b/src/views/system/result/detail/index1.vue
@@ -1,5 +1,5 @@
<template>
- <div style="padding: 5px">
+ <div style="padding: 0px 10px">
<div>
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" style="margin-bottom: 10px">
<el-menu-item index="1">鐪佸巺鑰冩牳</el-menu-item>
@@ -26,24 +26,35 @@
style="width: 100%">
<el-table-column
label="鑰冩牳鏃堕棿"
- prop="time"
+ prop="createTime"
align="center">
+ </el-table-column>
+ <el-table-column
+ label="鑰冩牳瀵硅薄"
+ prop="deptId"
+ align="center">
+ <template slot-scope="scope">
+ {{ translateDeptId(scope.row.deptId) }}
+ </template>
</el-table-column>
<el-table-column
label="鏍囩"
- prop="tag"
+ prop="examineTag"
align="center">
+ <template slot-scope="scope">
+ {{ scope.row.examineTag == 0 ? '鐪佸巺鑰冩牳' : '甯傚眬鑰冩牳' }}
+ </template>
</el-table-column>
<el-table-column
label="鑰冩牳绫诲瀷"
- prop="category"
+ prop="examineCategory"
align="center">
+ <template slot-scope="scope">
+ <dict-tag :options="dict.type.platform_examine_category" :value="scope.row.examineCategory"/>
+ </template>
</el-table-column>
- <el-table-column
- label="鑰冩牳棰戠巼"
- prop="frequency"
- align="center">
- </el-table-column>
+
+
<el-table-column
label="鍒嗘暟"
prop="score"
@@ -51,11 +62,8 @@
</el-table-column>
<el-table-column
label="鐘舵��"
- prop="state"
+ prop="publish"
align="center">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.platform_examine_use" :value="scope.row.state"/>
- </template>
</el-table-column>
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@@ -88,74 +96,80 @@
</template>
<script>
+import { listScore, getScore, delScore, addScore, updateScore,publishScore} from "@/api/platform/check-score";
+import { areaSelect } from '@/api/system/dept'
import * as echarts from 'echarts';
let lineChart = null;
let observer = null;
export default {
name: 'index',
- dicts: ['platform_examine_use'],
+ dicts: ['platform_examine_use','platform_examine_category'],
data() {
return {
activeIndex: '1',
- activeIndex2: '1',
+ activeIndex2: '2',
+ areaList:[],
dateRange: '',
company: '',
+ queryParams: {
+ pageNum: 1,
+ pageSize: 10,
+ deptId: null,
+ },
dataList: [
{
name: '鍏ㄩ儴',
complete: { '4.5': 95.5, '4.6': 95.3, '4.7': 96.0, '4.8': 97.2, '4.9': 96.5 ,
- '4.10': 95.5, '4.11': 95.3, '4.12': 96.0, '4.13': 97.2, '4.14': 96.5 },
- waiting: { '4.5': 94.8, '4.6': 91.3, '4.7': 95.3, '4.8': 92.3, '4.9': 93.3,
- '4.10': 94.8, '4.11': 91.3, '4.12': 95.3, '4.13': 92.3, '4.14': 93.3 },
- pending: { '4.5': 91.6, '4.6': 92.6, '4.7': 93.7, '4.8': 94.0, '4.9': 95.9
- ,'4.10': 91.6, '4.11': 92.6, '4.12': 93.7, '4.13': 94.0, '4.14': 95.9 }
+ '4.10': 95.5, '4.11': 95.3, '4.12': 96.0, '4.13': 97.2, '4.14': 96.5 ,
+ '4.15': 95.5, '4.16': 95.3, '4.17': 96.0, '4.18': 97.2, '4.19': 96.5 ,
+ '4.20': 95.5, '4.21': 95.3, '4.22': 96.0, '4.23': 97.2, '4.24': 96.5,
+ '4.25': 95.5, '4.26': 95.3, '4.27': 96.0, '4.28': 97.2, '4.29': 96.5 ,
+ },
+ // waiting: { '4.5': 94.8, '4.6': 91.3, '4.7': 95.3, '4.8': 92.3, '4.9': 93.3,
+ // '4.10': 94.8, '4.11': 91.3, '4.12': 95.3, '4.13': 92.3, '4.14': 93.3 },
+ // pending: { '4.5': 91.6, '4.6': 92.6, '4.7': 93.7, '4.8': 94.0, '4.9': 95.9
+ // ,'4.10': 91.6, '4.11': 92.6, '4.12': 93.7, '4.13': 94.0, '4.14': 95.9 }
}
],
- tableData: [
- {
- time: '2024-04-15',
- tag: '鐪佸巺鑰冩牳',
- category: '杞﹁締鑰冩牳',
- frequency: '鏈堝害鑰冩牳',
- score: '96.5',
- state: '0',
- publish: '0'
- },
- {
- time: '2024-04-15',
- tag: '鐪佸巺鑰冩牳',
- category: '浜鸿劯鑰冩牳',
- frequency: '鏈堝害鑰冩牳',
- score: '93.3',
- state: '0',
- publish: '0'
- },
- {
- time: '2024-04-15',
- tag: '鐪佸巺鑰冩牳',
- category: '瑙嗛鑰冩牳',
- frequency: '鏈堝害鑰冩牳',
- score: '95.9',
- state: '0',
- publish: '0'
- },
- {
- time: '2024-04-14',
- tag: '鐪佸巺鑰冩牳',
- category: '杞﹁締鑰冩牳',
- frequency: '鏈堝害鑰冩牳',
- score: '96.5',
- state: '1',
- publish: '1'
- },
- ],
+ tableData: [],
searchForm: {
time: null,
}
}
},
+ created() {
+ //鑰冩牳鎴愮哗璇︽儏璺宠浆鍙傛暟鎺ユ敹
+ console.log(this.$route.query.index)
+ if(this.$route.query.index){
+ this.queryParams.deptId = this.$route.query.index
+ }
+ this.getList(this.$route.query.index);
+ this.areaSelect();
+ },
methods: {
-
+ // 鍖哄煙涓嬫媺鏁版嵁
+ areaSelect() {
+ areaSelect().then(res => {
+ this.areaList = res.data;
+ })
+ },
+ translateDeptId(deptId) {
+ const department = this.areaList.find(dept => dept.id == deptId);
+ return department ? department.value : '鏈煡';
+ },
+ /** 瀵艰埅鍒囨崲 */
+ handleSelect(key){
+ this.activeIndex = key; // 鏇存柊褰撳墠婵�娲荤殑鑿滃崟椤�
+ this.getList();
+ },
+ /** 鏌ヨ鑰冩牳妯℃澘鍒楄〃 */
+ getList(deptId) {
+ this.loading = true;
+ listScore(this.queryParams).then(response => {
+ this.tableData = response.data[deptId];
+ this.loading = false;
+ });
+ },
handleSizeChange(val) {
console.log(`姣忛〉 ${val} 鏉);
},
@@ -241,7 +255,6 @@
};
lineChart.setOption(option, true);
},
-
// 鐩戝惉鍙樺寲
observe() {
diff --git a/src/views/system/result/index.vue b/src/views/system/result/index.vue
index 334fc76..ac0043a 100644
--- a/src/views/system/result/index.vue
+++ b/src/views/system/result/index.vue
@@ -1,5 +1,12 @@
<template>
<div id="warp">
+ <div>
+ <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" style="margin-bottom: 10px">
+ <el-menu-item index="1">鐪佸巺鑰冩牳</el-menu-item>
+ <el-menu-item index="2">甯傚眬鑰冩牳</el-menu-item>
+ </el-menu>
+ </div>
+
<div class="data-chart-container">
<el-card class="data-card" :body-style="{ height: '100%' }">
<div class="card-content">
@@ -10,239 +17,56 @@
</el-date-picker>
</div>
</div>
-
<div class="echart-container">
<div id="barChart" ref="barChart"></div>
</div>
</div>
</el-card>
</div>
- <el-row :gutter="100">
- <el-col :span="6">
- <div class="city-warp">
- <div class="city">
- <div class="title">
- 鑷祦浜�
- </div>
- <div class="score-warp">
- <div class="score-item">
- <div style="font-size: 15px;margin-bottom: 15px">2024骞�4鏈�12鏃�</div>
+
+ <div>
+ <el-row :gutter="100">
+ <el-col :span="6" v-for="(city, index) in checkScoreList" :key="index">
+ <div class="city-warp">
+ <div class="city">
+ <div class="title">
+ {{ translateDeptId(index) }}
</div>
- <div class="score-item">
- <div>瑙嗛锛�</div>
- <div class="score">99.5</div>
+ <div class="score-warp">
+ <div class="score-item">
+ <div style="font-size: 15px; margin-bottom: 15px">{{ formatCreateDate(city[0].createTime) }}</div>
+ </div>
+ <div v-for="(score, scoreIndex) in city" :key="scoreIndex">
+ <div class="score-item">
+ <div v-if="score.examineCategory == 0">杞﹁締锛�</div>
+ <div v-else-if="score.examineCategory == 1">浜鸿劯锛�</div>
+ <div v-else-if="score.examineCategory == 2">瑙嗛锛�</div>
+ <div class="score">{{ score.score }}</div>
+ </div>
+ </div>
</div>
- <div class="score-item">
- <div>浜鸿劯锛�</div>
- <div class="score">87</div>
+ <div class="bottom-publish">
+ <el-button
+ size="medium"
+ :type="isAnyUnpublished(city) ? 'success' : 'danger'"
+ @click="publish(city)"
+ >
+ {{ isAnyUnpublished(city) ? '鍙戝竷' : '鍙栨秷' }}
+ </el-button>
+ <el-button size="medium" @click="jumpDetail(index)" type="info">璇︽儏</el-button>
</div>
- <div class="score-item">
- <div>杞﹁締锛�</div>
- <div class="score">94</div>
- </div>
- </div>
- <div class="bottom-publish">
- <el-button size="medium" type="success">鍙戝竷</el-button>
- <el-button size="medium" @click="jumpDetail" type="info">璇︽儏</el-button>
</div>
</div>
- </div>
- </el-col>
- <el-col :span="6">
- <div class="city-warp">
- <div class="city">
- <div class="title">
- 瀵岄『
- </div>
- <div class="score-warp">
- <div class="score-item">
- <div style="font-size: 15px;margin-bottom: 15px">2024骞�4鏈�12鏃�</div>
- </div>
- <div class="score-item">
- <div>瑙嗛锛�</div>
- <div class="score">99.5</div>
- </div>
- <div class="score-item">
- <div>浜鸿劯锛�</div>
- <div class="score">87</div>
- </div>
- <div class="score-item">
- <div>杞﹁締锛�</div>
- <div class="score">94</div>
- </div>
-
- </div>
- <div class="bottom-publish">
- <el-button size="medium" v-hasPermi="['calculate:rule:add']" type="success">鍙戝竷</el-button>
- <el-button size="medium" v-hasPermi="['calculate:rule:query']" @click="jumpDetail" type="info">璇︽儏</el-button>
- </div>
- </div>
- </div>
- </el-col>
- <el-col :span="6">
- <div class="city-warp">
- <div class="city">
- <div class="title">
- 鑽e幙
- </div>
- <div class="score-warp">
- <div class="score-item">
- <div style="font-size: 15px;margin-bottom: 15px">2024骞�4鏈�12鏃�</div>
- </div>
- <div class="score-item">
- <div>瑙嗛锛�</div>
- <div class="score">99.5</div>
- </div>
- <div class="score-item">
- <div>浜鸿劯锛�</div>
- <div class="score">87</div>
- </div>
- <div class="score-item">
- <div>杞﹁締锛�</div>
- <div class="score">94</div>
- </div>
-
- </div>
- <div class="bottom-publish">
- <el-button size="medium" type="success">鍙戝竷</el-button>
- <el-button size="medium" @click="jumpDetail" type="info">璇︽儏</el-button>
- </div>
- </div>
- </div>
- </el-col>
- <el-col :span="6">
- <div class="city-warp">
- <div class="city">
- <div class="title">
- 娌挎哗鍖�
- </div>
- <div class="score-warp">
- <div class="score-item">
- <div style="font-size: 15px;margin-bottom: 15px">2024骞�4鏈�12鏃�</div>
- </div>
- <div class="score-item">
- <div>瑙嗛锛�</div>
- <div class="score">99.5</div>
- </div>
- <div class="score-item">
- <div>浜鸿劯锛�</div>
- <div class="score">87</div>
- </div>
- <div class="score-item">
- <div>杞﹁締锛�</div>
- <div class="score">94</div>
- </div>
-
- </div>
- <div class="bottom-publish">
- <el-button size="medium" type="success">鍙戝竷</el-button>
- <el-button size="medium" @click="jumpDetail" type="info">璇︽儏</el-button>
- </div>
- </div>
- </div>
- </el-col>
-
-
- </el-row>
-
- <el-row style="margin-top: 30px" :gutter="100">
- <el-col :span="6">
- <div class="city-warp">
- <div class="city">
- <div class="title">
- 楂樻柊鍖�
- </div>
- <div class="score-warp">
- <div class="score-item">
- <div style="font-size: 15px;margin-bottom: 15px">2024骞�4鏈�12鏃�</div>
- </div>
- <div class="score-item">
- <div>瑙嗛锛�</div>
- <div class="score">99.5</div>
- </div>
- <div class="score-item">
- <div>浜鸿劯锛�</div>
- <div class="score">87</div>
- </div>
- <div class="score-item">
- <div>杞﹁締锛�</div>
- <div class="score">94</div>
- </div>
- </div>
- <div class="bottom-publish">
- <el-button size="medium" type="success">鍙戝竷</el-button>
- <el-button size="medium" @click="jumpDetail" type="info">璇︽儏</el-button>
- </div>
- </div>
- </div>
- </el-col>
- <el-col :span="6">
- <div class="city-warp">
- <div class="city">
- <div class="title">
- 澶у畨鍖�
- </div>
- <div class="score-warp">
- <div class="score-item">
- <div style="font-size: 15px;margin-bottom: 15px">2024骞�4鏈�12鏃�</div>
- </div>
- <div class="score-item">
- <div>瑙嗛锛�</div>
- <div class="score">99.5</div>
- </div>
- <div class="score-item">
- <div>浜鸿劯锛�</div>
- <div class="score">87</div>
- </div>
- <div class="score-item">
- <div>杞﹁締锛�</div>
- <div class="score">94</div>
- </div>
- </div>
- <div class="bottom-publish">
- <el-button size="medium" type="success">鍙戝竷</el-button>
- <el-button size="medium" @click="jumpDetail" type="info">璇︽儏</el-button>
- </div>
- </div>
- </div>
- </el-col>
- <el-col :span="6">
- <div class="city-warp">
- <div class="city">
- <div class="title">
- 璐′簳鍖�
- </div>
- <div class="score-warp">
- <div class="score-item">
- <div style="font-size: 15px;margin-bottom: 15px">2024骞�4鏈�12鏃�</div>
- </div>
- <div class="score-item">
- <div>瑙嗛锛�</div>
- <div class="score">99.5</div>
- </div>
- <div class="score-item">
- <div>浜鸿劯锛�</div>
- <div class="score">87</div>
- </div>
- <div class="score-item">
- <div>杞﹁締锛�</div>
- <div class="score">94</div>
- </div>
-
- </div>
- <div class="bottom-publish">
- <el-button size="medium" type="success">鍙戝竷</el-button>
- <el-button size="medium" @click="jumpDetail" type="info">璇︽儏</el-button>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
+ </el-col>
+ </el-row>
+ </div>
</div>
</template>
<script>
+import { areaSelect } from '@/api/system/dept';
+import { listScore, getScore, delScore, addScore, updateScore,publishScore} from "@/api/platform/check-score";
import * as echarts from 'echarts';
let observer = null;
let chart = null;
@@ -250,8 +74,14 @@
name: 'index',
data() {
return {
+ province:{
+ id: [],
+ publish: null,
+ },
+ checkScoreList:[],
+ areaList:[],
activeIndex: '1',
- activeIndex2: '1',
+ activeIndex2: '2',
date: '',
company: '',
dataList: {
@@ -260,11 +90,29 @@
data2: [93.7, 93.5, 94.3, 96.5, 95.3, 94.2, 93.3],
data3: [98.3, 94.3, 93.3, 95.5, 96.8, 96.1, 95.8],
},
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ examineTag: null,
+ createTime: null
+ },
}
},
+ created() {
+ this.getList();
+ this.areaSelect();
+ },
+ mounted() {
+ chart = echarts.init(this.$refs.barChart);
+ this.initEchart();
+ },
methods: {
- jumpDetail() {
- this.$router.push("/examine/detail")
+ jumpDetail(index) {
+ this.$router.push({
+ path: '/examine/detail',
+ query: {
+ index: index
+ }
+ })
},
initEchart() {
const option = {
@@ -319,13 +167,82 @@
]
}
chart.setOption(option, true);
+ },
+ // 鍖哄煙涓嬫媺鏁版嵁
+ areaSelect() {
+ areaSelect().then(res => {
+ this.areaList = res.data;
+ })
+ },
+ translateDeptId(deptId) {
+ const department = this.areaList.find(dept => dept.id === deptId);
+ return department ? department.value : '鏈煡';
+ },
- }
+ isAnyUnpublished(city) {
+ // 妫�鏌� city 鐨� score 鏁扮粍涓槸鍚︽湁浠讳綍涓�涓殑 publish 灞炴�т负 'UNPUBLISHED'
+ return city.some(score => score.publish === 'UNPUBLISHED');
+ },
+ formatCreateDate(dateString) {
+ const date = new Date(dateString);
+ const year = date.getFullYear();
+ const month = date.getMonth() + 1; // getMonth() 杩斿洖鐨勬湀浠芥槸浠� 0 寮�濮嬬殑锛屾墍浠ヨ鍔� 1
+ const day = date.getDate();
+
+ // 浣跨敤 padStart 鏂规硶纭繚鏈堜唤鍜屾棩鏈熷缁堟槸涓や綅鏁�
+ const formattedMonth = month.toString().padStart(2, '0');
+ const formattedDay = day.toString().padStart(2, '0');
+
+ return `${year}骞�${formattedMonth}鏈�${formattedDay}鍙穈;
+ },
+ /** 瀵艰埅鍒囨崲 */
+ handleSelect(key){
+ this.activeIndex = key; // 鏇存柊褰撳墠婵�娲荤殑鑿滃崟椤�
+ this.getList();
+ },
+ /** 鏌ヨ鑰冩牳鎴愮哗鍒楄〃 */
+ getList() {
+ this.loading = true;
+ if (this.activeIndex === '1') {
+ this.queryParams.examineTag = '0'; // 鐪佸巺鑰冩牳
+ } else if (this.activeIndex === '2') {
+ this.queryParams.examineTag = '1'; // 鍖哄煙鑰冩牳
+ }
+ // 鑾峰彇褰撳墠鏃ユ湡
+ const today = new Date();
+
+ // 璁$畻鏄ㄥぉ鐨勬棩鏈�
+ const yesterday = new Date(today);
+ yesterday.setDate(today.getDate() - 1);
+
+ // 灏嗘槰澶╃殑鏃ユ湡鏍煎紡鍖栦负瀛楃涓诧紝杩欓噷鍋囪鍚庣鏈熸湜鐨勬槸ISO 8601鏍煎紡
+ this.queryParams.createTime = yesterday.toISOString().split('T')[0];
+
+ console.log(this.queryParams);
+ listScore(this.queryParams).then(response => {
+ this.checkScoreList = response.data;
+ console.log(this.checkScoreList);
+ this.loading = false;
+ });
+ },
+ publish(city){
+ let text = this.isAnyUnpublished(city) ? "鍙戝竷":"鍙栨秷鍙戝竷";
+ const cityName = this.translateDeptId(parseInt(city[0].deptId));
+ this.province.publish = text === "鍙戝竷" ? "PUBLISHED" : "UNPUBLISHED";
+ this.province.id = city.map(city => city.id);
+ this.$modal.confirm('鏄惁纭' + text + '鑰冩牳鍚嶄负"' + cityName + '"鐨勬暟鎹」锛�')
+ .then(() => {
+ return publishScore(this.province);
+ })
+ .then(() => {
+ this.getList();
+ this.$modal.msgSuccess(text + "鎴愬姛");
+ })
+ .catch(() => {
+ // 閿欒澶勭悊閫昏緫
+ });
+ },
},
- mounted() {
- chart = echarts.init(this.$refs.barChart);
- this.initEchart();
- }
}
</script>
@@ -345,9 +262,10 @@
.score {
width: 60px;
text-align: right;
+ padding: 3px 0;
}
#warp {
- padding: 20px;
+ padding: 0 10px;
}
.city-warp {
display: flex;
@@ -355,6 +273,7 @@
align-items: center;
justify-content: center;
height: 210px;
+ margin-bottom: 25px;
}
.city {
width: 240px;
diff --git a/src/views/system/template/index.vue b/src/views/system/template/index.vue
index 2f4a281..f6a88db 100644
--- a/src/views/system/template/index.vue
+++ b/src/views/system/template/index.vue
@@ -222,7 +222,7 @@
<script>
import { listCheckTemplate, getCheckTemplate, delCheckTemplate, addCheckTemplate, updateCheckTemplate,copyCheckTemplate } from "@/api/platform/check-template";
- import { areaSelect } from '@/api/system/dept'
+import { areaSelect } from '@/api/system/dept'
import { listCheckRule } from "../../../api/platform/check-rule";
export default {
--
Gitblit v1.8.0