guhongwei 4 năm trước cách đây
mục cha
commit
ff80ebc897
3 tập tin đã thay đổi với 86 bổ sung3 xóa
  1. BIN
      src/assets/zhengshu.jpg
  2. 76 0
      src/views/student/certCard.vue
  3. 10 3
      src/views/train-plan/print.vue

BIN
src/assets/zhengshu.jpg


+ 76 - 0
src/views/student/certCard.vue

@@ -0,0 +1,76 @@
+<template>
+  <div id="certCard">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24">
+          <el-button type="primary" size="mini" @click="toPrint()">打印证书</el-button>
+        </el-col>
+        <el-col :span="24" ref="print">
+          <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+            <p>
+              <span>学校(院):</span>
+              <span>{{ item.school_name }}</span>
+              <span>,</span>
+              <span>{{ item.entry_year }}</span>
+              <span>级</span>
+              <span>{{ item.major }}</span>
+              <span>专业</span>
+              <span>学生:</span>
+              <span>{{ item.name }}</span>
+              <span>于</span>
+              <span>2020年11月参加吉林省大学生就业能力扩展训练</span>
+              <span>第</span>
+              <span>{{ item.termname }}</span>
+              <span>期培训班。培训合格,特发此证</span>
+            </p>
+            <p>
+              <span>证书编号:2020{{ item.termname }}{{ item.classname }}</span>
+              <span>2020年11月22日</span>
+            </p>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'certCard',
+  props: {
+    list: null,
+  },
+  components: {},
+  data: function() {
+    return {
+      // zhengshu: require('@/assets/zhengshu.jpg'),
+    };
+  },
+  created() {},
+  methods: {
+    toPrint() {
+      this.$print(this.$refs.print);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.list {
+  height: 710px;
+  background-image: url(/img/zhengshu.bc829b8f.jpg);
+  background-size: 100% 100%;
+  background-repeat: no-repeat;
+  width: 100%;
+}
+</style>

+ 10 - 3
src/views/train-plan/print.vue

@@ -36,6 +36,9 @@
     <detail-frame title="学生名签" v-if="view == 'nameList'" :returns="toReturns">
       <name-card :list="studList"></name-card>
     </detail-frame>
+    <detail-frame title="打印证书" v-if="view == 'certList'" :returns="toReturns">
+      <cert-card :list="studList"></cert-card>
+    </detail-frame>
     <detail-frame title="学生报道表" v-if="view == 'signList'" :returns="toReturns">
       <sign-list :list="studList"></sign-list>
     </detail-frame>
@@ -47,6 +50,7 @@ import _ from 'lodash';
 import signList from './parts/print-sign';
 import dataTable from '@frame/components/filter-page-table';
 import nameCard from '@/views/student/namCard.vue';
+import certCard from '@/views/student/certCard.vue';
 import listFrame from '@frame/layout/admin/list-frame';
 import detailFrame from '@frame/layout/admin/detail-frame';
 import { mapState, createNamespacedHelpers } from 'vuex';
@@ -56,7 +60,7 @@ const { mapActions: student } = createNamespacedHelpers('student');
 export default {
   name: 'print',
   props: {},
-  components: { listFrame, nameCard, detailFrame, dataTable, signList },
+  components: { listFrame, nameCard, certCard, detailFrame, dataTable, signList },
   data: function() {
     return {
       view: 'list',
@@ -136,8 +140,11 @@ export default {
       if (this.$checkRes(res)) this.$set(this, `studList`, res.data);
       this.view = 'signList';
     },
-    certList({ data }) {
-      console.log(this.classList);
+    async certList({ data }) {
+      let { _id: classid } = data;
+      let res = await this.getStudentList({ classid });
+      if (this.$checkRes(res)) this.$set(this, `studList`, res.data);
+      this.view = 'certList';
     },
     classLesson({ data }) {
       console.log(this.classList);