From c46e3ad03a8c5fb27b0361d219babca0e537ad77 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 30 四月 2024 13:44:39 +0800
Subject: [PATCH] 考核结果三级页面

---
 src/views/system/result/detail/detail.vue |  209 ++++++++++++++++++----------------------------------
 1 files changed, 73 insertions(+), 136 deletions(-)

diff --git a/src/views/system/result/detail/detail.vue b/src/views/system/result/detail/detail.vue
index a6ff943..05adf88 100644
--- a/src/views/system/result/detail/detail.vue
+++ b/src/views/system/result/detail/detail.vue
@@ -1,15 +1,15 @@
 <template>
   <div class="app-container">
-    <el-page-header @back="goBack" content="璇︽儏椤甸潰">
+    <el-page-header @back="goBack()" content="璇︽儏椤甸潰">
     </el-page-header>
 
     <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 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
@@ -17,38 +17,43 @@
                 type="text"
                 icon="el-icon-edit"
                 @click="handleRuleUpdate(scope.row)"
-              >淇敼</el-button>
+              >淇敼
+              </el-button>
             </template>
           </el-table-column>
         </el-table>
 
-        <pagination
-          v-show="total>0"
-          :total="total"
-          :page.sync="queryParams.pageNum"
-          :limit.sync="queryParams.pageSize"
-          @pagination="getRuleList"
-        />
       </el-main>
     </el-container>
 
     <el-container>
       <el-main>
         <h2>鑰冩牳鎴愮哗</h2>
-        <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
+        <el-row :gutter="10" class="mb5">
+          <el-col :span="1.5" style="margin-right: 20px">
             <el-button
               type="warning"
               plain
               icon="el-icon-download"
               size="mini"
               @click="handleExport"
-            >瀵煎嚭</el-button>
+            >瀵煎嚭
+            </el-button>
           </el-col>
-          <right-toolbar :showSearch.sync="showSearch" @queryTable="getRuleList"></right-toolbar>
+          <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-date-picker>
+            </el-form-item>
+            <el-form-item>
+              <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 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>
@@ -64,23 +69,23 @@
               :key="item.ruleName"
               :label="item.ruleName"
               align="center"
-              width = "120px"
+              width="180px"
             >
               <template slot-scope="scope">
                 <span>{{ scope.row[item.ruleIndex] }}</span>
               </template>
             </el-table-column>
           </template>
-          <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"  fixed="right">
-            <template slot-scope="scope">
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-edit"
-                @click="handleIndexUpdate(scope.row,scope.index)"
-              >淇敼</el-button>
-            </template>
-          </el-table-column>
+          <!--          <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"  fixed="right">-->
+          <!--            <template slot-scope="scope">-->
+          <!--              <el-button-->
+          <!--                size="mini"-->
+          <!--                type="text"-->
+          <!--                icon="el-icon-edit"-->
+          <!--                @click="handleIndexUpdate(scope.row,scope.index)"-->
+          <!--              >淇敼</el-button>-->
+          <!--            </template>-->
+          <!--          </el-table-column>-->
         </el-table>
       </el-main>
     </el-container>
@@ -92,7 +97,7 @@
           <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" 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">
@@ -105,16 +110,12 @@
     <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="ruleForm.create_time" placeholder="璇疯緭鍏ヨ鍒欏悕绉�" disabled>
-
+          <el-input v-model="formattedCreateTime" placeholder="" disabled>
           </el-input>
         </el-form-item>
-<!--        <el-form-item label="鑰冩牳瀵硅薄" prop="checkRuleName">-->
-<!--          <el-input v-model="ruleForm.checkRuleName" placeholder="璇疯緭鍏ヨ鍒欏悕绉�" disabled/>-->
-<!--        </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" 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>
@@ -127,9 +128,10 @@
 </template>
 
 <script>
-import { listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore, publishCheckResult } from "@/api/platform/check-result";
-import { listScore, getScoreIndex, delScore, addScore, updateScore } from "@/api/platform/check-score";
-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",
@@ -137,9 +139,11 @@
   data() {
     return {
       id: null,
+      examineCategory: null,
+      date: '',
       examineTag: null,
       deptId: null,
-      areaList:[],
+      areaList: [],
       tableData: [],
       dataMap: [],
       manualScoreOpen: false,
@@ -173,15 +177,22 @@
       //璇锋眰鍙傛暟
       queryParams: {
         id: null,
+        date: null,
       },
       // 琛ㄥ崟鏍¢獙
       rules: {}
     };
   },
