Commit 4ca55170 by qinjianhui

fix: 问题修改

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