备货单 打印预览 添加 内勤查看数据

This commit is contained in:
浅念
2025-12-09 15:02:43 +08:00
parent 65b2cb1037
commit 15e86e0f4f
2 changed files with 95 additions and 0 deletions
+47
View File
@@ -166,6 +166,13 @@
style="flex: 1; width: 100%; border: 1px solid #eee; border-radius: 6px"
/>
</div>
<div class="inter-view">
<InternalStaffViews
v-model:visible="pdf.visible"
:vehicle-data="nqData"
:default-currency="nqCurrency"
/>
</div>
</el-dialog>
<el-dialog
v-model="timelineDialogVisible"
@@ -193,6 +200,9 @@
import ApprovalTimeline from '@/components/custom/ApprovalTimeline.vue'
import { manageService } from '@/api/adminApi'
import FilePreview from '@/components/custom/FilePreview.vue'
import InternalStaffViews from '@/components/custom/InternalStaffViews.vue'
const nqCurrency = ref('')
const nqData = ref<any[]>([])
const timelineDialogVisible = ref(false)
const isFinites = ref(false)
const approvalRecords = ref<any[]>([])
@@ -293,6 +303,36 @@
console.log(err)
})
}
const handleViewnq = async (row: any) => {
const res = await manageService.checkStock({ id: row.id })
// 默认币种来自 currency_symbol
if (res?.currency_symbol) {
nqCurrency.value = res.currency_symbol
} else {
nqCurrency.value = 'USD'
}
const list = Array.isArray(res?.veh_list) ? res.veh_list : []
nqData.value = list.map((it: any) => ({
model_snapshot: it.model_snapshot,
qty: 1,
clearance_price: it.clearance_price,
clearance_price_currency: it.clearance_price?.currency || it.clearance_price_currency,
fob_transport_fee: it.fob_transport_fee,
fob_fee_currency: it.fob_transport_fee?.currency || it.fob_fee_currency,
car_price: it.car_price,
car_price_currency: it.car_price?.currency || it.car_price_currency,
ocean_freight: it.ocean_freight,
ocean_freight_currency: it.ocean_freight?.currency || it.ocean_freight_currency,
commission: it.commission,
commission_currency: it.commission?.currency || it.commission_currency,
retention_price: it.retention_price,
retention_price_currency: it.retention_price?.currency || it.retention_price_currency,
port_misc_fee: it.port_misc_fee,
port_fee_currency: it.port_misc_fee?.currency || it.port_fee_currency,
model: it.model_snapshot
}))
// nqDialogVisible.value = true
}
// PDF 预览/打印(公共)
const { pdf, frameRef, openWithResponse, download, preparePreview, prepareImages } =
usePdfPreview()
@@ -303,6 +343,7 @@
} else {
isFinites.value = false
}
handleViewnq(row)
CrmService.printStock({ id: row.id })
.then((res) => {
openWithResponse(res)
@@ -503,4 +544,10 @@
word-break: break-all;
max-width: 100%;
}
.inter-view {
margin-top: 10px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 10px;
}
</style>
@@ -207,6 +207,13 @@
style="flex: 1; width: 100%; border: 1px solid #eee; border-radius: 6px"
/>
</div>
<div class="inter-view">
<InternalStaffViews
v-model:visible="pdf.visible"
:vehicle-data="nqData"
:default-currency="nqCurrency"
/>
</div>
</el-dialog>
<!-- 订单详情弹窗(使用公共内容组件) -->
@@ -261,9 +268,12 @@
import OrderDetailContent from '@/components/custom/OrderDetailContent.vue'
import type { OrderData } from '@/composables/useOrderDetailDialog'
import ApprovalTimeline from '@/components/custom/ApprovalTimeline.vue'
import InternalStaffViews from '@/components/custom/InternalStaffViews.vue'
import FilePreview from '@/components/custom/FilePreview.vue'
import { usePdfPreview } from '@/composables/usePdfPreview'
import { manageService } from '@/api/adminApi'
const nqCurrency = ref('')
const nqData = ref<any[]>([])
const timelineDialogVisible = ref(false)
const approvalRecords = ref<any[]>([])
const isFinites = ref(false)
@@ -462,6 +472,37 @@
.catch((err) => {
console.log(err)
})
}
const handleViewnq = async (row: any) => {
const res = await manageService.checkStock({ id: row.id })
// 设置默认币种为数据中的 currency_symbol
if (res?.currency_symbol) {
nqCurrency.value = res.currency_symbol
} else {
nqCurrency.value = 'USD' // 兜底默认值
}
// 取车辆明细列表作为行
const list = Array.isArray(res?.veh_list) ? res.veh_list : []
nqData.value = list.map((it: any) => ({
model_snapshot: it.model_snapshot,
qty: 1,
clearance_price: it.clearance_price,
clearance_price_currency: it.clearance_price?.currency || it.clearance_price_currency,
fob_transport_fee: it.fob_transport_fee,
fob_fee_currency: it.fob_transport_fee?.currency || it.fob_fee_currency,
car_price: it.car_price,
car_price_currency: it.car_price?.currency || it.car_price_currency,
ocean_freight: it.ocean_freight,
ocean_freight_currency: it.ocean_freight?.currency || it.ocean_freight_currency,
commission: it.commission,
commission_currency: it.commission?.currency || it.commission_currency,
retention_price: it.retention_price,
retention_price_currency: it.retention_price?.currency || it.retention_price_currency,
port_misc_fee: it.port_misc_fee,
port_fee_currency: it.port_misc_fee?.currency || it.port_fee_currency,
model: it.model_snapshot
}))
// nqDialogVisible.value = true
}
// PDF 预览/打印(公共)
const { pdf, frameRef, openWithResponse, download, preparePreview, prepareImages } =
@@ -473,6 +514,7 @@
} else {
isFinites.value = false
}
handleViewnq(row)
CrmService.printStock({ id: row.id })
.then((res) => {
openWithResponse(res)
@@ -608,4 +650,10 @@
color: #ff0000;
font-weight: bold;
}
.inter-view {
margin-top: 10px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 10px;
}
</style>