| | |
| | | <template> |
| | | <div> |
| | | <div style="margin: 100px;"> |
| | | <el-button type="primary" @click="click">请ç¹å»æ</el-button> |
| | | <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" /> |
| | | </div> |
| | | |
| | | <el-button type="primary" @click="clickMe">ç¹å»æ</el-button> |
| | | |
| | | <el-dialog |
| | | title="é¢è§" |
| | | :visible.sync="dialogVisible" |
| | | width="1140" |
| | | > |
| | | <!-- è¦æå°çåºå --> |
| | | <div id="printMe" style="padding: 30px"> |
| | | |
| | | <div style="display: flex;justify-content: space-around;"> |
| | | <!-- äºç»´ç é¨å--> |
| | | <div> |
| | | <div id="qrCode" ref="qrCodeDiv" /> |
| | | <!-- <img :src="QRImgUrl">--> |
| | | |
| | | <div style="font-size: 18px;width: 100px;text-align: center;margin-top: 10px">MO-79601</div> |
| | | </div> |
| | | <!-- å
¬å¸åç§°åæå°åç±»å--> |
| | | <div |
| | | style="height: 100px;display: flex;justify-content:space-between;align-items: center;flex-direction: column;font-weight: bolder" |
| | | > |
| | | <div style="font-size: 26px;">永康æ°å¯è¿ªå·¥ä¸äºèæéå
¬å¸</div> |
| | | <div style="font-size: 22px;">å§å¤æ´¾å</div> |
| | | </div> |
| | | <!--å³ä¾§æ°´å°åå§åæ¥æ--> |
| | | <div> |
| | | <!-- <div ref="watermark" style="width: 100px;height:100px;" />--> |
| | | <div style="color:#0f0f0f;;width: 100px;margin-top:40px;height: 50px;text-align: center">å¯è¿ªå¶é </div> |
| | | <div style="font-weight: bolder"> |
| | | <div>å§åï¼å¼ ä¸</div> |
| | | <div>æ¥æï¼2022-07-05</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <el-divider />--> |
| | | <div style="width:100%;height: 30px;border-bottom: 1px solid #eee;margin-bottom: 20px" /> |
| | | <el-table |
| | | id="table" |
| | | :data="tableData" |
| | | border |
| | | class="elTable" |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column |
| | | id="column0" |
| | | prop="date" |
| | | label="æ¥æ" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | id="column1" |
| | | prop="name" |
| | | label="å§å" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | id="column2" |
| | | prop="address" |
| | | label="å°å" |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | id="column3" |
| | | prop="address" |
| | | label="å°å" |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | id="column4" |
| | | prop="address" |
| | | width="150" |
| | | |
| | | label="å°å" |
| | | /> |
| | | <el-table-column |
| | | id="column5" |
| | | width="150" |
| | | |
| | | prop="address" |
| | | label="å°å" |
| | | /> |
| | | <el-table-column |
| | | id="column6" |
| | | prop="address" |
| | | width="120" |
| | | |
| | | label="å°å" |
| | | /> |
| | | <el-table-column |
| | | id="column7" |
| | | width="119" |
| | | |
| | | prop="address" |
| | | label="å°å" |
| | | /> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!-- <vue-easy-print ref="printRef" :button-show="true">--> |
| | | <!-- x--> |
| | | <!-- </vue-easy-print>--> |
| | | |
| | | <!-- æå°çæé®ï¼æ¾ç¤ºæå°é¢è§ --> |
| | | <!-- <el-button v-print="'#printMe'">æå°</el-button>--> |
| | | <el-button v-print="printObj">æå°</el-button> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!--2222--> |
| | | <el-dialog |
| | | title="é¢è§" |
| | | :visible.sync="dialogVisible2" |
| | | width="1140" |
| | | > |
| | | <!-- è¦æå°çåºå --> |
| | | <div id="printMe2" style="padding: 30px;"> |
| | | <!-- <div style="width: 500px; height: 300px;">--> |
| | | |
| | | <div |
| | | style="display: flex;width: 300px;height: 200px;border: 1px solid #000;text-align: center;font-size: 16px;" |
| | | > |
| | | <div style="width: 100px;display: flex;flex-direction: column;border-right: 1px solid #000"> |
| | | <div |
| | | style="display: flex;height: 75%;border-bottom:1px solid #000;justify-content: center;align-items: center " |
| | | > |
| | | <div id="qrCode2" ref="qrCodeDiv2" /> |
| | | </div> |
| | | <div style="display: flex;height: 25%;justify-content: center;align-items: center"> |
| | | æ°éï¼100 |
| | | </div> |
| | | </div> |
| | | <div style="width:200px;display: flex;flex-direction: column"> |
| | | <div |
| | | style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: center;align-items: center " |
| | | > |
| | | å·¥åç¼å·ï¼1403-001-0001 |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 25%;border-bottom:1px solid #000;justify-content: center;align-items: center " |
| | | > |
| | | å·¥åç¼å·ï¼1403-001-0001 |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 25%;border-bottom:1px solid #000 ;justify-content: center;align-items: center" |
| | | > |
| | | å·¥åç¼å·ï¼1403-001-0001 |
| | | </div> |
| | | <div style="display: flex;height: 25%;justify-content: center;align-items: center"> |
| | | å·¥åç¼å·ï¼1403-001-0001 |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <!-- </div>--> |
| | | </div> |
| | | |
| | | <!-- <vue-easy-print ref="printRef" :button-show="true">--> |
| | | <!-- x--> |
| | | <!-- </vue-easy-print>--> |
| | | |
| | | <!-- æå°çæé®ï¼æ¾ç¤ºæå°é¢è§ --> |
| | | <!-- <el-button v-print="'#printMe'">æå°</el-button>--> |
| | | <el-button v-print="printObj2">æå°</el-button> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisible2 = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="dialogVisible2 = false">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-button type="text" @click="outerVisible = true">ç¹å»æå¼å¤å± Dialog</el-button> |
| | | |
| | | <el-button type="primary" @click="ws_ajax_preview">jhjhjh</el-button> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ImportPicker from '@/components/ImportPicker' |
| | | // import vueEasyPrint from 'vue-easy-print' |
| | | import QRCode from 'qrcodejs2' |
| | | import { MesOrderPrintSearch, MesOrderPrintSearch1 } from '@/api/utils' |
| | | import { urlAddRandomNo, webapp_ws_ajax_run, webapp_urlprotocol_startup } from '@/utils/grwebapp' |
| | | import { getCookie } from '@/utils/auth' |
| | | // import QRCode from 'qrcode' |
| | | |
| | | export default { |
| | | name: 'Wljy', |
| | | components: { |
| | | ImportPicker |
| | | }, |
| | | name: 'Gdpg', |
| | | // components: { |
| | | // vueEasyPrint |
| | | // }, |
| | | data() { |
| | | return { |
| | | title_value: 'æ°æ®å¯¼å
¥ / ç¨æ·è§è²', |
| | | code: '2', |
| | | shows: false |
| | | outerVisible: false, |
| | | innerVisible: false, |
| | | dialogVisible2: false, |
| | | printObj2: { |
| | | id: 'printMe2', |
| | | beforeOpenCallback(vue) { |
| | | vue.printLoading = true |
| | | console.log('æå¼ä¹å') |
| | | console.log() |
| | | }, |
| | | openCallback(vue) { |
| | | vue.printLoading = false |
| | | console.log('æ§è¡äºæå°') |
| | | }, |
| | | closeCallback(vue) { |
| | | console.log('å
³éäºæå°å·¥å
·') |
| | | } |
| | | |
| | | }, |
| | | firstWatermark: true, // ç¬¬ä¸æ¬¡æ¾ç¤ºæ°´å° |
| | | firstbindQRCode: true, // ç¬¬ä¸æ¬¡æ¾ç¤ºäºç»´ç |
| | | form: { |
| | | describle: '' |
| | | }, |
| | | QRImgUrl: '', |
| | | QRlink: 'www.xxx.com', |
| | | dialogVisible: false, |
| | | printObj: { |
| | | id: 'printMe', |
| | | popTitle: 'æå°æ¨¡æ¿', |
| | | preview: false, |
| | | extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>', |
| | | previewBeforeOpenCallback() { |
| | | }, // é¢è§çªå£æå¼ä¹åçcallbackï¼å¼å¯é¢è§æ¨¡å¼è°ç¨ï¼ |
| | | previewOpenCallback() { |
| | | }, // é¢è§çªå£æå¼ä¹åçcallbackï¼å¼å¯é¢è§æ¨¡å¼è°ç¨ï¼ |
| | | beforeEntryIframe() { |
| | | const widthArr = ['10%', '10%', '15%', '15%', '15%', '15%', '10%', '10%'] |
| | | // const tables = document.getElementById('table').getElementsByTagName('el-table') // è·åæå°çè¡¨æ ¼ |
| | | const tables = document.getElementById('table') // è·åæå°çè¡¨æ ¼ |
| | | // const headcolgroupCol0 = tables[0].getElementsByTagName('colgroup')[0].getElementsByTagName('col') |
| | | // const headcolgroupCol0 = document.getElementById('column0').style.width = '400px' |
| | | // const headcolgroupCol1 = document.getElementById('column1') |
| | | // const headcolgroupCol2 = document.getElementById('column2') |
| | | // const headcolgroupCol3 = document.getElementById('column3') |
| | | // const headcolgroupCol4 = document.getElementById('column4') |
| | | // const headcolgroupCol5 = document.getElementById('column5') |
| | | // const headcolgroupCol6 = document.getElementById('column6') |
| | | // const headcolgroupCol7 = document.getElementById('column7') |
| | | // const headcolgroupCol1 = tables[1].getElementsByTagName('colgroup')[0].getElementsByTagName('col') |
| | | // widthArr.forEach((val, index) => { |
| | | // headcolgroupCol0[index].width = val |
| | | // headcolgroupCol1[index].width = val |
| | | // headcolgroupCol2[index].width = val |
| | | // headcolgroupCol3[index].width = val |
| | | // headcolgroupCol4[index].width = val |
| | | // headcolgroupCol5[index].width = val |
| | | // headcolgroupCol6[index].width = val |
| | | // headcolgroupCol7[index].width = val |
| | | // }) |
| | | }, |
| | | openCallback() { |
| | | |
| | | }, // è°ç¨æå°ä¹åçåè°äºä»¶ |
| | | closeCallback() { |
| | | } // å
³éæå°çåè°äºä»¶ï¼æ æ³ç¡®å®ç¹å»çæ¯ç¡®è®¤è¿æ¯åæ¶ï¼ |
| | | |
| | | // id: 'printMe', |
| | | // popTitle: 'æå°', // æå°é
ç½®é¡µä¸æ¹æ é¢ |
| | | // extraHead: '', // æä¸æ¹ç头鍿åï¼éå å¨headæ ç¾ä¸çé¢å¤æ ç¾,使ç¨éå·åé |
| | | // preview: '', // æ¯å¦å¯å¨é¢è§æ¨¡å¼ï¼é»è®¤æ¯falseï¼å¼å¯é¢è§æ¨¡å¼ï¼å¯ä»¥å
é¢è§åæå°ï¼ |
| | | // previewTitle: '', // æå°é¢è§çæ é¢ï¼å¼å¯é¢è§æ¨¡å¼ååºç°ï¼, |
| | | // previewPrintBtnLabel: '', // æå°é¢è§çæ é¢ç䏿¹æé®ææ¬ï¼ç¹å»å¯è¿å
¥æå°ï¼å¼å¯é¢è§æ¨¡å¼ååºç°ï¼ |
| | | // zIndex: '', // é¢è§ççªå£çz-indexï¼é»è®¤æ¯ 20002ï¼æ¤å¼è¦é«ä¸äºï¼è¿æ¶åå°é¢è§æ¨¡å¼æ¯å¦æ¾ç¤ºå¨æä¸é¢ï¼ |
| | | // previewBeforeOpenCallback() {}, // é¢è§çªå£æå¼ä¹åçcallbackï¼å¼å¯é¢è§æ¨¡å¼è°ç¨ï¼ |
| | | // previewOpenCallback() {}, // é¢è§çªå£æå¼ä¹åçcallbackï¼å¼å¯é¢è§æ¨¡å¼è°ç¨ï¼ |
| | | // beforeOpenCallback() {}, // å¼å¯æå°åçåè°äºä»¶ |
| | | // openCallback() {}, // è°ç¨æå°ä¹åçåè°äºä»¶ |
| | | // closeCallback() {}, // å
³éæå°çåè°äºä»¶ï¼æ æ³ç¡®å®ç¹å»çæ¯ç¡®è®¤è¿æ¯åæ¶ï¼ |
| | | // url: '', |
| | | // standard: '', |
| | | // extraCss: '' |
| | | }, |
| | | tableData: [{ |
| | | date: '2016-05-02', |
| | | name: 'çå°è', |
| | | address: '䏿µ·å¸æ®éåºéæ²æ±è·¯ 1518 å¼' |
| | | }, { |
| | | date: '2016-05-04', |
| | | name: 'çå°è', |
| | | address: '䏿µ·å¸æ®éåºéæ²æ±è·¯ 1517 å¼' |
| | | }, { |
| | | date: '2016-05-01', |
| | | name: 'çå°è', |
| | | address: '䏿µ·å¸æ®éåºéæ²æ±è·¯ 1519 å¼' |
| | | }, { |
| | | date: '2016-05-03', |
| | | name: 'çå°è', |
| | | address: '䏿µ·å¸æ®éåºéæ²æ±è·¯ 1516 å¼' |
| | | }], |
| | | printContentObj: {} |
| | | } |
| | | }, |
| | | mounted() { |
| | | // this.TestClick() |
| | | |
| | | // function window_onload() { |
| | | //* è¿å¥ç¹å«éè¦*ï¼åªæå¨WEBæ¥è¡¨å®¢æ·ç«¯ç¨åºåï¼æè½è¿è¡WebSocketé讯 |
| | | // 妿WEBæ¥è¡¨å®¢æ·ç«¯ç¨åºä¸ºå¼æºèªå¯å¨ï¼ä»¥ä¸è°ç¨åºè¯¥å»æãæ´å¤è¯´æè¯·åè帮å©âWEBæ¥è¡¨(B/Sæ¥è¡¨)->WEBæ¥è¡¨å®¢æ·ç«¯->é¨ç½²ä¸å®è£
âé¨åä¸ä¸è°·æChromeæµè§å¨çç¸å
³è¯´æ |
| | | webapp_urlprotocol_startup() // å¯å¨WEBæ¥è¡¨å®¢æ·ç«¯ç¨åºï¼ä»¥ä¾¿ä¾¦å¬æ¥å WebSocket æ°æ® |
| | | // } |
| | | // this.$nextTick(() => { |
| | | // this.bindQRCode() |
| | | // }) |
| | | }, |
| | | methods: { |
| | | click() { |
| | | this.shows = true |
| | | this.$refs.importPickerFunc.newDataFunc() |
| | | // addWatermark() { |
| | | // if (this.firstWatermark) { |
| | | // console.log(this.firstWatermark) |
| | | // this.$watermark.set('å¯è¿ªå¶é ', this.$refs.watermark) |
| | | // this.firstWatermark = false |
| | | // } |
| | | // }, |
| | | clickMe() { |
| | | // this.dialogVisible = true |
| | | // this.$nextTick(() => { |
| | | // this.bindQRCode() |
| | | // this.addWatermark() |
| | | // console.log(document.getElementById('column0').style.width = '200px', 0) |
| | | // console.log(document.getElementById('column7'), 7) |
| | | // console.log(document.getElementById('table'), 2) |
| | | // console.log(document.getElementById('table').getElementsByTagName('el-table'), 1) |
| | | // }) |
| | | this.dialogVisible = true |
| | | }, |
| | | colos() { |
| | | this.shows = false |
| | | // bindQRCode() { |
| | | // if (this.firstbindQRCode) { |
| | | // const text = 'PO202206280001;Step02' |
| | | // new QRCode(this.$refs.qrCodeDiv2, { |
| | | // // text: 'Vueå®ç°çæäºç»´ç ï¼', |
| | | // text: text, |
| | | // width: 80, |
| | | // height: 80, |
| | | // colorDark: '#333333', // äºç»´ç é¢è² |
| | | // colorLight: '#ffffff', // äºç»´ç èæ¯è² |
| | | // correctLevel: QRCode.CorrectLevel.L// 容éçï¼L/M/H |
| | | // }) |
| | | // this.firstbindQRCode = false |
| | | // } |
| | | // }, |
| | | async TestClick() { |
| | | const data = { |
| | | mesordercode: 'PO202206280001_4', |
| | | username: getCookie('admin') |
| | | } |
| | | // const res = await MesOrderPrintSearch(data) |
| | | const res = await MesOrderPrintSearch1(data) |
| | | console.log(res, 1) |
| | | }, |
| | | ws_ajax_preview() { |
| | | // åæ°å
·ä½è¯´æè¯·åèå¸®å©ææ¡£ä¸çâWEBæ¥è¡¨(B/Sæ¥è¡¨)->WEBæ¥è¡¨å®¢æ·ç«¯->å¯å¨åæ°è¯´æâé¨å |
| | | var args = { |
| | | type: 'preview', |
| | | showOptionDlg: true, |
| | | report: urlAddRandomNo('../grf/æ¥å·¥äº§åºæ ç¾.grf'), |
| | | |
| | | // report: urlAddRandomNo('https://www.gridreport.cn/demos/grf/1a.grf'), |
| | | // data: 'http://www.gridreport.cn/demos/data/DataCenter.ashx?data=Customer' |
| | | data: |
| | | { |
| | | 'recordset': [ |
| | | { |
| | | 'wo_code': 'PO202206280001_1', |
| | | 'partcode': '1403-001-0001', |
| | | 'partname': 'åé¢F45MnVSÏ20', |
| | | 'qty': '100', |
| | | 'next_stepname': 'æµè¯å·¥åº2', |
| | | 'qrcode': 'PO202206280001_1;Step02' |
| | | }, |
| | | { |
| | | 'wo_code': 'PO202206280001_1', |
| | | 'partcode': '1403-001-0001', |
| | | 'partname': 'åé¢F45MnVSÏ20', |
| | | 'qty': '100', |
| | | 'next_stepname': 'æµè¯å·¥åº2', |
| | | 'qrcode': 'PO202206280001_1;Step02' |
| | | } |
| | | ] |
| | | } |
| | | |
| | | } |
| | | console.log(args) |
| | | webapp_ws_ajax_run(args) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style media="print"> |
| | | /*@media print {*/ |
| | | @page { |
| | | /*size: auto;*/ |
| | | size: auto; |
| | | margin: 3mm; |
| | | /*margin: 0mm;*/ |
| | | /*padding: 0;*/ |
| | | } |
| | | |
| | | /*}*/ |
| | | /*.elTable {*/ |
| | | |
| | | /*::v-deep .el-table {*/ |
| | | /* margin-top: 10px;*/ |
| | | /*}*/ |
| | | /*table {*/ |
| | | /* width: 100% !important;*/ |
| | | /*}*/ |
| | | |
| | | /*.el-table__body,*/ |
| | | /*.el-table__header {*/ |
| | | /* width: 100% !important;*/ |
| | | /*}*/ |
| | | |
| | | /*.el-table__body {*/ |
| | | /* width: 100% !important;*/ |
| | | /*}*/ |
| | | |
| | | /*}*/ |
| | | |
| | | /*/deep/.el-table__body-wrapper::-webkit-scrollbar{*/ |
| | | /* width: 0;*/ |
| | | /*}*/ |
| | | </style> |
| | | |