|
@@ -7,7 +7,6 @@ const attachmentData = ref([
|
|
|
typeList: [
|
|
typeList: [
|
|
|
{
|
|
{
|
|
|
label: 'Customs Documents',
|
|
label: 'Customs Documents',
|
|
|
- number: 2,
|
|
|
|
|
attachmentList: [
|
|
attachmentList: [
|
|
|
{ name: 'Commercial Invoice1.pdf', isSelect: false },
|
|
{ name: 'Commercial Invoice1.pdf', isSelect: false },
|
|
|
{ name: 'Packing List1.pdf', isSelect: false },
|
|
{ name: 'Packing List1.pdf', isSelect: false },
|
|
@@ -16,12 +15,10 @@ const attachmentData = ref([
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: 'House Bill of Lading',
|
|
label: 'House Bill of Lading',
|
|
|
- number: 1,
|
|
|
|
|
attachmentList: [{ name: 'Commercial Invoice1.pdf', isSelect: false }]
|
|
attachmentList: [{ name: 'Commercial Invoice1.pdf', isSelect: false }]
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: 'Master Bill of Lading',
|
|
label: 'Master Bill of Lading',
|
|
|
- number: 1,
|
|
|
|
|
attachmentList: [{ name: 'Commercial Invoice1.pdf', isSelect: false }]
|
|
attachmentList: [{ name: 'Commercial Invoice1.pdf', isSelect: false }]
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -33,7 +30,6 @@ const attachmentData = ref([
|
|
|
typeList: [
|
|
typeList: [
|
|
|
{
|
|
{
|
|
|
label: 'Customs Documents',
|
|
label: 'Customs Documents',
|
|
|
- number: 2,
|
|
|
|
|
attachmentList: [
|
|
attachmentList: [
|
|
|
{ name: 'Commercial Invoice.pdf', isSelect: false },
|
|
{ name: 'Commercial Invoice.pdf', isSelect: false },
|
|
|
{ name: 'Packing List.pdf', isSelect: false },
|
|
{ name: 'Packing List.pdf', isSelect: false },
|
|
@@ -42,12 +38,10 @@ const attachmentData = ref([
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: 'House Bill of Lading',
|
|
label: 'House Bill of Lading',
|
|
|
- number: 1,
|
|
|
|
|
attachmentList: [{ name: 'Commercial Invoice.pdf', isSelect: false }]
|
|
attachmentList: [{ name: 'Commercial Invoice.pdf', isSelect: false }]
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: 'Master Bill of Lading',
|
|
label: 'Master Bill of Lading',
|
|
|
- number: 1,
|
|
|
|
|
attachmentList: [{ name: 'Commercial Invoice.pdf', isSelect: false }]
|
|
attachmentList: [{ name: 'Commercial Invoice.pdf', isSelect: false }]
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -65,7 +59,6 @@ const attachmentData = ref([
|
|
|
typeList: [
|
|
typeList: [
|
|
|
{
|
|
{
|
|
|
label: 'Customs Documents',
|
|
label: 'Customs Documents',
|
|
|
- number: 2,
|
|
|
|
|
attachmentList: [
|
|
attachmentList: [
|
|
|
{ name: 'Commercial Invoice2.pdf', isSelect: false },
|
|
{ name: 'Commercial Invoice2.pdf', isSelect: false },
|
|
|
{ name: 'Packing List2.pdf', isSelect: false },
|
|
{ name: 'Packing List2.pdf', isSelect: false },
|
|
@@ -147,33 +140,7 @@ const initShipments = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
initShipments()
|
|
initShipments()
|
|
|
-const summaryList = ref([
|
|
|
|
|
- {
|
|
|
|
|
- label: 'Customs Documents',
|
|
|
|
|
- number: 8,
|
|
|
|
|
- attachmentList: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'Commercial InvoiceCommercial InvoiceCommercial InvoiceCommercial Invoice.pdf'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'Packing List.pdf'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'Certificate of Origin.pdf'
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: 'House Bill of Lading',
|
|
|
|
|
- number: 4,
|
|
|
|
|
- attachmentList: [{ name: 'Commercial Invoice.pdf' }]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: 'Master Bill of Lading',
|
|
|
|
|
- number: 4,
|
|
|
|
|
- attachmentList: [{ name: 'Commercial Invoice.pdf' }]
|
|
|
|
|
- }
|
|
|
|
|
-])
|
|
|
|
|
|
|
+const summaryList = ref([])
|
|
|
const allChooseFiles = computed(() => {
|
|
const allChooseFiles = computed(() => {
|
|
|
return summaryList.value.reduce((acc, curr) => {
|
|
return summaryList.value.reduce((acc, curr) => {
|
|
|
acc += curr.attachmentList.length
|
|
acc += curr.attachmentList.length
|
|
@@ -223,6 +190,26 @@ watch(
|
|
|
},
|
|
},
|
|
|
{ deep: true }
|
|
{ deep: true }
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
|
|
+const handleDownload = (row: any) => {
|
|
|
|
|
+ // 如果from_system的值是TOPOCEAN_KSMART,不需要拼接url
|
|
|
|
|
+ const url =
|
|
|
|
|
+ row.from_system === 'TOPOCEAN_KSMART'
|
|
|
|
|
+ ? row.file?.url
|
|
|
|
|
+ : import.meta.env.VITE_API_HOST + '/' + row.file?.url
|
|
|
|
|
+ // const url = row.file?.url
|
|
|
|
|
+ // 创建一个隐藏的 <a> 标签
|
|
|
|
|
+ const link = document.createElement('a')
|
|
|
|
|
+ link.href = url
|
|
|
|
|
+
|
|
|
|
|
+ // 指定下载文件名(可选)
|
|
|
|
|
+ link.download = row.file?.file_name || 'file'
|
|
|
|
|
+
|
|
|
|
|
+ // 添加到 DOM 中,触发点击事件,然后移除
|
|
|
|
|
+ document.body.appendChild(link)
|
|
|
|
|
+ link.click()
|
|
|
|
|
+ document.body.removeChild(link)
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -249,7 +236,9 @@ watch(
|
|
|
v-for="typeItem in attItem?.typeList"
|
|
v-for="typeItem in attItem?.typeList"
|
|
|
:key="typeItem.label"
|
|
:key="typeItem.label"
|
|
|
>
|
|
>
|
|
|
- <div class="type-label">{{ typeItem.label }} ({{ typeItem.number }})</div>
|
|
|
|
|
|
|
+ <div class="type-label">
|
|
|
|
|
+ {{ typeItem.label }} ({{ typeItem.attachmentList.length }})
|
|
|
|
|
+ </div>
|
|
|
<div class="type-attachment-list">
|
|
<div class="type-attachment-list">
|
|
|
<div
|
|
<div
|
|
|
class="attachment-file"
|
|
class="attachment-file"
|