Commit a8776277d5008277455a78ee9e9b996abb912c1d
1 parent
4771b616
Exists in
master
fix:优化项目库以及项目填报部分的导出以及刷新功能
Showing
5 changed files
with
107 additions
and
6 deletions
Show diff stats
frontend/front/src/api/projectSubmission.js
... | ... | @@ -4,7 +4,7 @@ const portal = window.context.portal |
4 | 4 | ////后台管理预览VUE表单 |
5 | 5 | export function exportRecordData(data) { |
6 | 6 | return request({ |
7 | - url: `${context.form}/wProjectLibraryInventory/v1/down?fProjectNo=${data.fProjectNo}&fProjectName=${data.fProjectName}&fProjectCategory=${data.fProjectCategory}&fProjectState=${data.fProjectState}&createTime=${data.createTime}&fProjectNature=${data.fProjectNature}&fBusinessScenarios=${data.fBusinessScenarios}&fBusinessModel=${data.fBusinessModel}&fProjectRating=${data.fProjectRating}&updateTime=${data.updateTime}`, | |
7 | + url: `${context.form}/wProjectLibraryInventory/v1/down?fProjectNo=${data.fProjectNo}&fProjectName=${data.fProjectName}&fProjectCategory=${data.fProjectCategory}&fProjectState=${data.fProjectState}&createTime=${data.createTime}&fProjectNature=${data.fProjectNature}&fBusinessScenarios=${data.fBusinessScenarios}&fBusinessModel=${data.fBusinessModel}&fProjectRating=${data.fProjectRating}&updateTime=${data.updateTime}&exportType=${data.exportType}&idList=${data.idList}`, | |
8 | 8 | method: 'get', |
9 | 9 | responseType: 'arraybuffer', |
10 | 10 | }) | ... | ... |
frontend/front/src/components/dataTemplate/TemplatePreview.vue
frontend/front/src/components/dialog/projectSubmissionDialog.vue
... | ... | @@ -88,13 +88,14 @@ export default { |
88 | 88 | await submitData(params).then((res)=>{ |
89 | 89 | console.log('打印res',res); |
90 | 90 | if(res.code == 200){ |
91 | - this.$emit('handleRefresh'); | |
91 | + this.$message.success('操作成功!'); | |
92 | 92 | // this.$emit("RefreshTable"); |
93 | + }else{ | |
94 | + this.$message.error('操作失败!'); | |
93 | 95 | } |
94 | - this.$emit("RefreshTable"); | |
96 | + this.$emit('handleRefresh'); | |
95 | 97 | this.dialogForm.dialogVisible = false; |
96 | 98 | }) |
97 | - | |
98 | 99 | } else { |
99 | 100 | console.log('error submit!!'); |
100 | 101 | return false; | ... | ... |
frontend/front/src/components/tableSlot/projectLibrary/exportLibraryRecord.vue
0 → 100644
... | ... | @@ -0,0 +1,78 @@ |
1 | +<template> | |
2 | + <div style="display: inline-block;"> | |
3 | + <el-button icon="el-icon-upload2" size="mini" @click="handleExport" :loading="loading">导出</el-button> | |
4 | + </div> | |
5 | +</template> | |
6 | + | |
7 | +<script> | |
8 | +import { exportRecordData } from '@/api/projectSubmission' | |
9 | +export default { | |
10 | + name: "exportRecord", | |
11 | + props:{ | |
12 | + searchForms:{ | |
13 | + type:Object | |
14 | + }, | |
15 | + selectRows:{ | |
16 | + type:Array | |
17 | + } | |
18 | + }, | |
19 | + data(){ | |
20 | + return { | |
21 | + loading:false | |
22 | + } | |
23 | + }, | |
24 | + created() { | |
25 | + // console.log('打印this.selectRows',this.selectRows); | |
26 | + }, | |
27 | + methods:{ | |
28 | + handleExport(){ | |
29 | + console.log('打印this.selectRows',this.selectRows,this.searchForms); | |
30 | + let isDataList = []; | |
31 | + if(this.selectRows.length>0){ | |
32 | + isDataList = this.selectRows.map((item)=>item.id_); | |
33 | + this.searchForms.project_no = ''; | |
34 | + this.searchForms.project_name = ''; | |
35 | + this.searchForms.project_category = ''; | |
36 | + this.searchForms.project_state = ''; | |
37 | + this.searchForms.create_time = ''; | |
38 | + this.searchForms.project_nature = ''; | |
39 | + this.searchForms.business_scenarios = ''; | |
40 | + this.searchForms.business_model = ''; | |
41 | + this.searchForms.project_rating = ''; | |
42 | + this.searchForms.update_time = ''; | |
43 | + console.log('打印isDataList',isDataList); | |
44 | + } | |
45 | + this.loading = true; | |
46 | + let params ={ | |
47 | + fProjectNo:this.searchForms.project_no?this.searchForms.project_no:'', | |
48 | + fProjectName:this.searchForms.project_name?this.searchForms.project_name:'', | |
49 | + fProjectCategory:this.searchForms.project_category?this.searchForms.project_category:'', | |
50 | + fProjectState:this.searchForms.project_state?this.searchForms.project_state:'', | |
51 | + createTime:this.searchForms.create_time?this.parseTime(this.searchForms.create_time,"{y}-{m}-{d}"):'', | |
52 | + fProjectNature:this.searchForms.project_nature?this.searchForms.project_nature:'', | |
53 | + fBusinessScenarios:this.searchForms.business_scenarios?this.searchForms.business_scenarios:'', | |
54 | + fBusinessModel:this.searchForms.business_model?this.searchForms.business_model:'', | |
55 | + fProjectRating:this.searchForms.project_rating?this.searchForms.project_rating:'', | |
56 | + updateTime:this.searchForms.update_time?this.parseTime(this.searchForms.update_time,"{y}-{m}-{d}"):'', | |
57 | + idList:isDataList, | |
58 | + exportType:2 | |
59 | + } | |
60 | + exportRecordData(params).then((res)=>{ | |
61 | + console.log('打印res',res); | |
62 | + let {data, headers} = res; | |
63 | + // 附件下载 | |
64 | + const blob = new Blob([data]); | |
65 | + // 附件下载 | |
66 | + const fileName = decodeURIComponent(headers['content-disposition'].split(';')[1].split('filename=')[1]); | |
67 | + saveAs(blob, fileName); | |
68 | + this.loading = false; | |
69 | + }) | |
70 | + | |
71 | + }, | |
72 | + } | |
73 | +} | |
74 | +</script> | |
75 | + | |
76 | +<style scoped> | |
77 | + | |
78 | +</style> | ... | ... |
frontend/front/src/components/tableSlot/projectSubmission/exportRecord.vue
... | ... | @@ -12,6 +12,9 @@ export default { |
12 | 12 | searchForms:{ |
13 | 13 | type:Object |
14 | 14 | }, |
15 | + selectRows:{ | |
16 | + type:Array | |
17 | + } | |
15 | 18 | }, |
16 | 19 | data(){ |
17 | 20 | return { |
... | ... | @@ -21,6 +24,23 @@ export default { |
21 | 24 | methods:{ |
22 | 25 | handleExport(){ |
23 | 26 | this.loading = true; |
27 | + console.log('打印this.selectRows',this.selectRows,this.searchForms); | |
28 | + let isDataList = []; | |
29 | + if(this.selectRows.length>0){ | |
30 | + isDataList = this.selectRows.map((item)=>item.id_); | |
31 | + this.searchForms.project_no = ''; | |
32 | + this.searchForms.project_name = ''; | |
33 | + this.searchForms.project_category = ''; | |
34 | + this.searchForms.project_state = ''; | |
35 | + this.searchForms.create_time = ''; | |
36 | + this.searchForms.project_nature = ''; | |
37 | + this.searchForms.business_scenarios = ''; | |
38 | + this.searchForms.business_model = ''; | |
39 | + this.searchForms.project_rating = ''; | |
40 | + this.searchForms.update_time = ''; | |
41 | + console.log('打印isDataList',isDataList); | |
42 | + } | |
43 | + | |
24 | 44 | let params ={ |
25 | 45 | fProjectNo:this.searchForms.project_no?this.searchForms.project_no:'', |
26 | 46 | fProjectName:this.searchForms.project_name?this.searchForms.project_name:'', |
... | ... | @@ -31,7 +51,9 @@ export default { |
31 | 51 | fBusinessScenarios:this.searchForms.business_scenarios?this.searchForms.business_scenarios:'', |
32 | 52 | fBusinessModel:this.searchForms.business_model?this.searchForms.business_model:'', |
33 | 53 | fProjectRating:this.searchForms.project_rating?this.searchForms.project_rating:'', |
34 | - updateTime:this.searchForms.update_time?this.parseTime(this.searchForms.update_time,"{y}-{m}-{d}"):'' | |
54 | + updateTime:this.searchForms.update_time?this.parseTime(this.searchForms.update_time,"{y}-{m}-{d}"):'', | |
55 | + idList:isDataList, | |
56 | + exportType:1 | |
35 | 57 | } |
36 | 58 | exportRecordData(params).then((res)=>{ |
37 | 59 | console.log('打印res',res); | ... | ... |