| | |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | | <div style="height: calc(100vh - 208px)"> |
| | | <div style="height: calc(100vh - 168px)"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :data="list" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getData } from "@/api/order"; |
| | | import { printHtml } from "@/utils/print"; |
| | | import { getData, findPlayerAccByOrderId } from "@/api/order"; |
| | | import { printHtml, loadPrintStyle } from "@/utils/print"; |
| | | import { convertCurrency } from "@/utils/ruoyi"; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | created() { |
| | | this.fetchData(); |
| | | // loadPrintStyle(); |
| | | }, |
| | | methods: { |
| | | reloadData() { |
| | |
| | | }, |
| | | handlePrint(row) { |
| | | const orgName = JSON.parse(localStorage.getItem("selectStaff")).org.name; |
| | | row.orgName = orgName; |
| | | |
| | | if (row.payType == "DIRECT") { |
| | | findPlayerAccByOrderId({ orderId: row.id }).then((res) => { |
| | | if (res.data.findPlayerAccByOrderId.length > 0) { |
| | | row.saleStaffName = res.data.findPlayerAccByOrderId[0].staffName; |
| | | } |
| | | |
| | | this.doPrint(row); |
| | | }); |
| | | } else { |
| | | this.doPrint(row); |
| | | } |
| | | }, |
| | | doPrint(row) { |
| | | let detail = ""; |
| | | row.details.forEach((o) => { |
| | | detail += `<tr> |
| | | <td> ${o.voucherName || o.goodsName}</td> |
| | | <td>${o.voucherName || o.goodsName}</td> |
| | | <td>${o.qty} </td> |
| | | <td> ${o.giftQty}</td> |
| | | <td>${o.giftQty || 0}</td> |
| | | <td>${o.amt}</td> |
| | | <td>${row.saleStaff.name} </td> |
| | | </tr>`; |
| | |
| | | |
| | | let printData = `<div style="display: flex; justify-content: center;"> |
| | | <div style="margin-top: 50px; width: 600px;line-height: 2;"> |
| | | <h2 style="text-align: center;">${orgName}缴费收据 </h2> |
| | | <h2 style="text-align: center;">${row.orgName}缴费收据 </h2> |
| | | <div> 订单号:${row.number}</div> |
| | | <div class="div-2-column"> |
| | | <div> 学员姓名:<u>${ |
| | |
| | | <br> |
| | | <br> |
| | | <div class="div-2-column"> |
| | | <div> 经办人:${row.buyer.name} </div> |
| | | <div>经办人:${row.saleStaffName || ""} </div> |
| | | <div>经办日期:${row.createTime} </div> |
| | | </div> |
| | | </div> |
| | | </div>`; |
| | | |
| | | printHtml(printData); |
| | | }, |
| | | showCreate() { |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | <style> |
| | | #print-container { |
| | | display: none; |
| | | } |
| | | @media print { |
| | | body > :not(.print-container) { |
| | | display: none; |
| | | } |
| | | html, |
| | | body { |
| | | display: block !important; |
| | | } |
| | | #print-container { |
| | | display: block; |
| | | } |
| | | } |
| | | @page { |
| | | margin-top: 0; |
| | | margin-bottom: 0; |
| | | } |
| | | .div-2-column { |
| | | display: flex; |
| | | flex-direction: row; |
| | | justify-content: space-between; |
| | | } |
| | | .m-h2 { |
| | | text-align: center; |
| | | font-size: 1.17em; |
| | | margin-top: 50px; |
| | | font-weight: bold; |
| | | } |
| | | #tr { |
| | | height: 30px; |
| | | } |
| | | .txt-center { |
| | | text-align: center; |
| | | } |
| | | </style> |