|
@@ -1,24 +1,34 @@
|
|
|
<template>
|
|
|
<div id="file">
|
|
|
- <el-button type="primary" @click="handleDown">pdf</el-button>
|
|
|
<el-row>
|
|
|
- <el-col :span="24" style="text-align:center;font-size:32px;margin-bottom:30px;">
|
|
|
- {{ getProp('basic.achieve_name') }}
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <el-button type="primary" size="mini" @click="download">PDF下载</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="back">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="down">
|
|
|
+ <div id="demo">
|
|
|
+ <el-col :span="24" class="common one">
|
|
|
+ <one></one>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="common two">
|
|
|
+ <two :form="form"></two>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="common thr">
|
|
|
+ <thr :list="expertList"></thr>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <div id="demo">
|
|
|
- <page6></page6>
|
|
|
- <page5></page5>
|
|
|
- <expertList :list="expertList"></expertList>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
const _ = require('lodash');
|
|
|
-import page5 from '@common/template/page5.vue';
|
|
|
-import page6 from '@common/template/page6.vue';
|
|
|
-import expertList from '@common/template/expertList.vue';
|
|
|
+import one from './file/one.vue';
|
|
|
+import two from './file/two.vue';
|
|
|
+import thr from './file/thr.vue';
|
|
|
import htmlToPdf from '@/unit/htmlToPdf.js';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
|
|
@@ -26,42 +36,43 @@ const { mapActions: achieveApplyExpert } = createNamespacedHelpers('achieveApply
|
|
|
export default {
|
|
|
name: 'file',
|
|
|
props: {},
|
|
|
- components: { expertList, page5, page6 },
|
|
|
+ components: { one, two, thr },
|
|
|
data: function() {
|
|
|
return {
|
|
|
- info: {},
|
|
|
+ form: { basic: {} },
|
|
|
expertList: [],
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.init();
|
|
|
+ async created() {
|
|
|
+ await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
...achieveApply(['fetch']),
|
|
|
...achieveApplyExpert(['query']),
|
|
|
- async init() {
|
|
|
- const apply = await this.fetch(this.id);
|
|
|
- if (this.$checkRes(apply)) {
|
|
|
- this.$set(this, `info`, apply.data);
|
|
|
- }
|
|
|
- const experts = await this.query({ apply_id: this.info.id, type: '2', expert: true });
|
|
|
- if (this.$checkRes(experts)) {
|
|
|
- this.$set(this, `expertList`, experts.data);
|
|
|
+ async search() {
|
|
|
+ if (this.id) {
|
|
|
+ let res = await this.fetch(this.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, 'form', res.data);
|
|
|
+ }
|
|
|
+ const experts = await this.query({ apply_id: this.form.id, type: '2', expert: true });
|
|
|
+ if (this.$checkRes(experts)) {
|
|
|
+ this.$set(this, `expertList`, experts.data);
|
|
|
+ console.log(this.expertList);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- // 证书下载
|
|
|
- handleDown() {
|
|
|
- htmlToPdf.downloadPDF(document.querySelector('#demo'), this.info.basic.achieve_name);
|
|
|
+ // PDF下载
|
|
|
+ download() {
|
|
|
+ htmlToPdf.downloadPDF(document.querySelector('#demo'), '测试');
|
|
|
},
|
|
|
- getProp(prop) {
|
|
|
- return _.get(this.info, prop);
|
|
|
+ // 返回
|
|
|
+ back() {
|
|
|
+ this.$router.push({ path: '/adminMeet' });
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['user', 'menuParams']),
|
|
|
- pageTitle() {
|
|
|
- return `${this.$route.meta.title}`;
|
|
|
- },
|
|
|
+ ...mapState(['user']),
|
|
|
id() {
|
|
|
return this.$route.query.id;
|
|
|
},
|
|
@@ -69,7 +80,47 @@ export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.main {
|
|
|
+ .top {
|
|
|
+ text-align: center;
|
|
|
+ margin: 0 0 15px 0;
|
|
|
+ }
|
|
|
+ .down {
|
|
|
+ padding: 0 20%;
|
|
|
+ #demo {
|
|
|
+ width: 100%;
|
|
|
+ height: 4167px;
|
|
|
+ border: 1px solid #ff0000;
|
|
|
+ .one {
|
|
|
+ height: 1389px;
|
|
|
+ padding: 50px 30px;
|
|
|
+ }
|
|
|
+ .two {
|
|
|
+ height: 1387px;
|
|
|
+ padding: 50px 30px;
|
|
|
+ }
|
|
|
+ .thr {
|
|
|
+ height: 1390px;
|
|
|
+ padding: 60px 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.common {
|
|
|
+ width: 100%;
|
|
|
+ height: 1388px;
|
|
|
+ border-bottom: 1px solid #666666;
|
|
|
+ padding: 40px 20px;
|
|
|
+}
|
|
|
+</style>
|