Explorar el Código

freemarker前端代码

user5 hace 2 años
padre
commit
61c8a12a8d

+ 45 - 0
src/api/program/ProgramProjectListInfoService.js

@@ -107,4 +107,49 @@ export default class ProgramProjectListInfoService {
       params: {id: id}
     })
   }
+  /* 一级校审文档下载 */
+  downloadFirstAuditTpl (id, auditId1) {
+    return request({
+      url: '/program/projectList/downloadFirstAuditTpl',
+      method: 'get',
+      params: {id: id, auditId1: auditId1},
+      responseType: 'blob'
+    })
+  }
+  /* 二级校审文档下载 */
+  downloadSecondAuditTpl (id, auditId2) {
+    return request({
+      url: '/program/projectList/downloadSecondAuditTpl',
+      method: 'get',
+      params: {id: id, auditId2: auditId2},
+      responseType: 'blob'
+    })
+  }
+  /* 三级校审文档下载 */
+  downloadThirdlyAuditTpl (id, auditId3) {
+    return request({
+      url: '/program/projectList/downloadThirdlyAuditTpl',
+      method: 'get',
+      params: {id: id, auditId3: auditId3},
+      responseType: 'blob'
+    })
+  }
+  /* 三级校审文档下载 */
+  downloadProofreadAuditTpl (id) {
+    return request({
+      url: '/program/projectList/downloadProofreadAuditTpl',
+      method: 'get',
+      params: {id: id},
+      responseType: 'blob'
+    })
+  }
+  /* 三级校审文档下载 */
+  downloadAuditRecordFormAfterBindingTpl (id) {
+    return request({
+      url: '/program/projectList/downloadAuditRecordFormAfterBindingTpl',
+      method: 'get',
+      params: {id: id},
+      responseType: 'blob'
+    })
+  }
 }

+ 13 - 1
src/utils/index.js

@@ -150,6 +150,18 @@ export function downloadExcel (data, filename) {
   window.URL.revokeObjectURL(href) // 释放掉blob对象
 }
 
+export function downloadWord (data, filename) {
+  var blob = new Blob([data], {type: 'application/msword,charset=utf-8'}) // application/vnd.openxmlformats-officedocument.spreadsheetml.sheet这里表示xlsx类型
+  var downloadElement = document.createElement('a')
+  var href = window.URL.createObjectURL(blob) // 创建下载的链接
+  downloadElement.href = href
+  downloadElement.download = filename // 下载后文件名
+  document.body.appendChild(downloadElement)
+  downloadElement.click() // 点击下载
+  document.body.removeChild(downloadElement) // 下载完成移除元素
+  window.URL.revokeObjectURL(href) // 释放掉blob对象
+}
+
 export function escapeHTML (a) {
   a = '' + a
   return a.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;')
@@ -290,4 +302,4 @@ function toLine (name) {
   }
 }
 
-export default {toLine, escapeHTML, hashCode, unescapeHTML, handleImageAdded, download, downloadExcel, recover, recoverNotNull, hasPermission, treeDataTranslate, printLogo, deepClone, validatenull}
+export default {toLine, escapeHTML, hashCode, unescapeHTML, handleImageAdded, download, downloadExcel, downloadWord, recover, recoverNotNull, hasPermission, treeDataTranslate, printLogo, deepClone, validatenull}

+ 9 - 9
src/views/modules/program/registered/ProjectForm.vue

@@ -936,15 +936,15 @@
           this.$message.error('至少填写一条项目直接对接人信息')
           return
         }
-        if (!this.commonJS.isEmpty(this.inputForm.equityList)) {
-          this.inputForm.equityList.forEach(item => {
-            item.type = '2'
-            this.inputForm.links.push(item)
-          })
-        } else {
-          this.$message.error('至少填写一条产权持有人联系人信息')
-          return
-        }
+        // if (!this.commonJS.isEmpty(this.inputForm.equityList)) {
+        //   this.inputForm.equityList.forEach(item => {
+        //     item.type = '2'
+        //     this.inputForm.links.push(item)
+        //   })
+        // } else {
+        //   this.$message.error('至少填写一条产权持有人联系人信息')
+        //   return
+        // }
         // if (!this.commonJS.isEmpty(this.inputForm.contactList)) {
         //   this.inputForm.contactList.forEach(item => {
         //     item.type = '3'

