|
@@ -14,6 +14,7 @@ import { ServiceDetailContent } from '../service-detail/ServiceDetailContent'
|
|
|
import { ImageCarousel } from '../service-detail/ImageCarousel'
|
|
import { ImageCarousel } from '../service-detail/ImageCarousel'
|
|
|
import { ShareDialog } from '../service-detail/ShareDialog'
|
|
import { ShareDialog } from '../service-detail/ShareDialog'
|
|
|
import { NotifyCustomerDialog } from '@/components/notify-customer-dialog'
|
|
import { NotifyCustomerDialog } from '@/components/notify-customer-dialog'
|
|
|
|
|
+import { PdfPreviewDialog } from '@/components/pdf-preview-dialog'
|
|
|
import { InventoryPickerDialog } from '../service-edit/InventoryPickerDialog'
|
|
import { InventoryPickerDialog } from '../service-edit/InventoryPickerDialog'
|
|
|
import { BarcodeScannerDialog } from '@/components/barcode-scanner-dialog'
|
|
import { BarcodeScannerDialog } from '@/components/barcode-scanner-dialog'
|
|
|
import { useHardwareScanner } from '@/hooks/use-hardware-scanner'
|
|
import { useHardwareScanner } from '@/hooks/use-hardware-scanner'
|
|
@@ -213,6 +214,7 @@ export function ServicePageClient({
|
|
|
'waiting-parts': SETTING_KEYS.SMS_TEMPLATE_STATUS_WAITING_PARTS,
|
|
'waiting-parts': SETTING_KEYS.SMS_TEMPLATE_STATUS_WAITING_PARTS,
|
|
|
completed: SETTING_KEYS.SMS_TEMPLATE_STATUS_READY,
|
|
completed: SETTING_KEYS.SMS_TEMPLATE_STATUS_READY,
|
|
|
}
|
|
}
|
|
|
|
|
+ const [showPdfPreview, setShowPdfPreview] = useState(false)
|
|
|
const [showNotifyDialog, setShowNotifyDialog] = useState(false)
|
|
const [showNotifyDialog, setShowNotifyDialog] = useState(false)
|
|
|
const [notifyMessage, setNotifyMessage] = useState('')
|
|
const [notifyMessage, setNotifyMessage] = useState('')
|
|
|
|
|
|
|
@@ -357,6 +359,12 @@ export function ServicePageClient({
|
|
|
if (formState.hasUnsavedChanges) await actions.saveNow()
|
|
if (formState.hasUnsavedChanges) await actions.saveNow()
|
|
|
actions.handleDownloadPDF()
|
|
actions.handleDownloadPDF()
|
|
|
}}
|
|
}}
|
|
|
|
|
+ onPreviewPDF={async () => {
|
|
|
|
|
+ // No expired-dates prompt here: previewing is just looking, and the
|
|
|
|
|
+ // check still runs on download, email, and share.
|
|
|
|
|
+ if (formState.hasUnsavedChanges) await actions.saveNow()
|
|
|
|
|
+ setShowPdfPreview(true)
|
|
|
|
|
+ }}
|
|
|
onDelete={actions.handleDelete}
|
|
onDelete={actions.handleDelete}
|
|
|
onShowEmail={async () => {
|
|
onShowEmail={async () => {
|
|
|
if (!(await checkDates())) return
|
|
if (!(await checkDates())) return
|
|
@@ -554,6 +562,12 @@ export function ServicePageClient({
|
|
|
onChangeIndex={actions.setCarouselIndex}
|
|
onChangeIndex={actions.setCarouselIndex}
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
|
|
+ <PdfPreviewDialog
|
|
|
|
|
+ open={showPdfPreview}
|
|
|
|
|
+ onOpenChange={setShowPdfPreview}
|
|
|
|
|
+ url={`/api/protected/services/${record.id}/pdf`}
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
<SendEmailDialog
|
|
<SendEmailDialog
|
|
|
open={actions.showEmailDialog}
|
|
open={actions.showEmailDialog}
|
|
|
onOpenChange={actions.setShowEmailDialog}
|
|
onOpenChange={actions.setShowEmailDialog}
|