From 9a61e46d96536f3299e57f7259ae1c9972256ec6 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 30 九月 2025 09:42:09 +0800
Subject: [PATCH] 1. 隐藏未完成的账户匹配页面 2. 根据第三方新的接口文档修改接口url地址
---
src/views/fysp/evaluation/EvalutationRecord.vue | 324 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 292 insertions(+), 32 deletions(-)
diff --git a/src/views/fysp/evaluation/EvalutationRecord.vue b/src/views/fysp/evaluation/EvalutationRecord.vue
index 5727f66..40735b6 100644
--- a/src/views/fysp/evaluation/EvalutationRecord.vue
+++ b/src/views/fysp/evaluation/EvalutationRecord.vue
@@ -1,5 +1,13 @@
<template>
- <FYTable @search="onSearch" :pagination="false" ref="tableRef">
+ <FYTable
+ @search="onSearch"
+ :pagination="false"
+ ref="tableRef"
+ @cell-click="cellClick"
+ :cell-class-name="cellClassName"
+ @table-paste="handlePaste"
+ @sort-change="handleSortChange"
+ >
<template #options>
<!-- 鍖哄幙 -->
<FYOptionLocation
@@ -15,7 +23,11 @@
v-model:value="formSearch.scenetype"
></FYOptionScene>
<!-- 鏃堕棿 -->
- <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime>
+ <FYOptionTime
+ :initValue="false"
+ type="month"
+ v-model:value="formSearch.time"
+ ></FYOptionTime>
</template>
<template #buttons>
<!-- <el-button icon="Download" size="default" type="success" @click="download"
@@ -34,28 +46,44 @@
</el-form>
</template>
- <template #table-column>
- <el-table-column fixed="left" sortable prop="sceneIndex" label="缂栧彿" width="80">
+ <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">
+ <el-table-column
+ prop="sceneName"
+ :show-overflow-tooltip="true"
+ label="鍚嶇О"
+ width="300"
+ >
</el-table-column>
<el-table-column
prop="subTaskTime"
label="宸℃煡鏃ユ湡"
width="110"
- sortable
+ sortable="custom"
:formatter="timeFormat"
/>
<el-table-column
prop="evaluation.resultscorebef"
label="寰楀垎"
width="90"
- sortable
- :sort-method="sortScore"
+ sortable="custom"
/>
- <el-table-column prop="evaluation.resultscorebef" label="鐜俊鐮�" width="100">
+ <el-table-column
+ prop="evaluation.resultscorebef"
+ label="鐜俊鐮�"
+ width="100"
+ >
<template #default="{ row }">
- <span :style="`color: ${toCode(row).color};`">{{ toCode(row).name }}</span>
+ <span :style="`color: ${toCode(row).color};`">{{
+ toCode(row).name
+ }}</span>
</template>
</el-table-column>
@@ -70,14 +98,58 @@
<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="exportExcel"
- >瀵煎嚭缁撴灉</el-button
- >
- </template> -->
+ <el-table-column
+ v-if="scoreShow"
+ fixed="right"
+ align="right"
+ label="鐩戞祴鏁版嵁瓒呮爣"
+ width="160"
+ >
<template #default="{ row }">
- <el-button type="primary" size="small" @click="editRow(row)">鏌ョ湅</el-button>
+ <el-input :size="size" v-model="row.score1" />
+ </template>
+ </el-table-column>
+ <el-table-column
+ v-if="scoreShow"
+ fixed="right"
+ align="right"
+ label="鐩戞祴鏁版嵁瓒呭尯鏈堝潎鍊�"
+ width="160"
+ >
+ <template #default="{ row }">
+ <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
+ v-show="!scoreShow"
+ icon="ArrowLeft"
+ size="small"
+ type="success"
+ @click="scoreShow = true"
+ >鐩戞祴鏁版嵁寰楀垎</el-button
+ >
+ <el-button
+ v-show="scoreShow"
+ size="small"
+ type="primary"
+ @click="updateMultipleScore"
+ :loading="updateLoading"
+ >涓婁紶</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>
</el-table-column>
</template>
@@ -88,12 +160,34 @@
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';
+import { useCloned } from '@vueuse/core';
+import { useMessageBoxTip } from '@/composables/messageBox';
export default {
- name: 'ResultManage',
- components: { CompQuickSet, CompReport },
+ 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: {
@@ -101,11 +195,28 @@
scenetype: {},
time: dayjs().add(-1, 'M').date(1).toDate()
},
- townFilters: []
+ townFilters: [],
+ // 鍘熷鏁版嵁锛岀敤浜庢帓搴忓彇娑堝悗
+ orginData: [],
+ evaluationRule: undefined,
+ evaluationSubRule: undefined,
+ //鐩戞祴鏁版嵁瑙勫垯鍚嶇О
+ ruleName: {
+ score1: {
+ id: undefined,
+ name: '鐩戞祴鏁版嵁鍑虹幇鍗曟棩鍙婁互涓婃湁鏁堣秴鏍�'
+ },
+ score2: {
+ id: undefined,
+ name: '鐩戞祴鏁版嵁鏈堝潎鍊艰秴鍖哄煙鏈堝潎鍊�20%浠ヤ笂鎴栨暟鎹槑鏄惧紓甯�'
+ }
+ },
+ scoreShow: false,
+ updateLoading: false
};
},
- methods: {
- _getParam() {
+ computed: {
+ area() {
const { locations, scenetype, time } = this.formSearch;
return {
provincecode: locations.pCode,
@@ -117,7 +228,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}`);
},
@@ -128,20 +254,107 @@
this.$refs.tableRef.onSearch();
},
onSearch(page, func) {
- const area = this._getParam();
- evaluateApi.fetchAutoEvaluation(area).then((res) => {
- if (typeof func === 'function') {
- func({ data: res.data });
+ this.$refs.tableRef.clearSort();
+ this.fetchEvaluationRule(this.area).then(() => {
+ evaluateApi.fetchAutoEvaluation(this.area).then((res) => {
+ if (res.data) {
+ this.tableData = res.data;
+ this.tableData.forEach((v) => {
+ // 灏嗗師濮嬬殑寰楀垎灞曠ず鍒拌〃鏍间腑
+ if (v.itemEvaluations) {
+ for (const key in this.ruleName) {
+ const value = this.ruleName[key];
+ const itemEva = v.itemEvaluations.find((ie) => {
+ return ie.esrguid == value.id && ie.extension1 == 'true';
+ });
+ if (itemEva) {
+ v[key] = itemEva.value;
+ }
+ }
+ }
+ });
+ this.orginData = useCloned(this.tableData).cloned;
+ this.getFilters(res.data);
+ if (typeof func === 'function') {
+ func({ data: this.tableData });
+ }
+ } else {
+ this.tableData = [];
+ this.orginData = [];
+ 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;
+ });
+ if (subrule) {
+ value.id = subrule.guid;
+ }
+ }
+ });
}
- if (res.data) {
- this.getFilters(res.data);
+ });
+ },
+ // 鎵归噺鏇存柊鐩戞祴鏁版嵁寰楀垎
+ updateMultipleScore() {
+ this.updateLoading = true;
+ useMessageBoxTip({
+ confirmMsg: '鏄惁涓婁紶鐩戞祴鏁版嵁寰楀垎',
+ confirmTitle: '涓婁紶鐩戞祴鏁版嵁寰楀垎',
+ onConfirm: async () => {
+ if (this.evaluationRule) {
+ const subTaskEvaList = this.tableData.map((v) => {
+ const subRule = [];
+ for (const key in this.ruleName) {
+ const value = this.ruleName[key];
+ subRule.push({
+ id: value.id,
+ selected: v[key] && (v[key] + '').trim() != ''
+ });
+ }
+ return {
+ subTaskId: v.subTaskId,
+ ruleId: this.evaluationRule.guid,
+ subRule
+ };
+ });
+ const param = {
+ ...this.area,
+ subTaskEvaList
+ };
+
+ return await evaluateApi
+ .updateMultipleScore(param)
+ .finally(() => (this.updateLoading = false));
+ }
}
});
},
// 瑙勮寖鎬ц瘎浼颁笌鍒嗘瀽鎶ュ憡鍚庡彴鐢熸垚浠诲姟
download() {
- const area = this._getParam();
- evaluateApi.downloadAutoEvaluation(area).then((res) => {
+ evaluateApi.downloadAutoEvaluation(this.area).then((res) => {
if (res == false) {
// 鏈笅杞芥枃妗o紝鑰屾槸寮�鍚簡鏂囨。鐢熸垚鍚庡彴浠诲姟
this.$parent;
@@ -184,7 +397,54 @@
const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
return s1 - s2;
+ },
+ handleSortChange({ column, prop, order }) {
+ console.log(column, prop, order);
+ if (order == null) {
+ this.orginData.forEach((e, i) => {
+ this.tableData[i] = e;
+ });
+ } else if (prop == 'evaluation.resultscorebef') {
+ this.tableData.sort((a, b) => {
+ const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
+ const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
+ if (order == 'ascending') {
+ return s1 - s2;
+ } else if (order == 'descending') {
+ return s2 - s1;
+ }
+ });
+ } else if (prop == 'sceneIndex') {
+ this.tableData.sort((a, b) => {
+ if (order == 'ascending') {
+ if (a.sceneIndex === b.sceneIndex) {
+ return a.subTaskTime > b.subTaskTime ? 1 : -1;
+ } else {
+ return a.sceneIndex - b.sceneIndex;
+ }
+ } else if (order == 'descending') {
+ if (a.sceneIndex === b.sceneIndex) {
+ return b.subTaskTime > a.subTaskTime ? 1 : -1;
+ } else {
+ return b.sceneIndex - a.sceneIndex;
+ }
+ }
+ });
+ } else if (prop == 'subTaskTime') {
+ this.tableData.sort((a, b) => {
+ if (order == 'ascending') {
+ return a[prop] > b[prop] ? 1 : -1;
+ // return dayjs(a).isAfter(dayjs(b)) ? 1 : -1;
+ } else if (order == 'descending') {
+ return b[prop] > a[prop] ? 1 : -1;
+ // return dayjs(b).isAfter(dayjs(a)) ? 1 : -1;
+ }
+ });
+ }
}
+ },
+ mounted() {
+ this.addRefreshEvent(this.$refs.tableRef.doLayout);
}
};
</script>
--
Gitblit v1.9.3