Commit ae9f34c2 by qinjianhui

fix: pod订单下载素材

parent 9f418589
......@@ -7,8 +7,7 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
CardPods: typeof import('./src/components/CardPods.vue')['default']
CardWrapper: typeof import('./src/components/CardWrapper.vue')['default']
CommonCard: typeof import('./src/components/CommonCard.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
......
......@@ -111,6 +111,7 @@ export interface ProductList {
podOrderId?: number | string
isProduction?: boolean
imageAry?: string
productionFileId?: string
}
export interface MemoList {
......
......@@ -20,6 +20,7 @@ export interface SearchForm {
startTime?: string | null
endTime?: string | null
internalMemo?: string
productionFileId?: string
}
export interface CardOrderData {
id: number
......
......@@ -123,6 +123,20 @@
</span>
</div>
<div
v-if="isPod"
:title="item.productionFileId || ''"
class="order-list-expand_item_info_title"
>
<span class="order-list-expand_item_label">素材ID:</span>
<span class="order-list-expand_item_value"
><a
href="javascript:void(0)"
@click="openMaterial(item.productionFileId || '')"
>{{ item.productionFileId || '--' }}</a
>
</span>
</div>
<div
v-if="!isPod"
:title="item.material || ''"
class="order-list-expand_item_info_title"
......@@ -228,7 +242,10 @@ defineProps({
default: false,
},
})
const emit = defineEmits(['openMaterial'])
const openMaterial = (id: string) => {
emit('openMaterial', id)
}
const copy = (text: string) => {
navigator.clipboard.writeText(text)
ElMessage.success('复制成功')
......
......@@ -87,6 +87,14 @@
style="width: 130px"
/>
</ElFormItem>
<ElFormItem label="素材ID">
<ElInput
v-model.trim="searchForm.productionFileId"
placeholder="素材ID"
clearable
style="width: 130px"
></ElInput>
</ElFormItem>
<ElFormItem label="内部标签">
<ElInput
v-model.trim="searchForm.internalMemo"
......@@ -117,6 +125,7 @@
<el-option value="multiple" label="多面"></el-option>
</el-select>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" @click="loadDiffList">查询</ElButton>
</ElFormItem>
......@@ -506,8 +515,9 @@
</span>
</el-col>
<el-col :span="12" :offset="0" style="text-align: right">
<span title="期望交货时间">
{{ cardItem?.expectDeliveryTime }}
<span v-if="!cardItem?.expectDeliveryTime">期望交货时间:--</span>
<span v-else title="期望交货时间">
{{ cardItem?.expectDeliveryTime || '--' }}
</span>
</el-col>
</el-row>
......@@ -517,6 +527,24 @@
:offset="0"
style="white-space: nowrap"
>
<a
href="javascript:void(0)"
style="display: flex; align-items: center;gap: 4px;"
@click.stop="
openMaterial(String(cardItem?.productionFileId))
"
>
<img width="20" src="@/assets/images/id.png" />
<span title="素材ID">
{{ cardItem?.productionFileId }}
</span>
</a>
</el-col>
<el-col
:span="12"
:offset="0"
style="white-space: nowrap; text-align: right"
>
<span
:title="`第三方订单号:${cardItem?.thirdOrderNumber}`"
style="
......@@ -563,7 +591,12 @@
class="order-list-expand"
:style="{ width: `${thOrderDetailWidth + 50}px` }"
>
<ProductInfo :row="row" :status="status" :is-pod="true">
<ProductInfo
:row="row"
:status="status"
:is-pod="true"
@open-material="openMaterial"
>
<template #operation="{ productItem }">
<div class="operation-item" title="添加备注">
<el-icon
......@@ -2117,6 +2150,21 @@ const getUserMark = async () => {
//showError(error)
}
}
const openMaterial = async (id: string) => {
if (!id) return
const ids = id.split(',')
const res = await downloadMaterialApi(ids.map(Number))
const { data } = res
data.forEach((item: string) => {
const a = document.createElement('a')
a.href = filePath + item
a.download = item
a.target = '_blank'
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
})
}
onMounted(async () => {
document.addEventListener('keydown', listenerKeydown)
document.addEventListener('click', listenerClick)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment