|
@@ -3,7 +3,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-col :span="24" class="btn">
|
|
|
- <el-button type="primary" size="mini" @click="print">生成打印文件</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="submit">生成打印文件</el-button>
|
|
|
<el-button v-if="url" type="success" size="mini" @click="openPdf">
|
|
|
打开生成文件
|
|
|
</el-button>
|
|
@@ -13,7 +13,8 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-dialog title="毕业日期" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
|
|
|
+ <!-- 不需要输入了, 作为参数传过来,班级最后一天为毕业日期 -->
|
|
|
+ <!-- <el-dialog title="毕业日期" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
|
|
|
<el-col :span="24">
|
|
|
<el-date-picker v-model="endDate" type="date" format="yyyy 年 MM 月 dd 日" value-format="yyyy 年 MM 月 dd 日" placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
@@ -22,11 +23,12 @@
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="submit">确 定</el-button>
|
|
|
</span>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+const moment = require('moment');
|
|
|
import _ from 'lodash';
|
|
|
import printTemplate from 'print-template';
|
|
|
import dataTable from '@frame/components/filter-page-table';
|
|
@@ -35,7 +37,8 @@ export default {
|
|
|
name: 'certCard',
|
|
|
props: {
|
|
|
list: { type: Array, default: () => [] },
|
|
|
- startdate: null,
|
|
|
+ startdate: { type: String },
|
|
|
+ enddate: { type: String },
|
|
|
},
|
|
|
components: {
|
|
|
dataTable,
|
|
@@ -55,7 +58,6 @@ export default {
|
|
|
{ label: '是否优秀', prop: 'is_fine', format: i => (i === '0' ? '否' : i === '1' ? '是' : '无资格') },
|
|
|
],
|
|
|
dialogVisible: false,
|
|
|
- endDate: '',
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -104,9 +106,9 @@ export default {
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
submit() {
|
|
|
- console.log(this.endDate);
|
|
|
+ let msg = this.$message({ message: '正在生成...', duration: 0 });
|
|
|
this.dialogVisible = false;
|
|
|
- let end_date = { end_date: this.endDate };
|
|
|
+ let end_date = { end_date: moment(this.enddate).format('YYYY 年 MM 月 DD 日') };
|
|
|
let year = { year: this.startdate.substring(0, 4) };
|
|
|
let month = { month: this.startdate.substring(5, 7) };
|
|
|
var enticeNew = this.list.map(item => ({ ...item, ...end_date, ...year, ...month }));
|
|
@@ -127,6 +129,7 @@ export default {
|
|
|
});
|
|
|
// this.template.print('expressDelivery1', [duplicate[0]]).then(pdf => {
|
|
|
this.template.print('expressDelivery1', duplicate).then(pdf => {
|
|
|
+ msg.close();
|
|
|
if (pdf) {
|
|
|
this.$message.success('生成成功');
|
|
|
this.url = pdf.output('bloburi', { filename: '证书' });
|