one copy.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <div id="one">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="top" id="demo">
  6. <el-form ref="form" :model="form" label-width="100px">
  7. <el-col :span="24" class="title">
  8. 吉林省科技成果评价证书
  9. </el-col>
  10. <el-col :span="24" class="num">
  11. <p>吉发号[<el-input v-model="form.basic.jf_num"></el-input>]第<el-input v-model="form.basic.jf_nums"></el-input>号</p>
  12. </el-col>
  13. <el-col :span="24" class="info">
  14. <el-col :span="24" class="infoMess">
  15. <span>成果名称:</span>
  16. <el-input v-model="form.basic.achieve_name"></el-input>
  17. </el-col>
  18. <el-col :span="24" class="infoMess">
  19. <span>完成单位(盖章):</span>
  20. <el-input v-model="form.basic.apply_company"></el-input>
  21. </el-col>
  22. <el-col :span="24" class="infoMess">
  23. <span>完成人(签字):</span>
  24. <el-input v-model="form.basic.contacts"></el-input>
  25. </el-col>
  26. </el-col>
  27. <el-col :span="24" class="date">
  28. <p>
  29. 申请评价日期:<span>{{ getDate('yyyy') }}年</span><span>{{ getDate('MM') }}月</span><span>{{ getDate('DD') }}日</span>
  30. </p>
  31. </el-col>
  32. <el-col :span="24" class="make">
  33. <p>吉林省发明协会</p>
  34. <p>二0一八年十二月制</p>
  35. </el-col>
  36. </el-form>
  37. </el-col>
  38. <el-col :span="24" class="down">
  39. <el-button type="primary" size="mini" @click="next">下一步</el-button>
  40. <el-button type="primary" size="mini" @click="handleDown">下载</el-button>
  41. </el-col>
  42. </el-col>
  43. </el-row>
  44. </div>
  45. </template>
  46. <script>
  47. import htmlToPdf from '@/unit/htmlToPdf.js';
  48. const moment = require('moment');
  49. import { mapState, createNamespacedHelpers } from 'vuex';
  50. export default {
  51. name: 'one',
  52. props: {
  53. form: { type: Object },
  54. },
  55. components: {},
  56. data: function() {
  57. return {};
  58. },
  59. created() {},
  60. methods: {
  61. getDate(date) {
  62. if (date == 'yyyy') {
  63. return moment().format('YYYY');
  64. } else if (date == 'MM') {
  65. return moment().format('MM');
  66. } else if (date == 'DD') {
  67. return moment().format('DD');
  68. }
  69. },
  70. next() {
  71. this.$emit('next');
  72. },
  73. handleDown() {
  74. htmlToPdf.downloadPDF(document.querySelector('#demo'), '测试');
  75. },
  76. },
  77. computed: {
  78. ...mapState(['user']),
  79. },
  80. metaInfo() {
  81. return { title: this.$route.meta.title };
  82. },
  83. watch: {
  84. test: {
  85. deep: true,
  86. immediate: true,
  87. handler(val) {},
  88. },
  89. },
  90. };
  91. </script>
  92. <style lang="less" scoped>
  93. .main {
  94. padding: 0 28%;
  95. .top {
  96. width: 700px;
  97. height: 990px;
  98. // border: 1px solid #ccc;
  99. padding: 0 15px;
  100. .title {
  101. font-size: 45px;
  102. text-align: center;
  103. font-weight: bold;
  104. padding: 120px 0 0 0;
  105. font-family: cursive;
  106. margin: 0 0 30px 0;
  107. }
  108. .num {
  109. text-align: center;
  110. margin: 0 0 90px 0;
  111. p {
  112. font-size: 24px;
  113. font-family: cursive;
  114. }
  115. /deep/.el-input {
  116. width: 10%;
  117. }
  118. /deep/.el-input__inner {
  119. border: none;
  120. border-bottom: 2px solid #000;
  121. border-radius: 0;
  122. font-size: 20px;
  123. padding: 0 0;
  124. text-align: center;
  125. }
  126. }
  127. .info {
  128. padding: 0 40px;
  129. .infoMess {
  130. height: 40px;
  131. line-height: 40px;
  132. margin: 10px 0;
  133. span {
  134. display: inline-block;
  135. width: 37%;
  136. height: 45px;
  137. line-height: 45px;
  138. font-size: 24px;
  139. font-family: cursive;
  140. }
  141. /deep/.el-input {
  142. width: 63%;
  143. }
  144. /deep/.el-input__inner {
  145. border: none;
  146. border-bottom: 2px solid #000;
  147. border-radius: 0;
  148. font-size: 20px;
  149. line-height: 45px;
  150. height: 45px;
  151. }
  152. }
  153. }
  154. .date {
  155. height: 45px;
  156. line-height: 45px;
  157. margin: 60px 0 0 0;
  158. font-size: 25px;
  159. padding: 0 40px;
  160. font-family: cursive;
  161. span {
  162. display: inline-block;
  163. height: 45px;
  164. line-height: 45px;
  165. padding: 0 10px;
  166. }
  167. }
  168. .make {
  169. margin: 220px 0 0 0;
  170. text-align: center;
  171. p {
  172. font-size: 20px;
  173. padding: 5px 0;
  174. }
  175. }
  176. }
  177. .down {
  178. margin: 15px 0 0 0;
  179. text-align: center;
  180. }
  181. }
  182. </style>