From 4bac5bd8d10d087a6d2ce13a854817d1a36321f7 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 07 三月 2024 14:24:05 +0800
Subject: [PATCH] 考核结果
---
src/api/platform/check-result.js | 53 ++++++
src/views/system/check-result/index.vue | 392 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 445 insertions(+), 0 deletions(-)
diff --git a/src/api/platform/check-result.js b/src/api/platform/check-result.js
new file mode 100644
index 0000000..8f25d9a
--- /dev/null
+++ b/src/api/platform/check-result.js
@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 鏌ヨ鑰冩牳缁撴灉鍒楄〃
+export function listCheckResult(query) {
+ return request({
+ url: '/check-result/page',
+ method: 'post',
+ data: query
+ })
+}
+
+// 鏌ヨ鑰冩牳缁撴灉璇︾粏
+export function getCheckResult(id) {
+ return request({
+ url: '/check-result/' + id,
+ method: 'get'
+ })
+}
+
+// 鏂板鑰冩牳缁撴灉
+export function addCheckResult(data) {
+ return request({
+ url: '/check-result',
+ method: 'post',
+ data: data
+ })
+}
+
+// 淇敼鑰冩牳缁撴灉
+export function updateCheckResult(data) {
+ return request({
+ url: '/check-result',
+ method: 'put',
+ data: data
+ })
+}
+
+// 鍒犻櫎鑰冩牳缁撴灉
+export function delCheckResult(id) {
+ return request({
+ url: '/check-result/' + id,
+ method: 'delete'
+ })
+}
+
+// 鎻愪氦浜哄伐鍒嗘暟
+export function manualScore(data) {
+ return request({
+ url: '/check-result/manual-score',
+ method: 'post',
+ data: data
+ })
+}
diff --git a/src/views/system/check-result/index.vue b/src/views/system/check-result/index.vue
new file mode 100644
index 0000000..80dee17
--- /dev/null
+++ b/src/views/system/check-result/index.vue
@@ -0,0 +1,392 @@
+<template>
+ <div class="app-container">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
+ <el-form-item label="鑰冩牳瀵硅薄" prop="checkUnitId">
+ <el-input
+ v-model="queryParams.checkUnitName"
+ placeholder="璇疯緭鍏ヨ�冩牳瀵硅薄"
+ clearable
+ @clear="handleQuery"
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ <el-form-item label="鑰冩牳棰戠巼" prop="frequency">
+ <el-select v-model="queryParams.frequency" clearable @clear="handleQuery" placeholder="鑰冩牳棰戠巼">
+ <el-option
+ label="鏈堝害鑰冩牳"
+ value="1">
+ </el-option>
+ <el-option
+ label="瀛e害鑰冩牳"
+ value="2">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鑰冩牳鑼冨洿" prop="examineRange">
+ <el-select v-model="queryParams.examineRange" clearable @clear="handleQuery" placeholder="鑰冩牳鑼冨洿">
+ <el-option
+ label="甯傚眬鑰冩牳"
+ value="2">
+ </el-option>
+ <el-option
+ label="鍒嗗眬鑰冩牳"
+ value="1">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鑰冩牳鏃堕棿">
+ <el-date-picker
+ v-model="daterangeCheckTime"
+ style="width: 240px"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ type="daterange"
+ range-separator="-"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ ></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 icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+ </el-form-item>
+ </el-form>
+
+ <el-row :gutter="10" class="mb8">
+<!-- <el-col :span="1.5">-->
+<!-- <el-button-->
+<!-- type="primary"-->
+<!-- plain-->
+<!-- icon="el-icon-plus"-->
+<!-- size="mini"-->
+<!-- @click="handleAdd"-->
+<!-- v-hasPermi="['system:checkResult:add']"-->
+<!-- >鏂板</el-button>-->
+<!-- </el-col>-->
+ <el-col :span="1.5">
+ <el-button
+ type="danger"
+ plain
+ icon="el-icon-delete"
+ size="mini"
+ :disabled="multiple"
+ @click="handleDelete"
+ v-hasPermi="['system:checkResult:remove']"
+ >鍒犻櫎</el-button>
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ 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-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="鑰冩牳鏃堕棿" align="center" prop="checkTime" />
+ <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-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
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ @click="handleDelete(scope.row)"
+ v-hasPermi="['system:checkResult:remove']"
+ >鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <pagination
+ v-show="total>0"
+ :total="total"
+ :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>
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitManualScore">纭� 瀹�</el-button>
+ <el-button @click="cancelManualScore">鍙� 娑�</el-button>
+ </div>
+ </el-dialog>
+
+ <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="700px" append-to-body>
+ <el-descriptions class="margin-top" :column="3" border>
+<!-- <template slot="extra">-->
+<!-- <el-button type="primary" size="small">鎿嶄綔</el-button>-->
+<!-- </template>-->
+ <el-descriptions-item>
+ <template slot="label">
+ <i class="el-icon-user"></i>
+ 鑰冩牳瀵硅薄
+ </template>
+ {{detail.checkUnitName}}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ <i class="el-icon-s-management"></i>
+ 鑰冩牳鍚嶇О
+ </template>
+ {{detail.examineName}}
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ <i class="el-icon-full-screen"></i>
+ 鑰冩牳鑼冨洿
+ </template>
+ <el-tag size="small">{{detail.examineRange === 1 ? '鍒嗗眬鑰冩牳' : '甯傚眬鑰冩牳'}}</el-tag>
+ </el-descriptions-item>
+ <el-descriptions-item>
+ <template slot="label">
+ <i class="el-icon-timer"></i>
+ 鑰冩牳棰戠巼
+ </template>
+ <el-tag size="small">{{detail.frequency === 1 ? '鏈堝害鑰冩牳' : '瀛e害鑰冩牳'}}</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.checkScore}}</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.manualScore}}</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>
+ </el-descriptions>
+ </el-dialog>
+
+ <!-- 娣诲姞鎴栦慨鏀硅�冩牳缁撴灉瀵硅瘽妗� -->
+ <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+ <el-button @click="cancel">鍙� 娑�</el-button>
+ </div>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import { listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore } from "@/api/platform/check-result";
+
+export default {
+ name: "CheckResult",
+ data() {
+ return {
+ detailTitle: '',
+ detailOpen: false,
+ detail: {},
+ manualScoreOpen: false,
+ manualScoreForm: {},
+ manualScoreTitle: '',
+ // 閬僵灞�
+ loading: true,
+ // 閫変腑鏁扮粍
+ ids: [],
+ // 闈炲崟涓鐢�
+ single: true,
+ // 闈炲涓鐢�
+ multiple: true,
+ // 鏄剧ず鎼滅储鏉′欢
+ showSearch: true,
+ // 鎬绘潯鏁�
+ total: 0,
+ // 鑰冩牳缁撴灉琛ㄦ牸鏁版嵁
+ checkResultList: [],
+ // 寮瑰嚭灞傛爣棰�
+ title: "",
+ // 鏄惁鏄剧ず寮瑰嚭灞�
+ open: false,
+ // 閫昏緫鍒犻櫎鏃堕棿鑼冨洿
+ daterangeCheckTime: [],
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ pageNum: 1,
+ pageSize: 10,
+ checkUnitId: null,
+ checkTime: null,
+ },
+ // 琛ㄥ崟鍙傛暟
+ form: {},
+ // 琛ㄥ崟鏍¢獙
+ rules: {
+ }
+ };
+ },
+ created() {
+ this.getList();
+ },
+ methods: {
+ /** 鏌ヨ鑰冩牳缁撴灉鍒楄〃 */
+ getList() {
+ this.loading = true;
+ if (null != this.daterangeCheckTime && '' != this.daterangeCheckTime) {
+ this.queryParams["start"] = this.daterangeCheckTime[0];
+ this.queryParams["end"] = this.daterangeCheckTime[1];
+ }
+ listCheckResult(this.queryParams).then(response => {
+ this.checkResultList = response.data;
+ this.total = response.total;
+ this.loading = false;
+ });
+ },
+ // 鍙栨秷鎸夐挳
+ cancel() {
+ this.open = false;
+ this.reset();
+ },
+ // 琛ㄥ崟閲嶇疆
+ reset() {
+ this.form = {
+ id: null,
+ checkUnitId: null,
+ checkPublishId: null,
+ checkScore: null,
+ systemScore: null,
+ manualScore: null,
+ checkTime: null,
+ createTime: null,
+ updateTime: null,
+ deleted: null
+ };
+ this.resetForm("form");
+ },
+ cancelManualScore() {
+ this.manualScoreForm = {};
+ this.manualScoreTitle = "";
+ this.manualScoreOpen = false;
+ },
+ submitManualScore() {
+ if (! this.manualScoreForm.manualScore) {
+ this.$modal.msgWarning("璇峰~鍐欏垎鏁�");
+ return
+ }
+ manualScore(this.manualScoreForm).then(res => {
+ this.$modal.msgSuccess("鎿嶄綔鎴愬姛");
+ this.cancelManualScore();
+ })
+ },
+ handleSetManualScore(row) {
+ this.manualScoreForm.id = row.id;
+ this.manualScoreForm.manualScore = row.manualScore;
+ this.manualScoreTitle = row.checkUnitName + '浜哄伐鎵撳垎'
+ this.manualScoreOpen = true;
+ },
+ handleDetail(row) {
+ this.detail = row;
+ this.detailTitle = row.checkUnitName + '鑰冩牳缁撴灉';
+ this.detailOpen = true;
+
+ },
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ handleQuery() {
+ this.queryParams.pageNum = 1;
+ this.getList();
+ },
+ /** 閲嶇疆鎸夐挳鎿嶄綔 */
+ resetQuery() {
+ this.daterangeCheckTime = [];
+ this.resetForm("queryForm");
+ this.handleQuery();
+ },
+ // 澶氶�夋閫変腑鏁版嵁
+ handleSelectionChange(selection) {
+ this.ids = selection.map(item => item.id)
+ this.single = selection.length!==1
+ this.multiple = !selection.length
+ },
+ /** 鏂板鎸夐挳鎿嶄綔 */
+ handleAdd() {
+ this.reset();
+ this.open = true;
+ this.title = "娣诲姞鑰冩牳缁撴灉";
+ },
+ /** 淇敼鎸夐挳鎿嶄綔 */
+ handleUpdate(row) {
+ this.reset();
+ const id = row.id || this.ids
+ getCheckResult(id).then(response => {
+ this.form = response.data;
+ this.open = true;
+ this.title = "淇敼鑰冩牳缁撴灉";
+ });
+ },
+ /** 鎻愪氦鎸夐挳 */
+ submitForm() {
+ this.$refs["form"].validate(valid => {
+ if (valid) {
+ if (this.form.id != null) {
+ updateCheckResult(this.form).then(response => {
+ this.$modal.msgSuccess("淇敼鎴愬姛");
+ this.open = false;
+ this.getList();
+ });
+ } else {
+ addCheckResult(this.form).then(response => {
+ this.$modal.msgSuccess("鏂板鎴愬姛");
+ this.open = false;
+ this.getList();
+ });
+ }
+ }
+ });
+ },
+ /** 鍒犻櫎鎸夐挳鎿嶄綔 */
+ handleDelete(row) {
+ const ids = row.id || this.ids;
+ this.$modal.confirm('鏄惁纭鍒犻櫎鑰冩牳缁撴灉缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() {
+ return delCheckResult(ids);
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ }).catch(() => {});
+ },
+ /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+ handleExport() {
+ this.download('system/checkResult/export', {
+ ...this.queryParams
+ }, `checkResult_${new Date().getTime()}.xlsx`)
+ }
+ }
+};
+</script>
--
Gitblit v1.8.0