Browse Source

增加任务导出

asd123a20 2 years ago
parent
commit
61d21fe4f9
3 changed files with 36 additions and 4 deletions
  1. 17 1
      src/views/community/log/index.vue
  2. 17 1
      src/views/community/realtime/index.vue
  3. 2 2
      vue.config.js

+ 17 - 1
src/views/community/log/index.vue

@@ -29,7 +29,7 @@
 
       <el-col :span="20" :xs="24">
         <div>
-          <el-select v-model="queryParams.natTaskId" @change="getList" placeholder="请选择任务">
+          <el-select v-model="queryParams.taskId" @change="getList" placeholder="请选择任务">
             <el-option
               v-for="item in taskList"
               :key="item.natTaskId"
@@ -37,6 +37,15 @@
               :value="item.natTaskId">
             </el-option>
           </el-select>
+          <el-dropdown @command="itemCommand" style="margin: 0 0 20px 20px">
+            <el-button type="primary">
+              数据导出<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="1">导出已检</el-dropdown-item>
+              <el-dropdown-item command="0">导出未检</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
           <el-tag style="margin: 0 0 20px 20px">应检:{{ num && num.totalCount }}</el-tag>
           <el-tag style="margin: 0 20px 20px 20px" type="success">已检:{{ num && num.detectedCount }}</el-tag>
           <el-tag type="danger">未检: {{ num && num.undetectedCount }}</el-tag>
@@ -166,6 +175,13 @@ export default {
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
+    // 导出
+    itemCommand(e) {
+      const { addrType, addrInterId, taskId } = this.queryParams;
+      this.download('/community/log/export-history', {
+        addrType, addrInterId, taskId, detectStatus: e
+      }, `核酸检测历史${e == '0' ? '未检' : '已检'}记录_${new Date().getTime()}.xlsx`)
+    }
   },
 };
 </script>

+ 17 - 1
src/views/community/realtime/index.vue

@@ -29,7 +29,16 @@
 
       <el-col :span="20" :xs="24">
         <div>
-          <el-tag>应检:{{ num && num.totalCount }}</el-tag>
+          <el-dropdown @command="itemCommand">
+            <el-button type="primary">
+              数据导出<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="1">导出已检</el-dropdown-item>
+              <el-dropdown-item command="0">导出未检</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+          <el-tag style="margin: 0 20px 20px 20px">应检:{{ num && num.totalCount }}</el-tag>
           <el-tag style="margin: 0 20px 20px 20px" type="success">已检:{{ num && num.detectedCount }}</el-tag>
           <el-tag type="danger">未检: {{ num && num.undetectedCount }}</el-tag>
         </div>
@@ -209,6 +218,13 @@ export default {
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
+    // 导出
+    itemCommand(e) {
+      const { addrType, addrInterId } = this.queryParams;
+      this.download('/community/log/export-history', {
+        addrType, addrInterId, detectStatus: e
+      }, `核酸检测历史${e == '0' ? '未检' : '已检'}记录_${new Date().getTime()}.xlsx`)
+    }
   },
 };
 </script>

+ 2 - 2
vue.config.js

@@ -37,8 +37,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://fuyu.scapp.cn/prod-api/`,
-        // target: `http://192.168.0.71:8080`,
+        // target: `http://fuyu.scapp.cn/prod-api/`,
+        target: `http://192.168.0.71:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''