From bce10b2db48c97a23543189368ceb6a8f3737fb3 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期三, 03 四月 2024 14:24:46 +0800 Subject: [PATCH] 核算ui+考核结果ui --- src/views/system/calculate/report/index.vue | 141 +++++++++++++++++++--------------------------- 1 files changed, 58 insertions(+), 83 deletions(-) diff --git a/src/views/system/calculate/report/index.vue b/src/views/system/calculate/report/index.vue index ba3f141..6ed15a4 100644 --- a/src/views/system/calculate/report/index.vue +++ b/src/views/system/calculate/report/index.vue @@ -63,48 +63,21 @@ <el-card class="box-card" v-for="(item) in checkResultList"> <div slot="header" class="clearfix"> - <span>{{ item.checkUnitName }}</span> + <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,15 +85,7 @@ :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-descriptions class="margin-top" :column="3" border> @@ -132,37 +97,35 @@ <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 + :summary-method="getSummaries" style="width: 100%"> <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 prop="money" - label="閲戦(鍏�)"> - </el-table-column> - <el-table-column - prop="total" - label="鍚堣(鍏�)"> + label="鎵e噺閲戦(鍏�)"> </el-table-column> </el-table> </el-dialog> @@ -191,27 +154,16 @@ detail:{ }, + checkUnitName:'鎴愰兘x杩愮淮', tableData: [{ - name: '瀛樺偍鏁呴殰', - amount: '100', - money: '100', - total: '10000' + time: '2024-03-03', + score: '94', + money: '10', }, { - 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', + money: '0', + }, ], manualScoreOpen: false, manualScoreForm: {}, manualScoreTitle: '', @@ -277,7 +229,7 @@ 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; }); @@ -318,12 +270,6 @@ this.cancelManualScore(); this.getList(); }) - }, - handleSetManualScore(row) { - this.manualScoreForm.id = row.id; - this.manualScoreForm.manualScore = parseInt(row.manualScore); - this.manualScoreTitle = row.checkUnitName + '浜哄伐鎵撳垎' - this.manualScoreOpen = true; }, handleDetail(row) { this.detail = row; @@ -411,6 +357,35 @@ 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] = '-'; // 鎴栬�呭叾浠栦綘鎯宠鏄剧ず鐨勫唴瀹� + } + } else { + sums[index] = 'N/A'; + } + }); + + return sums; } } }; -- Gitblit v1.8.0