From c880739ec4cd5ede33b31eb98ad5f7628ea288e5 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期一, 11 十二月 2023 17:41:40 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/quality/rawMaterial/index.vue | 68 +++++++++++++++++++++------------- 1 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/views/quality/rawMaterial/index.vue b/src/views/quality/rawMaterial/index.vue index a547dd5..0c11eb8 100644 --- a/src/views/quality/rawMaterial/index.vue +++ b/src/views/quality/rawMaterial/index.vue @@ -38,11 +38,11 @@ @refreshDataList="getData" ></RawMaterialForm> <el-dialog - top="10vh" + top="7vh" title="鎵撳嵃棰勮" :visible.sync="printDialogVisible" - width="60%"> - <div style="width:100%;height: 60vh;overflow-y: scroll;"> + width="70%"> + <div style="width:90%;margin-left:5%;height: 60vh;overflow-y: scroll;"> <printTemplate id="printRaw" :formData="printFormData"></printTemplate> </div> <span slot="footer" class="dialog-footer"> @@ -54,11 +54,12 @@ </template> <script> import ttable from '@/views/common/ztt-table.vue' -import { getRawInspectList,delObj,exportRawMaterial,getObj } from '@/api/quality/rawMaterial' +import { getRawInspectList,delObj,exportRawMaterial,getObj,downloadReport } from '@/api/quality/rawMaterial' import RawMaterialForm from './rawMaterial-form' import * as fecha from 'element-ui/lib/utils/date' import { mapGetters } from 'vuex' import PrintJS from 'print-js' +import { transformZip } from '@/util/fileTransform' import printTemplate from './rawMaterial-print.vue' export default { data() { @@ -95,12 +96,20 @@ column: [ { minWidth: '120', - prop: 'code', - label: '鍘熸潗鏂欑紪鐮�', + prop: 'rawInsNo', + label: '鍘熸潗鏂欐楠岀紪鍙�', isTrue: true, isSearch: true, searchInfoType: 'text', render: { fun: this.addOrUpdateHandle } + }, + { + minWidth: '120', + prop: 'code', + label: '鍘熸潗鏂欑紪鐮�', + isTrue: true, + isSearch: true, + searchInfoType: 'text' }, { minWidth: '120', @@ -217,19 +226,20 @@ fun: this.downloadReport } ], - operator: [{ - text: '鎵撳嵃', - type: 'text', - size: 'small', - fun: this.previewFun, - show: { - val: [ - '1', - '0' - ], - key: 'judgeState' - } - }, + operator: [ + // { + // text: '鎵撳嵃', + // type: 'text', + // size: 'small', + // fun: this.previewFun, + // show: { + // val: [ + // '1', + // '0' + // ], + // key: 'judgeState' + // } + // }, { text: '浣滃簾', type: 'text', @@ -277,7 +287,15 @@ this.$message.error("鍙兘閫夋嫨宸叉娴嬬殑鏁版嵁") return } - console.log(selection) + let ids = [] + selection.forEach(ele=>{ + ids.push(ele.id) + }) + downloadReport({ids : ids}).then(res=>{ + transformZip(res) + }).catch(error=>{ + console.log(error) + }) } }, //鏌ョ湅鎶ュ憡鎸夐挳 @@ -297,13 +315,12 @@ type: "html", // header: "鍘熸潗鏂欐娴嬫姤鍛�", targetStyles: ["*"], - style: `@page {margin: 0mm 5mm;size: A4;}; - html {zoom:100%;}; + style: `@page {margin: 0mm 5mm;size: A4;} + html {zoom:100%;} @media print { html,body{ - width:880pt; - height:900pt; - margin:0; + width:200mm; + height:297mm; } }`, ignoreElements: ["no-ignore"], @@ -315,7 +332,6 @@ }, exportRawMaterial(){ exportRawMaterial(this.queryParam).then(res=>{ - console.log(res) this.downloadFun(res) }).catch(error=>{ console.log(error); -- Gitblit v1.9.3