+ 86 - 0
src/views/modules/program/registered/ProjectList.vue

@@ -170,6 +170,17 @@
 
               <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' &&scope.row.archiveStatus === '0'||scope.row.archiveStatus === '1'||scope.row.archiveStatus === '3'||scope.row.archiveStatus === '4'" type="text"  icon="el-icon-circle-check" size="small" @click="archivePush(scope.row)">项目归档</el-button>
               <el-button v-if="hasPermission('program:registered:edit')&&scope.row.archiveStatus === '2'" type="text"  icon="el-icon-circle-check" size="small" @click="archiveReback(scope.row)">校审撤回</el-button>
+
+              <!--一级校审ftl文件下载-->
+              <!--<el-button v-if="hasPermission('program:registered:edit')" type="text"  icon="el-icon-circle-check" size="small" @click="downloadFirstAuditTpl(scope.row)">一级校审下载</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')" type="text"  icon="el-icon-circle-check" size="small" @click="downloadSecondAuditTpl(scope.row)">二级校审下载</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')" type="text"  icon="el-icon-circle-check" size="small" @click="downloadThirdlyAuditTpl(scope.row)">三级校审下载</el-button>
+            -->
+
+              <!--自校功能ftl文件下载-->
+              <el-button v-if="hasPermission('program:registered:edit')" type="text"  icon="el-icon-circle-check" size="small" @click="downloadProofreadAuditTpl(scope.row)">校对审核</el-button>
+              <el-button v-if="hasPermission('program:registered:edit')" type="text"  icon="el-icon-circle-check" size="small" @click="downloadAuditRecordFormAfterBindingTpl(scope.row)">评估报告装订后</el-button>
+
             </template>
           </vxe-column>
         </vxe-table>
@@ -798,6 +809,81 @@
           }
         })
       },
+      // 下载一级校审
+      downloadFirstAuditTpl (row) {
+        // this.$utils.downloadExcel('/sys/project/import/template')
+        this.loading = true
+        this.programProjectListInfoService.downloadFirstAuditTpl(row.id, row.auditId1).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadWord(res.data, '一级校审')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
+      // 下载二级校审
+      downloadSecondAuditTpl (row) {
+        // this.$utils.downloadExcel('/sys/project/import/template')
+        this.loading = true
+        this.programProjectListInfoService.downloadSecondAuditTpl(row.id, row.auditId2).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadWord(res.data, '二级校审')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
+      // 下载三级校审
+      downloadThirdlyAuditTpl (row) {
+        // this.$utils.downloadExcel('/sys/project/import/template')
+        this.loading = true
+        this.programProjectListInfoService.downloadThirdlyAuditTpl(row.id, row.auditId3).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadWord(res.data, '三级校审')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+    },
+    // 下载评估报告装订后浏览审核记录表
+      downloadProofreadAuditTpl (row) {
+      // this.$utils.downloadExcel('/sys/project/import/template')
+      this.loading = true
+      this.programProjectListInfoService.downloadProofreadAuditTpl(row.id).then((res) => {
+        // 将二进制流文件写入excel表,以下为重要步骤
+        this.$utils.downloadExcel(res.data, '评估报告装订后浏览审核记录表')
+        this.loading = false
+      }).catch(function (err) {
+        this.loading = false
+        if (err.response) {
+          console.log(err.response)
+        }
+      })
+    },
+      // 下载评估报告装订后浏览审核记录表
+      downloadAuditRecordFormAfterBindingTpl (row) {
+        // this.$utils.downloadExcel('/sys/project/import/template')
+        this.loading = true
+        this.programProjectListInfoService.downloadAuditRecordFormAfterBindingTpl(row.id).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, '评估报告装订后浏览审核记录表')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
       is () {
         this.userService.is().then(({data}) => {
           this.isAdmin = data