1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<template>
<div class="app-content layoutEmbedded" style="height: 76vh;overflow: auto;">
<a-spin :spinning="loading" style="width: 100%;height: 100%;">
<div class="page-content">
<a-tabs type="card" hideAdd size="small" @change="callback">
<a-tab-pane :key="item.key" :tab="item.title" v-for="(item) in tabsData">
</a-tab-pane>
</a-tabs>
</div>
<div class="page-footer">
<!-- 申报项目详情 -->
<a-button type="primary" @click="onExport">导出</a-button>
<task-info v-model="formData" :tabsData.sync="tabsData" />
</div>
</a-spin>
</div>
</template>
<script>
const projectKPI = {
reportYear: "",
projName: "",
appUnitName: "",
managerDept: "",
projAttribute: "",
projDeadline: "",
startDate: "",
endData: "",
yearTarget: "",
year1Goal: "",
year2Goal: "",
year3Goal: "",
totalBudget: 0.00,
applyFunds: 0.00,
selfFunds: 0.00,
yearTotal: 0.00,
yearApply: 0.00,
yearSelf: 0.00,
totalRowSpan: 0, //总合并行数
outTarget: 0, //一级指标(产出指标)
benefitTarget: 0, //一级指标(效益指标)
satisfactionDegree: 0, //一级指标(满意度指标)
quantityTarget: 0, //二级指标(数量指标)
qualityTarget: 0, //二级指标(质量指标)
validityTarget: 0, //二级指标(时效指标)
costTarget: 0, //二级指标(成本指标)
economicTarget: 0, //二级指标(经济效益指标)
socialTarget: 0, //二级指标(社会效益指标)
ecologicalTarget: 0, //二级指标(生态效益指标)
sustainableTarget: 0, //二级指标(可持续影响指标)
serviceTarget: 0, //二级指标(服务对象满意度指标)
threeLevel: [],
kpiList: [],
};
import { budgetList } from '@/views/report/project/config'
import { getType } from '@/views/utils/auth'
import taskInfo from "@/views/report/task/components/taskInfo"
export default {
name: "projectView",
components: {
taskInfo
},
data () {
return {
tabsData: [
{ title: '全部', key: '0', isShow: true },
{ title: '项目基本信息', key: '1', isShow: true },
{ title: '项目人员情况', key: '2', isShow: true },
{ title: '项目主要实施内容和目标', key: '3', isShow: true },
{ title: '申请书正文', key: '4', isShow: true },
{ title: '经费预算及设备明细', key: '5', isShow: true },
{ title: '项目实施阶段及任务', key: '6', isShow: true },
{ title: '项目课题设置', key: '7', isShow: true },
{ title: '绩效目标表', key: '8', isShow: true },
{ title: '附件信息', key: '9', isShow: true },
{ title: '审核记录', key: '10', isShow: true },
],
formData: {
id: null,
appPersonName: null,
sex: null,
birthday: null,
nationName: null,
degreeName: null,
titleName: null,
mobile: null,
email: null,
jobTime: null,
address: null,
appUnitName: null,
mainResearchAreas: null,
unitLinkName: null,
unitLinkMobile: null,
unitLinkEmail: null,
unitLinkFax: null,
projName: null,
knowledgeId: null,
subjectScope: null,
projClass: null,
remark: null,
startDate: null,
endDate: null,
totalFunding: null,
govFunding: null,
projAbstract: null,
projKeywords: null,
yearTarget: null,
year1Goal: null,
year2Goal: null,
year3Goal: null,
projectKPI: projectKPI,
cooperativeUnits: [],
members: [],
budget: [],
fundPlan: [],
fileList: [],
auditList: [],
managerDept: "",
},
loading: false,
projType: getType()
};
},
props: {
value: {
type: String,
default: () => {
return null
}
},
},
created () {
this.getTaskByProjId()
},
methods: {
getTaskByProjId () {
if (this.value != null) {
this.loading = true
this.$api.task.getTaskByProjId({ id: this.value }).then(({ data = {} }) => {
if (data) {
this.formData = data
this.loading = false
} else
this.$emit('close', 'error')
}).catch(() => { this.$emit('close', 'error') })
}
},
onExport () {
axios({
url: "/v1/science-admin/com-project/export1/" + this.value,
method: 'GET',
responseType: "blob",
headers: {
Authorization: 'Bearer ' + getToken(),
'Content-Type': 'application/pdf;charset=utf-8'
}
}).then(response => {
console.log(response)
const blob = new Blob([response.data], { type: 'application/pdf' });
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
const filename = response.headers['content-disposition'] ? decodeURIComponent(response.headers['content-disposition'].split('filename=')[1]) : '项目报告.pdf';
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
}).catch(error => {
console.error('下载文件出错:', error);
this.$message.error('下载文件失败');
});
},
callback (key) {
var index = parseInt(key)
this.tabsData.forEach(e => {
if (key == '0')
e.isShow = true
else
e.isShow = false
})
this.tabsData[0].isShow = true;
this.tabsData[index].isShow = true;
},
},
}
</script>
<style scoped lang="less">
::v-deep .ant-spin-container {
width: 100%;
height: 100%;
}
::-webkit-scrollbar {
width: 8px;
height: 6px;
}
.page-content {
width: 100%;
height: 50px;
}
.page-footer {
width: 100%;
height: calc(100% - 50px);
overflow: auto;
}
</style>