From 6817c96db53ac16f5d5eca72b73230d898f32126 Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期四, 11 四月 2024 09:43:32 +0800
Subject: [PATCH] Merge branch 'master' into dev-threejs

---
 src/views/system/calculate/report/index.vue |  187 ++++++++++++++++++++++++----------------------
 1 files changed, 96 insertions(+), 91 deletions(-)

diff --git a/src/views/system/calculate/report/index.vue b/src/views/system/calculate/report/index.vue
index ba3f141..6dea7bd 100644
--- a/src/views/system/calculate/report/index.vue
+++ b/src/views/system/calculate/report/index.vue
@@ -63,48 +63,19 @@
 
     <el-card class="box-card" v-for="(item) in checkResultList">
       <div slot="header" class="clearfix">
-        <span>{{ item.checkUnitName }}</span>
-        <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">璇︽儏</el-button>
+        <span>{{ checkUnitName }}</span>
+        <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">鏍哥畻</el-button>
       </div>
-      <div class="text item">鍚堝悓<span class="time">{{ item.checkUnitName }}</span></div>
-      <div class="text item">鏍哥畻閲戦<span class="time">{{ "40090" }}</span></div>
-      <div class="text item">鑰冩牳鍒嗘暟<span class="time">{{ item.checkScore }}</span></div>
-      <div class="text item">鏍哥畻鏃堕棿
+      <div class="text item">鍚堝悓<span class="time">{{ checkUnitName }}</span></div>
+      <div class="text item">鎬婚噾棰�<span class="time">{{ "1000鍏�" }}</span></div>
+      <div class="text item">鎵e噺閲戦<span class="time">{{ "10鍏�" }}</span></div>
+      <div class="text item">鍓╀綑閲戦<span class="time">{{ "990鍏�" }}</span></div>
+      <div class="text item">鏈�鏂版牳绠楁椂闂�
         <span class="time">{{ item.checkTime }}</span>
       </div>
+      <el-button size="small" round style="float: right;margin-bottom: 18px;" @click="handlePublish(item)" v-show="item.publish != 1"  v-hasPermi="['result:contract:publish']">纭鍙戝竷</el-button>
+      <el-button size="small" round style="float: right;margin-bottom: 18px;" @click="handlePublish(item)" v-show="item.publish == 1"  v-hasPermi="['result:contract:publish']">宸插彂甯�</el-button>
     </el-card>
-
-    <!-- <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="鑰冩牳鑼冨洿":formatter="examineRangeFormatter" align="center" prop="examineRange" />
-      <el-table-column label="鑰冩牳棰戠巼" :formatter="frequencyFormatter" align="center" prop="frequency" />
-      <el-table-column label="鑰冩牳鍒嗘暟" falign="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)"
-          >璇︽儏</el-button>
-         <el-button
-           type="text"
-           size="mini"
-           icon="el-icon-edit"
-           @click="handleSetManualScore(scope.row)"
-         >浜哄伐鎵撳垎</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-          >鍒犻櫎</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
 
     <pagination
       v-show="total>0"
@@ -112,17 +83,9 @@
       :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="璇蜂负璇ュ崟浣嶆墦鍒�"/>
-      <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-dialog :title="detailTitle" :visible.sync="detailOpen" width="760px" append-to-body>
       <el-descriptions class="margin-top" :column="3" border>
 <!--        <template slot="extra">-->
 <!--          <el-button type="primary" size="small">鎿嶄綔</el-button>-->
@@ -132,39 +95,60 @@
             <i class="el-icon-user"></i>
             鏍哥畻瀵硅薄
           </template>
-          {{detail.checkUnitName}}
+          {{checkUnitName}}
         </el-descriptions-item>
         <el-descriptions-item>
           <template slot="label">
             <i class="el-icon-s-management"></i>
             鍚堝悓鍚嶇О
           </template>
-          {{detail.checkUnitName}}
+          {{checkUnitName}}
         </el-descriptions-item>
       </el-descriptions>
         <el-table
           :data="tableData"
           show-summary
-          style="width: 100%">
+          :summary-method="getSummaries"
+          style="width: 100%;text-align:center">
           <el-table-column
-            prop="name"
-            label="瑙勫垯鍚�"
+            prop="time"
+            label="鏍哥畻鏃ユ湡"
             width="180">
           </el-table-column>
           <el-table-column
-            prop="amount"
-            label="鏁伴噺"
-            width="180">
+            prop="score"
+            label="鑰冩牳鍒嗘暟"
+            width="180"
+            doNotSum>
           </el-table-column>
-          <el-table-column
+          <el-table-column  
+            prop="score"  
+            label="鎵e垎绯绘暟"  
+            width="180">  
+            <template slot-scope="scope">  
+              <el-tooltip class="item" effect="dark" :content="'鑰冩牳瑙勫垯锛�' + scope.row.description" placement="top">  
+                <span>{{ scope.row.value }}</span>  
+              </el-tooltip>  
+            </template>  
+          </el-table-column>  
+          <el-table-column  
+            label="鎵e噺閲戦(鍏�)" 
             prop="money"
