From 1abb6a9ca01cc76f271542a063d1b19839448019 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 27 九月 2024 17:42:05 +0800 Subject: [PATCH] 1.新增评估结果批量导入功能(未完成) --- src/views/fysp/evaluation/EvalutationRecord.vue | 87 ++++++++++++++++++++++++++++++------------- 1 files changed, 61 insertions(+), 26 deletions(-) diff --git a/src/views/fysp/evaluation/EvalutationRecord.vue b/src/views/fysp/evaluation/EvalutationRecord.vue index b3dc2c3..0d61791 100644 --- a/src/views/fysp/evaluation/EvalutationRecord.vue +++ b/src/views/fysp/evaluation/EvalutationRecord.vue @@ -1,7 +1,12 @@ <template> - <!-- <CompPreCheck @pre-check="autoEvaluate"></CompPreCheck> --> - - <FYTable @search="onSearch" :pagination="false" ref="tableRef"> + <FYTable + @search="onSearch" + :pagination="false" + ref="tableRef" + @cell-click="cellClick" + :cell-class-name="cellClassName" + @table-paste="handlePaste" + > <template #options> <!-- 鍖哄幙 --> <FYOptionLocation @@ -19,6 +24,16 @@ <!-- 鏃堕棿 --> <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime> </template> + <template #buttons> + <!-- <el-button icon="Download" size="default" type="success" @click="download" + >瑙勮寖鎬ц瘎浼颁笌鍒嗘瀽鎶ュ憡</el-button + > --> + <CompReport + :locations="formSearch.locations" + :scenetype="formSearch.scenetype" + :time="formSearch.time" + ></CompReport> + </template> <template #options-expand> <el-form :inline="true"> @@ -27,17 +42,9 @@ </template> <template #table-column> - <el-table-column type="index" fixed="left" prop="sceneName" label="鍚嶇О" width="300"> - <template #default="{ row }"> - <el-tooltip - effect="dark" - :content="row.sceneName" - placement="top-start" - :show-after="500" - > - {{ row.sceneName }} - </el-tooltip> - </template> + <el-table-column fixed="left" sortable prop="sceneIndex" label="缂栧彿" width="80"> + </el-table-column> + <el-table-column prop="sceneName" :show-overflow-tooltip="true" label="鍚嶇О" width="300"> </el-table-column> <el-table-column prop="subTaskTime" @@ -70,12 +77,22 @@ <el-table-column prop="evaluation.scenseaddress" label="鍦板潃" /> <!-- <el-table-column prop="biArea" label="闆嗕腑鍖�" width="110" /> <el-table-column prop="biManagementCompany" label="鐗╀笟" min-width="110"/> --> - <el-table-column fixed="right" align="right" label="鎿嶄綔" width="160"> - <template #header> - <el-button icon="Download" size="default" type="success" @click="download" - >涓嬭浇缁撴灉</el-button - > + <el-table-column fixed="right" align="right" label="鐩戞祴鏁版嵁瓒呮爣" width="160"> + <template #default="{ row }"> + <el-input v-model="row.score1" /> </template> + </el-table-column> + <el-table-column fixed="right" align="right" label="鐩戞祴鏁版嵁瓒呭尯鏈堝潎鍊�" width="160"> + <template #default="{ row }"> + <el-input v-model="row.score2" /> + </template> + </el-table-column> + <el-table-column fixed="right" align="right" label="鎿嶄綔" width="160"> + <!-- <template #header> + <el-button icon="Download" size="default" type="success" @click="exportExcel" + >瀵煎嚭缁撴灉</el-button + > + </template> --> <template #default="{ row }"> <el-button type="primary" size="small" @click="editRow(row)">鏌ョ湅</el-button> </template> @@ -88,11 +105,19 @@ import dayjs from 'dayjs'; import evaluateApi from '@/api/fysp/evaluateApi'; import { envCreditCode } from '@/constants/index'; -import CompQuickSet from './components/CompQuickSet.vue'; +import CompReport from './components/CompReport.vue'; +import { useTablePaste } from '@/composables/tablePaste'; export default { - name: 'ResultManage', - components: { CompQuickSet }, + setup() { + const { cellClick, cellClassName, handlePaste, setTableData, addRefreshEvent, tableData } = + useTablePaste({ + score1: 8, + score2: 9 + }); + return { cellClick, cellClassName, handlePaste, setTableData, addRefreshEvent, tableData }; + }, + components: { CompReport }, data() { return { formSearch: { @@ -117,6 +142,9 @@ scensetypeid: scenetype.value }; }, + editRow(row) { + this.$router.push(`evalutationEdit/${row.subTaskId}`); + }, setOptions(param) { this.formSearch.locations = param.locations; this.formSearch.scenetype = param.scenetype; @@ -126,14 +154,16 @@ onSearch(page, func) { const area = this._getParam(); evaluateApi.fetchAutoEvaluation(area).then((res) => { - if (typeof func === 'function') { - func({ data: res.data }); - } if (res.data) { + this.tableData = res.data; this.getFilters(res.data); + if (typeof func === 'function') { + func({ data: this.tableData }); + } } }); }, + // 瑙勮寖鎬ц瘎浼颁笌鍒嗘瀽鎶ュ憡鍚庡彴鐢熸垚浠诲姟 download() { const area = this._getParam(); evaluateApi.downloadAutoEvaluation(area).then((res) => { @@ -143,6 +173,8 @@ } }); }, + // 瀵煎嚭琛ㄦ牸涓篹xcel鏍煎紡 + exportExcel() {}, getFilters(data) { const townList = []; data.forEach((e) => { @@ -177,7 +209,10 @@ const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0; const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0; return s1 - s2; - } + }, + }, + mounted() { + this.addRefreshEvent(this.$refs.tableRef.doLayout); } }; </script> -- Gitblit v1.9.3