From fab4d7d62b2039ab8660649d26a8c6f8f32193b5 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 11 一月 2024 17:41:11 +0800
Subject: [PATCH] 1. 初步完成评估任务整体逻辑; 2. 新增评估记录下载功能(待完善)

---
 src/views/fysp/evaluation/ResultManage.vue |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/src/views/fysp/evaluation/ResultManage.vue b/src/views/fysp/evaluation/ResultManage.vue
index b076fda..0ba2bf5 100644
--- a/src/views/fysp/evaluation/ResultManage.vue
+++ b/src/views/fysp/evaluation/ResultManage.vue
@@ -21,7 +21,9 @@
     </template>
 
     <template #options-expand>
-      <CompQuickSet @quick-set="setOptions"></CompQuickSet>
+      <el-form :inline="true">
+        <CompQuickSet @quick-set="setOptions"></CompQuickSet>
+      </el-form>
     </template>
 
     <template #table-column>
@@ -70,8 +72,8 @@
       <el-table-column prop="biManagementCompany" label="鐗╀笟" min-width="110"/> -->
       <el-table-column fixed="right" align="right" label="鎿嶄綔" width="160">
         <template #header>
-          <el-button icon="DocumentAdd" size="default" type="success" @click="drawer = true"
-            >鑷姩璇勪及</el-button
+          <el-button icon="Download" size="default" type="success" @click="download"
+            >涓嬭浇缁撴灉</el-button
           >
         </template>
         <template #default="{ row }">
@@ -102,23 +104,27 @@
     };
   },
   methods: {
-    setOptions(param) {
-      this.formSearch.locations = param.locations;
-      this.formSearch.scenetype = param.scenetype;
-      this.$refs.tableRef.onSearch()
-    },
-    onSearch(page, func) {
+    _getParam() {
       const { locations, scenetype, time } = this.formSearch;
-      const area = {
+      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'),
+        starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'),
         scensetypeid: scenetype.value
       };
+    },
+    setOptions(param) {
+      this.formSearch.locations = param.locations;
+      this.formSearch.scenetype = param.scenetype;
+      this.formSearch.sourceType = param.sourceType;
+      this.$refs.tableRef.onSearch();
+    },
+    onSearch(page, func) {
+      const area = this._getParam()
       evaluateApi.fetchAutoEvaluation(area).then((res) => {
         if (typeof func === 'function') {
           func({ data: res.data });
@@ -127,6 +133,12 @@
           this.getFilters(res.data);
         }
       });
+    },
+    download() {
+      const area = this._getParam()
+      evaluateApi.downloadAutoEvaluation(area).then(res=>{
+        this.$parent
+      })
     },
     getFilters(data) {
       const townList = [];
@@ -166,5 +178,4 @@
   }
 };
 </script>
-<style scoped>
-</style>
+<style scoped></style>

--
Gitblit v1.9.3