| | |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">删除</el-button> |
| | | <el-button type="primary" plain @click="handlePrint">打印</el-button> |
| | | <el-button type="primary" plain @click="handleExport">导出送货单</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" |
| | |
| | | 暂无打印数据 |
| | | </div> |
| | | <div v-else |
| | | style="text-align: center; padding: 10px; color: #666; font-size: 16px; background: #e8f4fd; margin-bottom: 10px;"> |
| | | style="text-align: center; padding: 10px; color: #666; font-size: 18px; background: #e8f4fd; margin-bottom: 10px;"> |
| | | 共 {{ printData.length }} 条数据待打印 |
| | | </div> |
| | | <div v-for="(item, index) in printData" :key="index" class="print-page"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <span style="font-size: 20px; margin-top: 5px;">货物详细信息:</span> |
| | | <span style="font-size: 18px; margin-top: 5px;">货物详细信息:</span> |
| | | <div class="table-section"> |
| | | <table class="product-table"> |
| | | <thead> |
| | |
| | | <td>{{ item.salesContractNo || '' }}</td> |
| | | </tr> |
| | | <!-- 添加空白行以确保至少5行 --> |
| | | <tr v-for="n in Math.max(0, 5 - (item.products ? item.products.length : 0))" :key="'empty-' + n" style="height: 25px;"> |
| | | <td style="height: 35px;"></td> |
| | | <td style="height: 35px;"></td> |
| | | <td style="height: 35px;"></td> |
| | | <td style="height: 35px;"></td> |
| | | <td style="height: 35px;"></td> |
| | | <td style="height: 35px;"></td> |
| | | <td style="height: 35px;"></td> |
| | | <tr v-for="n in Math.max(0, 5 - (item.products ? item.products.length : 0))" :key="'empty-' + n"> |
| | | <td> </td> |
| | | <td> </td> |
| | | <td> </td> |
| | | <td> </td> |
| | | <td> </td> |
| | | <td> </td> |
| | | <td> </td> |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | |
| | | </table> |
| | | |
| | | <div style="width: 80px; display: flex; flex-direction: column;"> |
| | | <div style="height: 35px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">共四联</div> |
| | | <div style="height: 35px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">存根</div> |
| | | <div style="height: 35px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">客户</div> |
| | | <div style="height: 35px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">记账</div> |
| | | <div style="height: 35px; text-align: center; display: flex; align-items: center; justify-content: center;">仓库</div> |
| | | <div style="height: 33px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">共四联</div> |
| | | <div style="height: 28px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">存根</div> |
| | | <div style="height: 29px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">客户</div> |
| | | <div style="height: 29px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">记账</div> |
| | | <div style="height: 28px; text-align: center; display: flex; align-items: center; justify-content: center;">仓库</div> |
| | | </div> |
| | | </div> |
| | | <div style="margin: 10px 0; font-size: 20px;"> |
| | | <div style="margin: 10px 0; font-size: 16px;"> |
| | | <span>备注: 贵公司在收货后请即刻核实数量及品质,若有异议,请在3日内提出,否则视为收妥。</span> |
| | | </div> |
| | | <div class="footer"> |
| | |
| | | import FormDialog from '@/components/Dialog/FormDialog.vue'; |
| | | import { getQuotationList } from "@/api/salesManagement/salesQuotation.js"; |
| | | import { |
| | | ledgerListPage, |
| | | productList, |
| | | customerList, |
| | | addOrUpdateSalesLedger, |
| | | getSalesLedgerWithProducts, |
| | | delLedger, |
| | | addOrUpdateSalesLedgerProduct, |
| | | delProduct, |
| | | delLedgerFile, getProductInventory, |
| | | ledgerListPage, |
| | | productList, |
| | | customerList, |
| | | addOrUpdateSalesLedger, |
| | | getSalesLedgerWithProducts, |
| | | delLedger, |
| | | addOrUpdateSalesLedgerProduct, |
| | | delProduct, |
| | | delLedgerFile, getProductInventory, |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | |
| | | }); |
| | | }; |
| | | |
| | | const handleExport = () => { |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("请选择要导出送货单的数据"); |
| | | return; |
| | | } |
| | | |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/sales/ledger/exportShippingNote", {ids: selectedRows.value.map((item) => item.id).join(",")}, "送货单.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | } |
| | | |
| | | // 打印功能 |
| | | const handlePrint = async () => { |
| | | if (selectedRows.value.length === 0) { |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | font-size: 18px; |
| | | line-height: 1.5; |
| | | line-height: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | color: #000; |
| | | } |
| | | .header { |
| | | text-align: center; |
| | | margin-bottom: 8px; |
| | | } |
| | | .company-name { |
| | | font-size: 32px; |
| | | font-size: 30px; |
| | | font-weight: bold; |
| | | margin-bottom: 4px; |
| | | } |
| | | .document-title { |
| | | font-size: 28px; |
| | | font-size: 25px; |
| | | font-weight: bold; |
| | | letter-spacing: 10px; |
| | | } |
| | |
| | | align-items: center; |
| | | } |
| | | .info-row { |
| | | line-height: 26px; |
| | | line-height: 20px; |
| | | } |
| | | .label { |
| | | font-weight: bold; |
| | | min-width: 60px; |
| | | font-size: 20px; |
| | | font-size: 18px; |
| | | } |
| | | .value { |
| | | margin-right: 20px; |
| | | min-width: 80px; |
| | | font-size: 20px; |
| | | font-size: 18px; |
| | | } |
| | | .table-section { |
| | | margin-bottom: 4px; |
| | |
| | | } |
| | | .product-table th, .product-table td { |
| | | border: 1px solid #000; |
| | | padding: 6px; |
| | | padding: 3px; |
| | | text-align: center; |
| | | font-size: 20px; |
| | | line-height: 1.4; |
| | | font-size: 18px; |
| | | line-height: 1.2; |
| | | } |
| | | .product-table th { |
| | | font-size: 20px; |
| | | font-size: 19px; |
| | | font-weight: bold; |
| | | } |
| | | .total-value { |
| | |
| | | margin: 10px 0; |
| | | } |
| | | .sign-section { |
| | | margin-top: 15px; |
| | | margin-top: 10px; |
| | | } |
| | | .footer { |
| | | display: flex; |
| | |
| | | width: 50%; |
| | | } |
| | | .info-row { |
| | | line-height: 26px; |
| | | line-height: 20px; |
| | | } |
| | | .label { |
| | | font-weight: bold; |
| | | min-width: 60px; |
| | | font-size: 20px; |
| | | font-size: 18px; |
| | | } |
| | | .value { |
| | | margin-right: 20px; |
| | | min-width: 80px; |
| | | font-size: 20px; |
| | | font-size: 18px; |
| | | } |
| | | } |
| | | @media print { |
| | |
| | | padding-right: 10mm; |
| | | page-break-inside: avoid; |
| | | page-break-after: always; |
| | | font-size: 20px; |
| | | font-size: 18px; |
| | | } |
| | | .print-page:last-child { |
| | | page-break-after: avoid; |
| | |
| | | th, |
| | | td { |
| | | border: 1px solid #000; |
| | | padding: 6px; |
| | | padding: 3px; |
| | | text-align: center; |
| | | font-size: 16px; |
| | | line-height: 1.4; |