Merge remote-tracking branch 'origin/master'
| | |
| | | :loading="cardLoading" |
| | | :bordered="false" |
| | | title="å·¥å
·ä¿¡æ¯" |
| | | style="height: 100%;" |
| | | > |
| | | <a-spin :spinning="loading"> |
| | | <a-alert |
| | |
| | | /> |
| | | |
| | | <!-- showLine --> |
| | | <div style="flex: 1;overflow:auto;margin-top: 10px;max-height: 400px; min-height: 400px"> |
| | | <a-tree |
| | | :checkStrictly="checkStrictly" |
| | | |
| | | :selectedKeys="selectedKeys" |
| | | :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" |
| | | :treeData="treeDataSource" |
| | | |
| | | :defaultExpandAll="true" |
| | | @select="onSelect" |
| | | @expand="onExpand" |
| | |
| | | |
| | | </template> |
| | | </a-tree> |
| | | </div> |
| | | |
| | | </a-spin> |
| | | </a-card> |
| | | </template> |
| | |
| | | this.expandedKeys = this.allTreeKeys; |
| | | }, |
| | | closeAll() { |
| | | this.expandedKeys = this.allSiteIds; |
| | | this.expandedKeys = []; |
| | | }, |
| | | refreshTree() { |
| | | this.queryTreeData(); |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <a-card :bordered="false" style="flex: 1;overflow:auto;max-height: 600px; min-height: 600px"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | |
| | | /* å页忰 */ |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '50'], |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | |
| | | this.selectedRowKeys[0] = res.result.records[0].id |
| | | this.onSelectChange(this.selectedRowKeys) |
| | | } else { |
| | | this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | //this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | this.ipagination.total = 0 |
| | | } |
| | | }) |
| | |
| | | this.loading = false; |
| | | }); |
| | | } else { |
| | | this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | //this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | |
| | | :loading="cardLoading" |
| | | :bordered="false" |
| | | title="å·¥å
·åç±»" |
| | | style="height: 100%;" |
| | | > |
| | | <a-spin :spinning="loading"> |
| | | <a-alert |
| | |
| | | /> |
| | | |
| | | <!-- showLine --> |
| | | <div style="flex: 1;overflow:auto;margin-top: 10px;max-height: 400px; min-height: 400px"> |
| | | <a-tree |
| | | :checkStrictly="checkStrictly" |
| | | |
| | |
| | | |
| | | </template> |
| | | </a-tree> |
| | | </div> |
| | | </a-spin> |
| | | </a-card> |
| | | </template> |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <a-card :bordered="false" style="flex: 1;overflow:auto;max-height: 600px; min-height: 600px"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | |
| | | /* å页忰 */ |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '50'], |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | |
| | | this.selectedRowKeys[0] = res.result.records[0].id |
| | | this.onSelectChange(this.selectedRowKeys) |
| | | } else { |
| | | this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | //this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | this.ipagination.total = 0 |
| | | } |
| | | }) |
| | |
| | | this.loading = false; |
| | | }); |
| | | } else { |
| | | this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | //this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | } |
| | | }, |
| | | onClearSelected() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card> |
| | | <!-- æä½æé® --> |
| | | <a-button type="primary" @click="handlePrint">çæå¹¶æå°äºç»´ç </a-button> |
| | | <a-button @click="handleBatchGenerate">æ¹éçæäºç»´ç </a-button> |
| | | |
| | | <!-- éèçæå°åºå --> |
| | | <div id="printContainer" v-show="false"> |
| | | <img :src="qrData.image" alt="äºç»´ç " style="width: 5cm; height: 5cm;"> |
| | | <div style="margin-top: 10px; font-size: 16px;" class="qr-content">{{ qrData.content }}</div> |
| | | </div> |
| | | |
| | | <div id="printArea" style="display: block;"> |
| | | <div v-for="(item, index) in qrList" :key="index" class="qrcode-item"> |
| | | <img :src="item.base64" alt="QR Code"> |
| | | <p>{{ item.content }}</p> |
| | | </div> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction } from '@/api/manage' |
| | | import printJS from 'print-js'; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | qrData: { |
| | | image: '', |
| | | content: '' |
| | | }, |
| | | qrList: [] |
| | | } |
| | | }, |
| | | methods: { |
| | | // çæå¹¶æå°äºç»´ç |
| | | handlePrint() { |
| | | |
| | | getAction('/tms/qyCode/generate').then(res => { |
| | | if (res.success) { |
| | | this.qrData = res.result; |
| | | // ç¡®ä¿DOMæ´æ°åæ§è¡æå° |
| | | this.$nextTick(() => { |
| | | this.printQrCode(); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // æ§è¡æå°æä½ |
| | | printQrCode() { |
| | | // 1. å建æå°å
容 |
| | | const printContent = document.getElementById('printContainer').innerHTML; |
| | | |
| | | // 2. å建æå°çªå£ |
| | | const printWindow = window.open('', '_blank'); |
| | | |
| | | // 3. åå
¥æå°å
容 |
| | | printWindow.document.write(` |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <title>äºç»´ç æå°</title> |
| | | <style> |
| | | body { |
| | | margin: 0; |
| | | padding: 0; |
| | | font-family: Arial, sans-serif; |
| | | } |
| | | @media print { |
| | | @page { |
| | | size: auto; |
| | | margin: 0; |
| | | } |
| | | body { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .qr-label { |
| | | width: 60mm; |
| | | height: 40mm; |
| | | padding: 2mm; |
| | | box-sizing: border-box; |
| | | border: 1px dotted #ccc; /* æå°æ¶ä¸ä¼æ¾ç¤º */ |
| | | text-align: center; |
| | | } |
| | | .qr-image { |
| | | width: 30mm; |
| | | height: 30mm; |
| | | display: block; |
| | | margin: 0 auto; |
| | | } |
| | | .qr-content { |
| | | font-size: 10pt; |
| | | margin-top: 1mm; |
| | | word-break: break-all; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | ${printContent} |
| | | <script> |
| | | // èªå¨è§¦åæå°å¹¶å
³éçªå£ |
| | | window.onload = function() { |
| | | setTimeout(function() { |
| | | window.print(); |
| | | window.onafterprint = function() { |
| | | window.close(); |
| | | }; |
| | | // å
¼å®¹Safari |
| | | if (window.matchMedia) { |
| | | const mediaQueryList = window.matchMedia('print'); |
| | | mediaQueryList.addListener(function(mql) { |
| | | if (!mql.matches) { |
| | | setTimeout(function() { |
| | | window.close(); |
| | | }, 300); |
| | | } |
| | | }); |
| | | } |
| | | }, 100); |
| | | }; |
| | | <\/script> |
| | | </body> |
| | | </html> |
| | | `); |
| | | |
| | | printWindow.document.close(); |
| | | }, |
| | | |
| | | // æ¹éçæäºç»´ç |
| | | async handleBatchGenerate() { |
| | | getAction('/tms/qyCode/batchGenerate').then(res => { |
| | | if (res.success) { |
| | | this.qrList = res.result.map((content, i) => ({ |
| | | content:res.result[i].content, |
| | | base64: res.result[i].image |
| | | })); |
| | | this.handleBacthPrint(); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ§è¡æå° |
| | | handleBacthPrint() { |
| | | this.$nextTick(() => { |
| | | printJS({ |
| | | printable: 'printArea', |
| | | type: 'html', |
| | | style: ` |
| | | .qrcode-item { |
| | | page-break-inside: avoid; |
| | | margin: 10px; |
| | | text-align: center; |
| | | } |
| | | img { width: 100px; height: 100px; } |
| | | `, |
| | | scanStyles: false |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | :loading="cardLoading" |
| | | :bordered="false" |
| | | title="å·¥å
·ä¿¡æ¯" |
| | | style="height: 100%;" |
| | | > |
| | | <a-spin :spinning="loading"> |
| | | <a-alert |
| | |
| | | /> |
| | | |
| | | <!-- showLine --> |
| | | <div style="flex: 1;overflow:auto;margin-top: 10px;max-height: 400px; min-height: 400px"> |
| | | <a-tree |
| | | :checkStrictly="checkStrictly" |
| | | |
| | |
| | | |
| | | </template> |
| | | </a-tree> |
| | | </div> |
| | | </a-spin> |
| | | </a-card> |
| | | </template> |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <a-card :bordered="false" style="flex: 1;overflow:auto;max-height: 600px; min-height: 600px"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | |
| | | /* å页忰 */ |
| | | ipagination:{ |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '50'], |
| | | pageSize: 5, |
| | | pageSizeOptions: ['5', '10', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + "-" + range[1] + " å
±" + total + "æ¡" |
| | | }, |
| | |
| | | onSelectChange(selectedRowKeys,selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows |
| | | console.log("22222",selectedRowKeys) |
| | | //éè¿idæ¥è¯¢ç®¡çåæ°ååæ°æ°æ® |
| | | getAction(this.url.queryParaByToolCode, { toolCode: this.selectedRowKeys[0],paraTypeFlag:this.paraTypeFlag}).then((res) => { |
| | | if (res.success) { |
| | |
| | | this.ipagination.total = res.result.total |
| | | //é»è®¤éä¸ç¬¬ä¸æ¡æ°æ® |
| | | this.selectedRowKeys[0] = res.result.records[0].id |
| | | this.onSelectChange(this.selectedRowKeys) |
| | | this.onSelectChange(this.selectedRowKeys,this.selectionRows) |
| | | console.log("1111111",this.selectedRowKeys,this.selectionRows) |
| | | } else { |
| | | this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | //this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | this.ipagination.total = 0 |
| | | } |
| | | }) |
| | |
| | | this.loading = false; |
| | | }); |
| | | } else { |
| | | this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | // this.$message.warning("è¯·éæ©å¶åèç¹è¿è¡æ¥è¯¢"); |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | |
| | | }, |
| | | submitForm () { |
| | | const that = this; |
| | | console.log("111",this.model.id) |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |