|
|
@@ -0,0 +1,100 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dropdown @command="addBtn">
|
|
|
+ <el-button type="primary" size="mini">
|
|
|
+ {{$t(`打印资料`)}}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="质保书">{{$t(`质保书`)}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="合格证">{{$t(`合格证`)}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="检验报告">{{$t(`检验报告`)}}</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-drawer
|
|
|
+ :visible.sync="drawer"
|
|
|
+ :with-header="false"
|
|
|
+ direction="rtl"
|
|
|
+ size="50%"
|
|
|
+ append-to-body>
|
|
|
+ <div class="detail__panel container">
|
|
|
+ <p class="normal-title" style="margin-bottom:16px">{{$t(`选择模板`)}}</p>
|
|
|
+ <el-table
|
|
|
+ :data="list"
|
|
|
+ height="250"
|
|
|
+ border
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ :label="$t(`报表名称`)">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="operation"
|
|
|
+ :label="$t(`操作`)"
|
|
|
+ width="150px">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="printBtn(scope.row)" type="text" size="mini">{{$t('打 印')}}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: "printMaterials",
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ drawer:false,
|
|
|
+ list:[],
|
|
|
+ nowSelect:"",
|
|
|
+ sys_reportid:'',
|
|
|
+ idName:''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ addBtn(type){
|
|
|
+ if (type == '质保书'){
|
|
|
+ this.list = [
|
|
|
+ {
|
|
|
+ name:'质保书打印'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ this.nowSelect = type
|
|
|
+ this.sys_reportid = 163
|
|
|
+ this.idName = 'sa_dispatch'
|
|
|
+ this.dataid = this.$route.query.id
|
|
|
+ this.drawer = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async printBtn (data) {
|
|
|
+ console.log(data,'2222')
|
|
|
+ /* 报表类型 type = datainfo */
|
|
|
+ let res = await this.$api.requested({
|
|
|
+ "id":20221213094501,
|
|
|
+ "content": {
|
|
|
+ sys_reportid:this.sys_reportid,
|
|
|
+ dataid:this.dataid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,() => {
|
|
|
+ window.open(this.tool.getBaseUrl() + res.data + `&${this.idName}=${this.dataid}`)
|
|
|
+ // window.open('http://61.164.207.46:8000' + res.data + `&${this.idName}=${this.dataid}`)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.box p {
|
|
|
+ line-height: 40px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.box p:hover {
|
|
|
+ background: #EBF1FE;
|
|
|
+ color: #6191F8;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+</style>
|