From 9a85ad47505713fd99b6a0eaffb5f4a0e57fd233 Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期四, 16 十一月 2023 16:29:37 +0800 Subject: [PATCH] s --- src/views/quality/finishedProductInspection/index.vue | 37 +++++++++++++++++++++++++++++-------- 1 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/views/quality/finishedProductInspection/index.vue b/src/views/quality/finishedProductInspection/index.vue index 7465498..a1713f8 100644 --- a/src/views/quality/finishedProductInspection/index.vue +++ b/src/views/quality/finishedProductInspection/index.vue @@ -16,12 +16,12 @@ top="10vh" title="鎵撳嵃棰勮" :visible.sync="printDialogVisible" - width="65%"> + width="70%"> <div style="width:100%;height: 60vh;overflow-y: scroll;"> <printTemplate id="printRaw" :formData="printFormData"></printTemplate> </div> <span slot="footer" class="dialog-footer"> - <el-button @click="()=>{printDialogVisible = false;this.printFormData=null}">鍙� 娑�</el-button> + <el-button @click="()=>{printDialogVisible = false;printFormData=null}">鍙� 娑�</el-button> <el-button type="primary" @click="printFun()">鎵� 鍗�</el-button> </span> </el-dialog> @@ -35,7 +35,7 @@ import finishedProductInspectionAdd from './finishedProduct-form' import { page,deletePro,exportExaminationProducts,queryById } from '@/api/quality/finishedProduct' import { transform } from '@/util/fileTransform' - import printTemplate from './finishedProduct-print.vue' + import printTemplate from './finishedProducter-print.vue' import PrintJS from 'print-js' export default { components: { @@ -178,7 +178,14 @@ text: '鎵撳嵃', type: 'text', size: 'small', - fun: this.showPrint + fun: this.showPrint, + show: { + val: [ + '1', + '0' + ], + key: 'result' + } },{ text: '浣滃簾', type: 'text', @@ -195,30 +202,44 @@ } }, created() { }, + watch:{ + printFormData(newVal){ + if(newVal){ + console.log("pData鍙樺寲--",newVal); + this.printFormData = newVal + } + } + }, methods: { + closedown(){ + // this.printFormData = [] + this.printDialogVisible = false; + }, //鎵撳嵃鎸夐挳 printFun() { this.printDialogVisible = false; PrintJS({ printable: "printRaw", type: "html", - maxWidth: 700, - style: '@page {margin: 0 5mm}', + maxWidth: 950, + style: '@page {margin: 2.0mm 2.0mm}', targetStyles: ["*"], + // importCSS: true, ignoreElements: ["no-ignore"], orientation: 'portrait' }); }, + //鏌ョ湅鎶ュ憡鎸夐挳 showPrint(row){ + console.log('----------'); queryById(row.id).then(res=>{ - console.log(res); + this.printFormData = res.data.data this.printDialogVisible = true }).catch(error=>{ console.log(error); }) }, exportExcel(){ - console.log("============"); let queryParam=this.$refs.finishedProduct.getQueryParam(); delete queryParam.criteria console.log(queryParam); -- Gitblit v1.9.3