From c18772a3b843e3ca5af5e58d6570860ce1a4aa8f Mon Sep 17 00:00:00 2001
From: Riku <risaku@163.com>
Date: 星期六, 28 九月 2024 22:24:20 +0800
Subject: [PATCH] 1. 修改监测数据得分批量导入功能
---
src/components.d.ts | 8 ++
src/api/fysp/evaluateApi.js | 6 ++
src/views/fysp/evaluation/EvalutationRecord.vue | 155 +++++++++++++++++++++++++++++++++++++++++++--------
3 files changed, 145 insertions(+), 24 deletions(-)
diff --git a/src/api/fysp/evaluateApi.js b/src/api/fysp/evaluateApi.js
index a09247d..4ab4a94 100644
--- a/src/api/fysp/evaluateApi.js
+++ b/src/api/fysp/evaluateApi.js
@@ -65,6 +65,12 @@
},
/**
+ * 鎵归噺淇敼鏈�灏忛」寰楀垎
+ */
+ updateMultipleScore(evaVo) {
+ return $fysp.post(`/itemevaluation/update/multiple`, evaVo).then((res) => res.data);
+ },
+ /**
* 淇敼鏈�灏忛」寰楀垎
*/
updateScore({itemList, subTaskId}) {
diff --git a/src/components.d.ts b/src/components.d.ts
index 59b1004..f6d6d8e 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -18,6 +18,7 @@
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
+ ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCard: typeof import('element-plus/es')['ElCard']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
@@ -30,6 +31,9 @@
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
+ ElDropdown: typeof import('element-plus/es')['ElDropdown']
+ ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
+ ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
@@ -37,11 +41,13 @@
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
+ ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup']
ElOption: typeof import('element-plus/es')['ElOption']
+ ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElPopover: typeof import('element-plus/es')['ElPopover']
@@ -54,12 +60,14 @@
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
+ ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
+ ElUpload: typeof import('element-plus/es')['ElUpload']
Footer: typeof import('./components/core/Footer.vue')['default']
FormCol: typeof import('./components/layout/FormCol.vue')['default']
FYBgTaskCard: typeof import('./components/bg-task/FYBgTaskCard.vue')['default']
diff --git a/src/views/fysp/evaluation/EvalutationRecord.vue b/src/views/fysp/evaluation/EvalutationRecord.vue
index 41338ec..00077c9 100644
--- a/src/views/fysp/evaluation/EvalutationRecord.vue
+++ b/src/views/fysp/evaluation/EvalutationRecord.vue
@@ -42,7 +42,7 @@
</el-form>
</template>
- <template #table-column>
+ <template #table-column="{ size }">
<el-table-column fixed="left" sortable="custom" prop="sceneIndex" label="缂栧彿" width="80">
</el-table-column>
<el-table-column prop="sceneName" :show-overflow-tooltip="true" label="鍚嶇О" width="300">
@@ -72,22 +72,45 @@
<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">
+ <el-table-column
+ v-if="scoreShow"
+ fixed="right"
+ align="right"
+ label="鐩戞祴鏁版嵁瓒呮爣"
+ width="160"
+ >
<template #default="{ row }">
- <el-input v-model="row.score1" />
+ <el-input :size="size" v-model="row.score1" />
</template>
</el-table-column>
- <el-table-column fixed="right" align="right" label="鐩戞祴鏁版嵁瓒呭尯鏈堝潎鍊�" width="160">
+ <el-table-column
+ v-if="scoreShow"
+ fixed="right"
+ align="right"
+ label="鐩戞祴鏁版嵁瓒呭尯鏈堝潎鍊�"
+ width="160"
+ >
<template #default="{ row }">
- <el-input v-model="row.score2" />
+ <el-input :size="size" 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 #header>
+ <el-button
+ v-show="!scoreShow"
+ icon="ArrowLeft"
+ size="small"
+ type="success"
+ @click="scoreShow = true"
+ >鐩戞祴鏁版嵁寰楀垎</el-button
>
- </template> -->
+ <el-button v-show="scoreShow" size="small" type="primary" @click="updateMultipleScore"
+ >涓婁紶</el-button
+ >
+ <el-button v-show="scoreShow" size="small" type="error" @click="scoreShow = false"
+ >鍙栨秷</el-button
+ >
+ </template>
<template #default="{ row }">
<el-button type="primary" size="small" @click="editRow(row)">鏌ョ湅</el-button>
</template>
@@ -103,6 +126,7 @@
import CompReport from './components/CompReport.vue';
import { useTablePaste } from '@/composables/tablePaste';
import { useCloned } from '@vueuse/core';
+import { useMessageBoxTip } from '@/composables/messageBox';
export default {
setup() {
@@ -123,11 +147,25 @@
},
townFilters: [],
// 鍘熷鏁版嵁锛岀敤浜庢帓搴忓彇娑堝悗
- orginData: []
+ orginData: [],
+ evaluationRule: undefined,
+ evaluationSubRule: undefined,
+ //鐩戞祴鏁版嵁瑙勫垯鍚嶇О
+ ruleName: {
+ score1: {
+ id: undefined,
+ name: '鐩戞祴鏁版嵁鍑虹幇鍗曟棩鍙婁互涓婃湁鏁堣秴鏍�'
+ },
+ score2: {
+ id: undefined,
+ name: '鐩戞祴鏁版嵁鏈堝潎鍊艰秴鍖哄煙鏈堝潎鍊�20%浠ヤ笂鎴栨暟鎹槑鏄惧紓甯�'
+ }
+ },
+ scoreShow: false
};
},
- methods: {
- _getParam() {
+ computed: {
+ area() {
const { locations, scenetype, time } = this.formSearch;
return {
provincecode: locations.pCode,
@@ -139,7 +177,22 @@
starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'),
scensetypeid: scenetype.value
};
- },
+ }
+ },
+ methods: {
+ // _getParam() {
+ // const { locations, scenetype, time } = this.formSearch;
+ // return {
+ // provincecode: locations.pCode,
+ // provincename: locations.pName,
+ // citycode: locations.cCode,
+ // cityname: locations.cName,
+ // districtcode: locations.dCode,
+ // districtname: locations.dName,
+ // starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'),
+ // scensetypeid: scenetype.value
+ // };
+ // },
editRow(row) {
this.$router.push(`evalutationEdit/${row.subTaskId}`);
},
@@ -151,23 +204,77 @@
},
onSearch(page, func) {
this.$refs.tableRef.clearSort();
- const area = this._getParam();
- evaluateApi.fetchAutoEvaluation(area).then((res) => {
- if (res.data) {
- this.tableData = res.data;
- this.orginData = useCloned(this.tableData).cloned;
- console.log(this.orginData);
- this.getFilters(res.data);
- if (typeof func === 'function') {
- func({ data: this.tableData });
+ this.fetchEvaluationRule(this.area).then(() => {
+ evaluateApi.fetchAutoEvaluation(this.area).then((res) => {
+ if (res.data) {
+ this.tableData = res.data;
+ this.orginData = useCloned(this.tableData).cloned;
+ console.log(this.orginData);
+ this.getFilters(res.data);
+ if (typeof func === 'function') {
+ func({ data: this.tableData });
+ }
+ }
+ });
+ });
+ },
+ fetchEvaluationRule() {
+ const param = {
+ // 鑷姩璇勪及绫诲瀷
+ taskTypeId: 99,
+ ...this.area
+ };
+ // 鑾峰彇璇勪及鎬昏鍒�
+ return evaluateApi.fetchEvaluationRule(param).then((res) => {
+ if (res.data.length > 0) {
+ this.evaluationRule = res.data[0];
+ // 鑾峰彇鍏蜂綋瀛愯鍒�
+ return evaluateApi.getSubRules(this.evaluationRule.guid).then((res) => {
+ this.evaluationSubRule = res.data;
+ // 鏌ユ壘鍙鍏ュ緱鍒嗙殑瑙勫垯id
+ for (const key in this.ruleName) {
+ const value = this.ruleName[key];
+ const subrule = this.evaluationSubRule.find((v) => {
+ return v.itemname == value.name;
+ });
+ value.id = subrule.guid;
+ }
+ });
+ }
+ });
+ },
+ // 鎵归噺鏇存柊鐩戞祴鏁版嵁寰楀垎
+ updateMultipleScore() {
+ useMessageBoxTip({
+ confirmMsg: '鏄惁涓婁紶鐩戞祴鏁版嵁寰楀垎',
+ confirmTitle: '涓婁紶鐩戞祴鏁版嵁寰楀垎',
+ onConfirm: () => {
+ if (this.evaluationRule) {
+ const param = this.tableData.map((v) => {
+ const subRule = [];
+ for (const key in this.ruleName) {
+ const value = this.ruleName[key];
+ subRule.push({
+ first: value.id,
+ second: v[key].trim() != ''
+ });
+ }
+ return {
+ ...this.area,
+ subTaskId: v.subTaskId,
+ ruleId: this.evaluationRule.guid,
+ subRule
+ };
+ });
+
+ evaluateApi.updateMultipleScore(param);
}
}
});
},
// 瑙勮寖鎬ц瘎浼颁笌鍒嗘瀽鎶ュ憡鍚庡彴鐢熸垚浠诲姟
download() {
- const area = this._getParam();
- evaluateApi.downloadAutoEvaluation(area).then((res) => {
+ evaluateApi.downloadAutoEvaluation(this.area).then((res) => {
if (res == false) {
// 鏈笅杞芥枃妗o紝鑰屾槸寮�鍚簡鏂囨。鐢熸垚鍚庡彴浠诲姟
this.$parent;
--
Gitblit v1.9.3