|
|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
- <AidopDemoShell :title="pageTitle" subtitle="供应商发货单">
|
|
|
+ <div class="s4-shipment-page">
|
|
|
+ <AidopDemoShell :title="pageTitle" subtitle="供应商发货单">
|
|
|
<el-form :inline="true" :model="query" class="mb12" @submit.prevent>
|
|
|
<el-form-item label="发货日期">
|
|
|
<el-date-picker v-model="query.jhshrqFrom" type="date" value-format="YYYY-MM-DD" style="width: 150px" />
|
|
|
@@ -77,7 +78,10 @@
|
|
|
@size-change="loadList"
|
|
|
/>
|
|
|
</div>
|
|
|
- </AidopDemoShell>
|
|
|
+ </AidopDemoShell>
|
|
|
+
|
|
|
+ <printDialog ref="printDialogRef" :title="'打印送货标签'" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="aidopS4SupplierShipmentList">
|
|
|
@@ -96,7 +100,7 @@ import { formatDate } from '/@/utils/formatTime';
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
const pageTitle = computed(() => (route.meta?.title as string) || '供应商发货单');
|
|
|
-const printDialogRef = ref();
|
|
|
+const printDialogRef = ref<{ showDialog: (...args: any[]) => void } | null>(null);
|
|
|
const PRINT_LABEL_TEMPLATE_NAME = '送货标签';
|
|
|
|
|
|
const query = reactive({
|
|
|
@@ -223,7 +227,12 @@ async function onPrintLabel(row: SupplierShipmentRow) {
|
|
|
...(items[0] ?? {}),
|
|
|
};
|
|
|
|
|
|
- printDialogRef.value.showDialog(new hiprint.PrintTemplate({ template }), printData, template.panels[0].width);
|
|
|
+ const dialog = printDialogRef.value;
|
|
|
+ if (!dialog?.showDialog) {
|
|
|
+ ElMessage.error('打印预览组件加载失败');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dialog.showDialog(new hiprint.PrintTemplate({ template }), printData, template.panels[0].width);
|
|
|
}
|
|
|
|
|
|
function onExport() {
|
|
|
@@ -251,6 +260,3 @@ onMounted(loadList);
|
|
|
.pager { margin-top: 12px; display: flex; justify-content: flex-end; }
|
|
|
:deep(.row-deleted .el-table__cell) { background: #ffe7e7 !important; }
|
|
|
</style>
|
|
|
-
|
|
|
-<printDialog ref="printDialogRef" :title="'打印送货标签'" />
|
|
|
-
|