Browse Source

项目立项表增加导出word功能

ljb 7 months ago
parent
commit
ba7eb564f2

+ 3 - 0
src/option/achiveManage/archiveList.js

@@ -15,6 +15,9 @@ export default {
   delBtn: false,
   editBtn: false,
   selection: false,
+  refreshBtn: false,
+  columnBtn: false,
+  gridBtn: false,
   editBtnText: '上传',
   dialogClickModal: false,
   dialogType: "drawer",

+ 12 - 0
src/page/index/top/feedback/comp.vue

@@ -50,11 +50,17 @@ export default crudCommon({
     this.getList();
   },
   methods: {
+    getFormData() {
+      const newFormData = { ...this.form };
+
+      return newFormData;
+    },
     handleDialogClose() {
       this.dialogVisible = false;
     },
     handleRowClick(row) {
       this.dialogVisible = true;
+
       this.rowData = row;
     }
   },
@@ -62,6 +68,12 @@ export default crudCommon({
   // 模块路径
   name: 'system/feedbackComp',
   res: ({ data }) => {
+    // data.records = data.records.map(item => {
+    //   if (!!item.attachment) {
+    //     item.attachment = JSON.parse(item.attachment);
+    //   }
+    //   return item;
+    // });
     return data;
   },
 });

+ 1 - 1
src/page/index/top/feedback/detail.vue

@@ -7,7 +7,7 @@
         <el-image
           v-for="(img, index) in imgList"
           style="width: 100px; height: 100px; border-radius: 6px; border: 1px solid #999; margin-right: 9px;"
-          :src="imgList" 
+          :src="img" 
           :key="index"
           :preview-src-list="imgList">
         </el-image>

+ 18 - 1
src/views/project-manage/components/apply-form.vue

@@ -1,6 +1,7 @@
 <template>
   <div>
     <div v-if="operateType === 'edit'" class="tool-btn" style="width: 800px; margin: 0 auto; text-align: right;">
+      <el-button size="small" type="primary" plain @click="handleExportWord">导出word</el-button>
       <el-button size="small" type="primary" icon="el-icon-printer" v-print="printConfig" @click="isPrintPage = true">打印</el-button>
     </div>
     <div id="applyDoc" class="apply-form" v-loading="loading">
@@ -256,6 +257,9 @@ import Decimal from "decimal.js";
 import { mapGetters } from "vuex";
 import { getDetail as getTenantDetail } from '@/api/system/tenant';
 import { downloadFileByUrl } from "@/util/util";
+import { exportBlob } from "@/api/common";
+import { getToken } from "@/util/auth";
+import { downloadXls } from "@/util/util";
 
 export default {
   components: {
@@ -648,7 +652,20 @@ export default {
       }).catch(err => {
         this.loading = false;
       });
-    }
+    },
+    handleExportWord() {
+      exportBlob(
+        `/api/kd-scientific/xm/approval/export?${
+          this.website.tokenHeader
+        }=${getToken()}`,
+        { xmId: this.projectId }
+      ).then((res) => {
+        downloadXls(
+          res.data,
+          `${this.formData.xmmc}项目立项表.doc`
+        );
+      });
+    },
   },
 };
 </script>