Ver Fonte

下载方法

ysc há 2 anos atrás
pai
commit
b8b74a64bb

+ 2 - 2
src/api/material/material.js

@@ -1,5 +1,5 @@
 import request from '@/utils/request'
-import exportExcel from '@/utils/export'
+import download from '@/utils/download'
 
 // 查询物料计划列表
 export function listMaterial(query) {
@@ -47,7 +47,7 @@ export function delMaterial(materialId) {
 
 //导出数据
 export function exportMaterial(data) {
-  return exportExcel({
+  return download({
     url: '/material/material/export',
     method: 'get',
     responseType: 'blob',

+ 9 - 0
src/api/meeting/meeting.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
+import download from "@/utils/download";
 
 //添加会议
 export function addMeeting(data){
@@ -104,3 +105,11 @@ export function getTodoMeetings(){
     method: 'get'
   })
 }
+
+export function downloadPdf(){
+  return download({
+    url: '/meeting/download',
+    method: 'get',
+    responseType: 'blob',
+  })
+}

+ 0 - 0
src/utils/export.js → src/utils/download.js


+ 84 - 69
src/views/meeting/weeklyRecords.vue

@@ -1,88 +1,103 @@
 <template>
-  <div class="app-container" >
-    <h3>{{title}}</h3>
+  <div class="app-container">
+    <div style="display: flex;justify-content: space-between">
+      <div style="font-size: 24px">{{ title }}</div>
+      <el-button size="mini" @click="exportPdf" icon="el-icon-download" style="margin-right: 20px">导出</el-button>
+    </div>
 
-    <el-descriptions  title="" :column="2" :size="size" border>
-      <el-descriptions-item>
-        <template slot="label">
-          <i class="el-icon-user"></i>
-         会议时间
-        </template>
-       2022-12-12 12:00:00至2022-12-12 12:00:00
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label">
-          <i class="el-icon-mobile-phone"></i>
-         会议主持人
-        </template>
-      张三
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label">
-          <i class="el-icon-location-outline"></i>
-          会议地点
-        </template>
-        重庆柏玮熠办公室
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label">
-          <i class="el-icon-tickets"></i>
-          会议记录人
-        </template>
-        <el-tag size="small">李四</el-tag>
-      </el-descriptions-item>
-      <el-descriptions-item :span="2">
-        <template slot="label">
-          <i class="el-icon-office-building"></i>
-         参会人员
-        </template>
-        王五、张三、小七
-      </el-descriptions-item>
-      <el-descriptions-item :span="2">
-        <template slot="label">
-          <i class="el-icon-office-building"></i>
-          参会情况
-        </template>
-        应到15人,实到12人
-      </el-descriptions-item>
-    </el-descriptions>
-    <el-table
-      style="width: 100%" border stripe>
-      <el-table-column
-        prop="date"
-        label="姓名" align="center"
-        width="120">
-      </el-table-column>
-      <el-table-column prop="workzongjie" label="本周工作总结" align="center" min-width="450">
-        <el-table-column label="工作内容" align="center">
+    <div id="pdfDom" ref="pdfDom" style="padding: 20px">
+      <el-descriptions title="" :column="2" :size="size" border>
+        <el-descriptions-item>
+          <template slot="label">
+            <i class="el-icon-user"></i>
+            会议时间
+          </template>
+          2022-12-12 12:00:00至2022-12-12 12:00:00
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label">
+            <i class="el-icon-mobile-phone"></i>
+            会议主持人
+          </template>
+          张三
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label">
+            <i class="el-icon-location-outline"></i>
+            会议地点
+          </template>
+          重庆柏玮熠办公室
+        </el-descriptions-item>
+        <el-descriptions-item>
+          <template slot="label">
+            <i class="el-icon-tickets"></i>
+            会议记录人
+          </template>
+          <el-tag size="small">李四</el-tag>
+        </el-descriptions-item>
+        <el-descriptions-item :span="2">
+          <template slot="label">
+            <i class="el-icon-office-building"></i>
+            参会人员
+          </template>
+          王五、张三、小七
+        </el-descriptions-item>
+        <el-descriptions-item :span="2">
+          <template slot="label">
+            <i class="el-icon-office-building"></i>
+            参会情况
+          </template>
+          应到15人,实到12人
+        </el-descriptions-item>
+      </el-descriptions>
+      <el-table
+        style="width: 100%" border stripe>
+        <el-table-column
+          prop="date"
+          label="姓名" align="center"
+          width="120">
         </el-table-column>
-        <el-table-column label="是否上周遗留" align="center" width="120">
+        <el-table-column prop="workzongjie" label="本周工作总结" align="center" min-width="450">
+          <el-table-column label="工作内容" align="center">
+          </el-table-column>
+          <el-table-column label="是否上周遗留" align="center" width="120">
+          </el-table-column>
+          <el-table-column label="完成情况说明" align="center">
+          </el-table-column>
         </el-table-column>
-        <el-table-column label="完成情况说明" align="center">
+        <el-table-column prop="workplan" label="下周工作计划" align="center">
+          <el-table-column label="工作内容" align="center">
+          </el-table-column>
+          <el-table-column label="计划时间" align="center" width="150">
+          </el-table-column>
         </el-table-column>
-      </el-table-column>
-      <el-table-column prop="workplan" label="下周工作计划" align="center">
-        <el-table-column label="工作内容" align="center">
+        <el-table-column prop="pingfen" label="评分" align="center" width="85">
         </el-table-column>
-        <el-table-column label="计划时间" align="center" width="150">
+        <el-table-column prop="remark" label="备注" align="center">
         </el-table-column>
-      </el-table-column>
-      <el-table-column prop="pingfen" label="评分" align="center" width="85">
-      </el-table-column>
-      <el-table-column prop="remark" label="备注" align="center">
-      </el-table-column>
-    </el-table>
+      </el-table>
+    </div>
+
   </div>
 </template>
 
 <script>
+import {downloadPdf} from "@/api/meeting/meeting";
+
 export default {
   name: 'weeklyRecords',
-  data()  {
+  data() {
     return {
-      title : '技术部周会',
+      title: '技术部周会',
       size: ''
     }
+  },
+  methods: {
+    exportPdf() {
+      // this.$PDFSave(this.$refs['pdfDom'], '周会会议记录')
+      downloadPdf()
+
+    }
   }
 }
 </script>