+  computed: {
+    formattedCreateTime() {
+      // 濡傛灉 create_time 瀛樺湪锛屽垯杩斿洖鏃ユ湡閮ㄥ垎锛屽惁鍒欒繑鍥炵┖瀛楃涓�
+      return this.indexForm.create_time ? this.indexForm.create_time.split('T')[0] : '';
+    },
+  },
   created() {
     //鑰冩牳鎴愮哗璇︽儏璺宠浆鍙傛暟鎺ユ敹
-    if(this.$route.query.id){
-      this.id = this.$route.query.id
+    if (this.$route.query.id) {
+      this.queryParams.id = this.$route.query.id
     }
     // 鑰冩牳绉垎鍒楄〃
     this.getList();
@@ -191,7 +202,7 @@
     /** 鏌ヨ鑰冩牳璁″垎鍒楄〃 */
     getList() {
       this.loading = true;
-      getScoreIndex(this.id).then(response => {
+      getScoreIndex(this.queryParams).then(response => {
         this.checkRuleList = response.data.checkRuleList;
         this.dataMap = response.data.scoreMap.dataMap;
         this.tableData = response.data.scoreMap.tableData
@@ -211,8 +222,7 @@
         checkRuleName: null,
         weight: null,
       };
-      this.indexForm = {
-      };
+      this.indexForm = {};
       this.resetForm(formName);
     },
     translateDeptId(deptId) {
@@ -225,29 +235,23 @@
         this.areaList = res.data;
       })
     },
-    cancelManualScore() {
-      this.manualScoreForm = {};
-      this.manualScoreTitle = "";
-      this.manualScoreOpen = false;
+    /** 杩斿洖鎸夐挳 */
+    goBack() {
+      const obj = { path: "/examine/detail", query: { index: this.$route.query.deptId, examineTag: this.$route.query.examineTag, pageNum: this.$route.query.pageNum } };
+      this.$tab.closeOpenPage(obj);
     },
-    submitManualScore() {
-      if (! this.manualScoreForm.manualScore) {
-        this.$modal.msgWarning("璇峰~鍐欏垎鏁�");
-        return
+    // 鍏抽棴褰撳墠tab椤电锛屾墦寮�鏂伴〉绛�
+    closeOpenPage(obj) {
+      store.dispatch("tagsView/delView", router.currentRoute);
+      if (obj !== undefined) {
+        return router.push(obj);
       }
-      manualScore(this.manualScoreForm).then(res => {
-        this.$modal.msgSuccess("鎿嶄綔鎴愬姛");
-        this.cancelManualScore();
-        this.getList();
-      })
     },
-    handleSetManualScore(row) {
-      this.manualScoreForm.id = row.id;
-      this.manualScoreForm.manualScore = parseInt(row.manualScore);
-      this.manualScoreTitle = row.checkUnitName + '浜哄伐鎵撳垎'
-      this.manualScoreOpen = true;
+    dateChange() {
+      this.queryParams.date = this.date;
+      console.log(this.queryParams);
+      this.getList();
     },
-
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
       this.getList();
@@ -261,7 +265,7 @@
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 鏂板鎸夐挳鎿嶄綔 */
@@ -288,37 +292,21 @@
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.id != null) {
-            updateCheckResult(this.form).then(response => {
+          if (this.ruleForm.id != null) {
+            updateWeight(this.ruleForm).then(response => {
               this.$modal.msgSuccess("淇敼鎴愬姛");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addCheckResult(this.form).then(response => {
-              this.$modal.msgSuccess("鏂板鎴愬姛");
-              this.open = false;
+              this.ruleOpen = 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.download('/check/score/export', {
         ...this.queryParams
-      }, `checkResult_${new Date().getTime()}.xlsx`)
+      }, `鑰冩牳鎸囨爣_${new Date().getTime()}.xlsx`)
     },
     handleSelect(key, keyPath) {
       console.log(key, keyPath);
@@ -328,57 +316,6 @@
 </script>
 <style scoped>
 
-.line {
-  display: flex;
-  flex-direction: row;
-  justify-content: flex-start;
-  align-items: center;
-}
-
-.line-right {
-  width: 50px;
-}
-.input{
-  width: 200px;
-}
-
-.input-w {
-  margin-left: 5px;
-  width: 70px;
-}
-.row-warp {
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-  text-align: center;
-  border: solid 1px gray;
-  /*padding: 3px;*/
-}
-.row {
-  display: flex;
-  flex-direction: row;
-  justify-content: center;
-  align-items: center;
-  border-bottom: solid 1px gray;
-  padding: 3px;
-}
-.row:last-of-type {
-  border-bottom: none;
-}
-.row-left {
-  flex: 2;
-  border-right: solid 1px gray;
-}
-.row-right {
-  flex: 4;
-  display: flex;
-  flex-direction: row;
-  justify-content: center;
-}
-.header-container {
-  display: flex;
-  align-items: center; /* 鍨傜洿灞呬腑 */
-}
 
 .header-container h2 {
   margin-right: 10px; /* 鏍规嵁闇�瑕佽皟鏁存爣棰樺拰鑿滃崟涔嬮棿鐨勯棿璺� */

--
Gitblit v1.8.0