Explorar el Código

财务报告审核单功能调整

user5 hace 2 años
padre
commit
5b5a07e62a

+ 9 - 0
src/api/cw/reportManagement/ProjectReportService.js

@@ -143,4 +143,13 @@ export default class ProjectReportService {
       params: {reportId: reportId}
     })
   }
+  /* 三级校审文档下载 */
+  downloadCwReportAuditTpl (id) {
+    return request({
+      url: '/cwProjectReport/downloadCwReportAuditTpl',
+      method: 'get',
+      params: {id: id},
+      responseType: 'blob'
+    })
+  }
 }

+ 24 - 2
src/views/modules/cw/reportManagement/ReportManagementForm.vue

@@ -12,6 +12,11 @@
       :visible.sync="visible">
       <el-row>
         <el-row>
+          <div v-if="tabName === '报告审核单下载'">
+            <el-row type="flex" justify="end">
+              <el-button @click="downloadCwReportAuditTpl">报告审核单下载</el-button>
+            </el-row>
+          </div>
           <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
                    label-width="135px" @submit.native.prevent>
             <el-divider content-position="left"><i class="el-icon-document"></i> 项目信息</el-divider>
@@ -932,7 +937,8 @@
         tableKeyContact: '2',
         tableKeyClient2: '1',
         tableKeyClient3: '1',
-        visible: false
+        visible: false,
+        tabName: ''
       }
     },
     ReportReviewService: null,
@@ -1000,7 +1006,8 @@
       getKeyWatch (keyWatch) {
         this.keyWatch = keyWatch
       },
-      init (method, id) {
+      init (method, id, tabName) {
+        this.tabName = tabName
         this.visible = true
         if (method === 'edit') {
           this.title = '报告信息修改'
@@ -1514,6 +1521,21 @@
       changeBusinessType () {
         // 切换业务类型的时候,审计业务类型清空
         this.inputForm.auditBusinessType = ''
+      },
+      // 下载报告审核单下载
+      downloadCwReportAuditTpl () {
+        // this.$utils.downloadExcel('/sys/project/import/template')
+        this.loading = true
+        this.projectReportService.downloadCwReportAuditTpl(this.inputForm.id).then((res) => {
+          // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(res.data, '报告审核单.xls')
+          this.loading = false
+        }).catch(function (err) {
+          this.loading = false
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
       }
     }
   }

+ 3 - 3
src/views/modules/cw/reportManagement/ReportManagementList.vue

@@ -301,7 +301,7 @@
       add () {
         // this.$refs.workClientForm.init('add', '')
         // this.$refs.reportManagementTaskForm.init('add', '')
-        this.$refs.reportManagementForm.init('add', '')
+        this.$refs.reportManagementForm.init('add', '', '')
       },
       // 修改
       edit (id) {
@@ -310,13 +310,13 @@
         })[0]
         // this.$refs.workClientForm.init('edit', id)
         // this.$refs.reportManagementTaskForm.init('edit', id)
-        this.$refs.reportManagementForm.init('edit', id)
+        this.$refs.reportManagementForm.init('edit', id, '')
       },
       // 查看
       view (id) {
         // this.$refs.workClientForm.init('view', id)
         // this.$refs.reportManagementTaskForm.init('view', id)
-        this.$refs.reportManagementForm.init('view', id)
+        this.$refs.reportManagementForm.init('view', id, '报告审核单下载')
       },
       // 查询当前用户是否是管理员用户
       checkIsAdmin () {