Commit 4ca55170 by qinjianhui

fix: 问题修改

parent ae9f34c2
......@@ -131,7 +131,7 @@
<span class="order-list-expand_item_value"
><a
href="javascript:void(0)"
@click="openMaterial(item.productionFileId || '')"
@click="openMaterial(item as PodProductList)"
>{{ item.productionFileId || '--' }}</a
>
</span>
......@@ -225,6 +225,7 @@ import ImageView from '@/components/ImageView.vue'
import { DocumentCopy } from '@element-plus/icons-vue'
import { OrderData } from '@/types/api/order'
import { PropType } from 'vue'
import { PodProductList } from '@/types/api/podOrder'
defineProps({
row: {
type: Object as PropType<OrderData>,
......@@ -243,8 +244,8 @@ defineProps({
},
})
const emit = defineEmits(['openMaterial'])
const openMaterial = (id: string) => {
emit('openMaterial', id)
const openMaterial = (item: PodProductList) => {
emit('openMaterial', item)
}
const copy = (text: string) => {
navigator.clipboard.writeText(text)
......
......@@ -125,7 +125,7 @@
<el-option value="multiple" label="多面"></el-option>
</el-select>
</ElFormItem>
<ElFormItem>
<ElButton type="primary" @click="loadDiffList">查询</ElButton>
</ElFormItem>
......@@ -515,7 +515,9 @@
</span>
</el-col>
<el-col :span="12" :offset="0" style="text-align: right">
<span v-if="!cardItem?.expectDeliveryTime">期望交货时间:--</span>
<span v-if="!cardItem?.expectDeliveryTime"
>期望交货时间:--</span
>
<span v-else title="期望交货时间">
{{ cardItem?.expectDeliveryTime || '--' }}
</span>
......@@ -529,10 +531,8 @@
>
<a
href="javascript:void(0)"
style="display: flex; align-items: center;gap: 4px;"
@click.stop="
openMaterial(String(cardItem?.productionFileId))
"
style="display: flex; align-items: center; gap: 4px"
@click.stop="openMaterial(cardItem as PodProductList)"
>
<img width="20" src="@/assets/images/id.png" />
<span title="素材ID">
......@@ -2150,20 +2150,18 @@ 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 openMaterial = async (item: PodProductList) => {
const res = await downloadMaterialApi([item.id])
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)
})
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)
......
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