Commit 8a21c7ac by qinjianhui

feat: 待发货商品下载素材功能

parent 8f47a2e1
...@@ -91,8 +91,8 @@ export function getFactoryOrderNewLogApi(id: number | string) { ...@@ -91,8 +91,8 @@ export function getFactoryOrderNewLogApi(id: number | string) {
} }
export function refreshProductInfoApi(data: { export function refreshProductInfoApi(data: {
orderIds?: (number | string)[] orderIds?: (number | string)
productIds?: (number | string)[] productIds?: (number | string)
}) { }) {
return axios.post<never, BaseRespData<void>>( return axios.post<never, BaseRespData<void>>(
'factory/podOrderProduct/refreshProductInfo', 'factory/podOrderProduct/refreshProductInfo',
......
...@@ -1365,7 +1365,15 @@ const productColumns = computed(() => { ...@@ -1365,7 +1365,15 @@ const productColumns = computed(() => {
</span> </span>
<span class="item"> <span class="item">
<el-button type="primary" link size="small"> <el-button
type="primary"
link
size="small"
onClick={(e: Event) => {
e.stopPropagation()
handleDownloadMaterialByProduct(row)
}}
>
下载素材 下载素材
</el-button> </el-button>
</span> </span>
...@@ -1457,8 +1465,8 @@ const handleRefreshProductInfo = async () => { ...@@ -1457,8 +1465,8 @@ const handleRefreshProductInfo = async () => {
} }
try { try {
const res = await refreshProductInfoApi({ const res = await refreshProductInfoApi({
orderIds: !isCardLayout.value ? getSelectedIds() : undefined, orderIds: !isCardLayout.value ? getSelectedIds().join(',') : undefined,
productIds: isCardLayout.value ? getSelectedIds() : undefined, productIds: isCardLayout.value ? getSelectedIds().join(',') : undefined,
}) })
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.success('刷新商品信息成功') ElMessage.success('刷新商品信息成功')
...@@ -1624,13 +1632,24 @@ const handleDownloadMaterial = async () => { ...@@ -1624,13 +1632,24 @@ const handleDownloadMaterial = async () => {
const res = usePodOrderDownload const res = usePodOrderDownload
? await downloadMaterialApi(ids as number[]) ? await downloadMaterialApi(ids as number[])
: await downloadOperationMaterialApi(ids as number[]) : await downloadOperationMaterialApi(ids as number[])
if (res.message) { if (res.code !== 200) return
const a = document.createElement('a') window.open(filePath + res.message, '_blank')
a.href = filePath + res.message } catch (e) {
a.download = '' console.error(e)
a.click() } finally {
} loading.close()
ElMessage.success('下载素材成功') }
}
const handleDownloadMaterialByProduct = async (row: ProductListData) => {
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await downloadOperationMaterialApi([row.id])
if (res.code !== 200) return
window.open(filePath + res.message, '_blank')
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} finally { } finally {
...@@ -1715,7 +1734,10 @@ const handleApplyReplenish = async () => { ...@@ -1715,7 +1734,10 @@ const handleApplyReplenish = async () => {
refreshTree: true, refreshTree: true,
}) })
} }
const adjustPickOrderSuccess = async (_: unknown, selectionOperationIds: number[]) => { const adjustPickOrderSuccess = async (
_: unknown,
selectionOperationIds: number[],
) => {
try { try {
const res = await applyReplenishApi(selectionOperationIds) const res = await applyReplenishApi(selectionOperationIds)
if (res.code !== 200) return if (res.code !== 200) return
......
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