From b5c6e17f2e9cb10ed323c1adfa2e449bab307134 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 17 一月 2025 15:15:12 +0800 Subject: [PATCH] 考核结果路由跳转、工单详情权限 --- src/views/system/check/result/detail/index.vue | 126 +++++++++++++++++++++++++---------------- 1 files changed, 77 insertions(+), 49 deletions(-) diff --git a/src/views/system/check/result/detail/index.vue b/src/views/system/check/result/detail/index.vue index 227acca..52e2695 100644 --- a/src/views/system/check/result/detail/index.vue +++ b/src/views/system/check/result/detail/index.vue @@ -2,9 +2,10 @@ <div style="padding: 0px 10px"> <div> <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" - style="margin-bottom: 10px"> + style="margin-bottom: 10px"> <el-menu-item index="0">鐪佸巺鑰冩牳</el-menu-item> - <el-menu-item index="1">鍖哄煙鑰冩牳</el-menu-item> + <el-menu-item index="1">鍖哄幙鑰冩牳</el-menu-item> + <el-menu-item index="2">鍏畨閮ㄨ�冩牳</el-menu-item> </el-menu> </div> @@ -15,7 +16,7 @@ <h1>鑰冩牳鎴愮哗</h1> <div class="select-container"> <el-date-picker v-model="date" format="yyyy-MM" value-format="yyyy-MM" type="month" placeholder="閫夋嫨鏃ユ湡" - @change="dateChange"> + @change="dateChange"> </el-date-picker> </div> </div> @@ -37,12 +38,16 @@ </el-table-column> <el-table-column label="鏍囩" prop="examineTag" align="center"> <template slot-scope="scope"> - {{ scope.row.examineTag == 0 ? '鐪佸巺鑰冩牳' : '甯傚眬鑰冩牳' }} + {{ + scope.row.examineTag === 0 ? '鐪佸巺鑰冩牳' : + scope.row.examineTag === 1 ? '鍖哄幙鑰冩牳' : + scope.row.examineTag === 2 ? '鍏畨閮ㄨ�冩牳' : '鏈煡' + }} </template> </el-table-column> <el-table-column label="鑰冩牳绫诲瀷" prop="examineCategory" align="center"> <template slot-scope="scope"> - <dict-tag :options="dict.type.platform_examine_category" :value="scope.row.examineCategory" /> + <dict-tag :options="dict.type.platform_examine_category" :value="scope.row.examineCategory"/> </template> </el-table-column> @@ -51,32 +56,38 @@ </el-table-column> <el-table-column label="鐘舵��" prop="publish" align="center"> <template slot-scope="scope"> - <dict-tag :options="dict.type.platform_is_publish" :value="scope.row.publish" /> + <dict-tag :options="dict.type.platform_is_publish" :value="scope.row.publish"/> </template> </el-table-column> <el-table-column label="鎿嶄綔" align="center"> <template slot-scope="scope"> <div style="display: flex;justify-content: center;"> - <el-button v-hasPermi="['check:score:publish']" size="small" type="text" @click="handlePublish(scope.row)" v-if="scope.row.publish === 'UNPUBLISHED'" >纭鍙戝竷</el-button> - <el-button v-hasPermi="['check:score:publish']" size="small" type="text" @click="handlePublish(scope.row)" v-if="scope.row.publish === 'PUBLISHED'">鍙栨秷鍙戝竷</el-button> - <el-button - size="mini" - type="text" - icon="el-icon-view" - @click="handleDetail(scope.row.id)" - >璇︾粏</el-button> + <el-button v-hasPermi="['check:score:publish']" size="small" type="text" @click="handlePublish(scope.row)" + v-if="scope.row.publish === 'UNPUBLISHED'">纭鍙戝竷 + </el-button> + <el-button v-hasPermi="['check:score:publish']" size="small" type="text" @click="handlePublish(scope.row)" + v-if="scope.row.publish === 'PUBLISHED'">鍙栨秷鍙戝竷 + </el-button> + <el-button + size="mini" + type="text" + icon="el-icon-view" + @click="handleDetail(scope.row)" + >璇︾粏 + </el-button> </div> </template> </el-table-column> </el-table> - <pagination - v-show="total>0" - :total="total" - :page.sync="queryParamsList.pageNum" - :limit.sync="queryParamsList.pageSize" - @pagination="getList" - /> + <pagination + v-show="total>0" + :total="total" + :auto-scroll="false" + :page.sync="queryParamsList.pageNum" + :limit.sync="queryParamsList.pageSize" + @pagination="getList" + /> </div> @@ -84,14 +95,23 @@ </template> <script> -import { listScore, getScore, delScore, addScore, updateScore, publishScore, detailScore } from "@/api/platform/check-score"; -import { areaSelect } from '@/api/system/dept'; +import { + chartScore, + getScore, + delScore, + addScore, + updateScore, + publishScore, + detailScore +} 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_category','platform_is_publish'], + dicts: ['platform_examine_category', 'platform_is_publish'], data() { return { activeIndex: '0', @@ -114,7 +134,7 @@ pageNum: 1, pageSize: 10, deptId: null, - examineTag:0 + examineTag: 0 }, tableData: [], tableLoading: false, @@ -135,24 +155,33 @@ const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1); this.date = year + '-' + month; this.queryParams.date = this.date; - this.queryParams.examineTag =this.$route.query.examineTag; - this.queryParamsList.examineTag =this.$route.query.examineTag; - this.activeIndex = this.$route.query.examineTag; + let examineTag = this.$route.query.examineTag; + // if (examineTag === '2' || examineTag === '3') { + // examineTag = '1' + // } + // if (examineTag === '4' || examineTag === '5') { + // examineTag = '2' + // } + this.queryParams.examineTag = examineTag; + this.queryParamsList.examineTag = examineTag; + this.activeIndex = examineTag; this.areaSelect(); this.getList(this.$route.query.index); }, - computed: { - - }, + computed: {}, methods: { //鍙戝竷 handlePublish(row) { const getExamineCategoryText = category => { switch (category) { - case 1: return '瑙嗛鑰冩牳'; - case 2: return '杞﹁締鑰冩牳'; - case 3: return '浜鸿劯鑰冩牳'; - default: return '鏈煡'; + case 1: + return '瑙嗛鑰冩牳'; + case 2: + return '杞﹁締鑰冩牳'; + case 3: + return '浜鸿劯鑰冩牳'; + default: + return '鏈煡'; } }; @@ -198,7 +227,7 @@ getChart(deptId) { this.loading = true; lineChart.showLoading(); - listScore(this.queryParams).then(response => { + chartScore(this.queryParams).then(response => { this.initChart(response.data[deptId]); this.loading = false; }); @@ -218,12 +247,13 @@ handleCurrentChange(val) { console.log(`褰撳墠椤�: ${val}`); }, - handleDetail(id) { + handleDetail(row) { this.$router.push({ path: '/check/detail/detail', query: { - id: id, + id: row.id, examineTag: this.activeIndex, + examineCategory: row.examineCategory, deptId: this.queryParamsList.deptId } }) @@ -290,7 +320,7 @@ if (!data) return this.getAllDay().map((item) => [item, []]); const tempGroup = {}; data.forEach((item) => { - let { createTime } = item; + let {createTime} = item; let tempTime = createTime.split('-'); createTime = tempTime[1] + '-' + tempTime[2]; if (!tempGroup[createTime]) { @@ -314,11 +344,14 @@ }, getAllDay() { - // const date = new Date(); - // const year = date.getFullYear(); - // const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1); - // this.date = year + '-' + month; - const currentDate = this.date.split('-'); + let date = this.date + if(!this.date) { + date = new Date(); + const year = date.getFullYear(); + const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1); + date = year + '-' + month; + } + const currentDate = date.split('-'); const currentYear = currentDate[0]; const currentMonth = currentDate[1]; const daysInMonth = new Date(currentYear, currentMonth, 0).getDate(); @@ -348,7 +381,6 @@ dateChange() { this.queryParams.date = this.date; - console.log(this.queryParams); this.getChart(this.queryParams.deptId); } @@ -364,10 +396,6 @@ observer.unobserve(this.$refs.chartContent); } }, - handleSelect(key, keyPath) { - console.log(key, keyPath); - }, - } </script> -- Gitblit v1.8.0