-            label="閲戦(鍏�)">
-          </el-table-column>
-          <el-table-column
-            prop="total"
-            label="鍚堣(鍏�)">
-          </el-table-column>
+            width="180">  
+            <template slot-scope="scope">  
+              <el-input type="number"
+                :precision="2" :step="0.1"
+                :min="0" :max="1000000"
+                v-model="scope.row.money"
+                placeholder="璇疯緭鍏ユ墸鍑忛噾棰�">  
+              </el-input>  
+            </template>  
+          </el-table-column> 
         </el-table>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+          <el-button @click="cancel">鍙� 娑�</el-button>
+        </div>
     </el-dialog>
 
     <!-- 娣诲姞鎴栦慨鏀硅�冩牳缁撴灉瀵硅瘽妗� -->
@@ -191,27 +175,20 @@
       detail:{
 
       },
+      checkUnitName:'鎴愰兘x杩愮淮',
       tableData: [{
-        name: '瀛樺偍鏁呴殰',
-        amount: '100',
-        money: '100',
-        total: '10000'
+        time: '2024-03-03',
+        score: '94',
+        value: '0.01',
+        money: '',
+        description: '姣忓皯1鍒嗘墸褰撴湀鎬绘湇鍔¤垂鐨�1%銆備緥濡傦細褰撴湀鑰冩牳寰楀垎91.5鍒嗭紝鎵i櫎褰撴湀鏈嶅姟璐�3.5%鐨勯噾棰�',
       }, {
-        name: '鏃堕挓涓嶅悓姝�24灏忔椂鏈慨澶�',
-        amount: '100',
-        money: '100.45',
-        total: '10045'
-      }, {
-        name: '涓�鏈轰竴妗�24灏忔椂鏈慨澶�',
-        amount: '100',
-        money: '100',
-        total: '10000'
-      }, {
-        name: '瑙嗛杩愯鐜�(96%)',
-        amount: '100',
-        money: '100.45',
-        total: '10045'
-      }],
+        time: '2024-04-03',
+        score: '95',
+        value: '0',
+        money: '',
+        description: '姣忓皯1鍒嗘墸褰撴湀鎬绘湇鍔¤垂鐨�1%銆備緥濡傦細褰撴湀鑰冩牳寰楀垎91.5鍒嗭紝鎵i櫎褰撴湀鏈嶅姟璐�3.5%鐨勯噾棰�',
+      }, ],
       manualScoreOpen: false,
       manualScoreForm: {},
       manualScoreTitle: '',
@@ -277,14 +254,14 @@
         this.queryParams["end"] = this.daterangeCheckTime[1];
       }
       listCheckResult(this.queryParams).then(response => {
-        this.checkResultList = response.data;
+        this.checkResultList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
     },
     // 鍙栨秷鎸夐挳
     cancel() {
-      this.open = false;
+      this.detailOpen = false;
       this.reset();
     },
     // 琛ㄥ崟閲嶇疆
@@ -319,16 +296,11 @@
         this.getList();
       })
     },
-    handleSetManualScore(row) {
-      this.manualScoreForm.id = row.id;
-      this.manualScoreForm.manualScore = parseInt(row.manualScore);
-      this.manualScoreTitle = row.checkUnitName + '浜哄伐鎵撳垎'
-      this.manualScoreOpen = true;
-    },
     handleDetail(row) {
+      console.log("row", row)
       this.detail = row;
       this.detail.carOnlineRate =  '97%';
-      this.detailTitle = row.checkUnitName + '鑰冩牳缁撴灉';
+      this.detailTitle = this.checkUnitName + '鑰冩牳缁撴灉';
       this.detailOpen = true;
 
     },
@@ -378,6 +350,7 @@
     },
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
+      this.detailOpen = false;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -411,6 +384,38 @@
       this.download('system/checkResult/export', {
         ...this.queryParams
       }, `checkResult_${new Date().getTime()}.xlsx`)
+    },
+    getSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '鍚堣';
+          return;
+        }
+        const values = data.map(item => Number(item[column.property]));
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index] += ' 鍏�';
+          if (column.property === 'score') {
+            sums[index] = '-'; // 鎴栬�呭叾浠栦綘鎯宠鏄剧ず鐨勫唴瀹�
+          }
+          if (column.property === 'value') {
+            sums[index] = '-'; // 鎴栬�呭叾浠栦綘鎯宠鏄剧ず鐨勫唴瀹�
+          }
+        } else {
+          sums[index] = 'N/A';
+        }
+      });
+
+      return sums;
     }
   }
 };

--
Gitblit v1.8.0