| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="500px" |
| | | :padding="15" |
| | | title="æå°" |
| | | > |
| | | <vol-box v-model="showDetialBox" :lazy="true" width="500px" :padding="15" title="æå°"> |
| | | <!-- æå°ä¸ç¨å®¹å¨ --> |
| | | <div id="printContainer" style="display:none"> |
| | | <div style="text-align:center;margin-bottom:15px"> |
| | |
| | | |
| | | <template #footer> |
| | | <el-button type="primary" size="small" @click="print">æå°</el-button> |
| | | <el-button type="danger" size="small" @click="showDetialBox = false" |
| | | >å
³é</el-button |
| | | > |
| | | <el-button type="danger" size="small" @click="showDetialBox = false">å
³é</el-button> |
| | | </template> |
| | | </vol-box> |
| | | </div> |
| | |
| | | async print() { |
| | | // å建æå°çªå£ |
| | | const printWindow = window.open("", "æå°", "width=1200,height=800"); |
| | | |
| | | |
| | | // æå»ºæå°å
容 |
| | | const printContent = ` |
| | | <html> |
| | |
| | | </body> |
| | | </html> |
| | | `; |
| | | |
| | | |
| | | printWindow.document.write(printContent); |
| | | printWindow.document.close(); |
| | | |
| | | |
| | | // å»¶è¿ç¡®ä¿å
容å è½½å®æ |
| | | setTimeout(() => { |
| | | printWindow.focus(); |
| | | printWindow.print(); |
| | | |
| | | |
| | | // æå°å®æåå
³éçªå£å¹¶æ´æ°ç¶æ |
| | | printWindow.onafterprint = () => { |
| | | this.updatePrintStatus(); |
| | |
| | | { printCode: this.palletCode }, |
| | | { loadingText: "æ°æ®å¤çä¸" } |
| | | ); |
| | | |
| | | |
| | | if (response.status) { |
| | | this.$message.success("æä½æå"); |
| | | this.$parent.refresh(); |