| | |
| | | "vue-count-to": "1.0.13", |
| | | "vue-cropper": "0.5.5", |
| | | "vue-meta": "2.4.0", |
| | | "vue-print-nb": "^1.7.5", |
| | | "vue-router": "3.4.9", |
| | | "vuedraggable": "2.24.3", |
| | | "vuex": "3.6.0" |
| | |
| | | |
| | | Vue.config.productionTip = false |
| | | const Base64 = require('js-base64').Base64 |
| | | |
| | | import Print from 'vue-print-nb' |
| | | Vue.use(Print) |
| | | new Vue({ |
| | | el: '#app', |
| | | router, |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="app-container" id="printable-content"> |
| | | <div class="form-header mt"> |
| | | <h1 style="font-size:21px;padding-top:30px;display: flex;justify-content: space-between;align-items: center;"> |
| | | <span>家庭设备详情</span> |
| | | <div style="display: flex; align-items: center;"> |
| | | <el-button size="mini" type="text" @click="checkNote()" v-hasPermi="['person:information:memo']"> |
| | | <el-button size="mini" type="text" v-print="'#printable-content'" v-hasPermi="['person:information:memo']"> |
| | | <div class="form" ><el-icon style="padding-right:110px;"></el-icon> |
| | | <span class="text" style="width: 69px;height: 26px;font-size: 16px; |
| | | font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">备忘本</span></div> |
| | | </el-button> |
| | | <el-button size="mini" type="text" @click="print()" v-hasPermi="['person:information:memo']"> |
| | | <div class="form" ><el-icon style="padding-right:110px;"></el-icon> |
| | | <span class="text" style="width: 69px;height: 26px;font-size: 16px; |
| | | font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">打印</span></div> |
| | | </el-button> |
| | | </div> |
| | | </h1> |
| | |
| | | this.dsb = false |
| | | this.btn = true |
| | | }, |
| | | //打印 |
| | | print() |
| | | { |
| | | |
| | | setTimeout(() => { |
| | | // 获取待打印的内容 |
| | | let printableContent = document.getElementById('printable-content').innerHTML; |
| | | console.log(printableContent) |
| | | // 创建一个新的窗口并加载打印内容 |
| | | let printWindow = window.open('', '_blank'); |
| | | printWindow.document.write('<html><head><title>打印内容</title></head><body>' + printableContent + '</body></html>'); |
| | | |
| | | // 执行打印操作 |
| | | printWindow.document.close(); |
| | | |
| | | // 如果内容中有图片或其他需要一定时间加载的,请使用注释中的延时打印 |
| | | |
| | | printWindow.print() |
| | | }, 1000) |
| | | // printWindow.print(); |
| | | |
| | | }, |
| | | //查看备忘本 |
| | | checkNote(row){ |
| | | |
| | |
| | | //写第3代的代码逻辑,用两个for循环写第3代 |
| | | this.getGenByNum(this.rootThiList, this.rootList[0], 1, 3) |
| | | console.log(this.rootThiList) |
| | | // console.log('-=-------') |
| | | console.log('-=-------') |
| | | this.isShow_2=true |
| | | this.isShow_3=true |
| | | this.isShow_4=false |
| | | }, |
| | | generation_4(){ |
| | | this.getList(4); |
| | | this.getGenByNum(this.rootFouList, this.rootList[0], 1, 3) |
| | | // alert(32) |
| | | this.getGenByNum(this.rootFouList, this.rootList[0], 1, 4) |
| | | console.log(this.rootFouList) |
| | | // console.log('-=23-------') |
| | | this.isShow_2=true |
| | | this.isShow_3=true |
| | | this.isShow_4=true |