Commit 8c7055ae by qinjianhui

feat: 工厂订单单号支持复制

parent 9ab48af0
......@@ -669,14 +669,14 @@ export function getOrderInventoryListApi(
pageSize: number,
) {
return axios.post<never, BasePaginationData<OrderInventoryData>>(
'factory/podOrderOperation/order-inventory-list',
'factory/podOrder/outOfStock/stock-out-statistics',
{ ...data, currentPage, pageSize },
)
}
export function exportOrderInventoryApi(data: Record<string, unknown>) {
return axios.post<never, BaseRespData<never>>(
'factory/podOrderOperation/export-order-inventory',
'factory/podOrder/outOfStock/export-stock-out-statistics',
data,
)
}
......@@ -288,9 +288,12 @@ export interface OrderInventoryData {
productNo?: string
skuName?: string
shortageQuantity?: number
salesNum?: number
demandQuantity?: number
usableQuantity?: number
inventory?: number
occupyInventory?: number
freezeInventory?: number
variantImage?: string
inventoryStatus?: number
}
......@@ -56,3 +56,12 @@ export function isPermissionBtn(key: string) {
if (!permissionBtns) return false
return permissionBtns.includes(key)
}
export function downloadByUrl(url: string, filename?: string) {
const a = document.createElement('a')
a.href = url
a.download = filename || url.split('/').pop() || 'download'
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
......@@ -152,7 +152,7 @@
>
<ElInput
v-model.trim="searchForm.operationNo"
placeholder="操作单号"
placeholder="多个操作单号,分隔"
clearable
style="width: 140px"
/>
......@@ -1170,6 +1170,7 @@ import {
ArrowUp,
CaretTop,
CaretBottom,
DocumentCopy,
Edit,
DocumentCopy,
} from '@element-plus/icons-vue'
......@@ -1256,6 +1257,7 @@ import { useOrderListAndDetail } from './hooks/useOrderListAndDetail'
import { useOrderBatchActions } from './hooks/useOrderBatchActions'
import { ElButton, ElTag } from 'element-plus'
import OrderInventoryDetailDialog from './component/OrderInventoryDialog.vue'
import { downloadByUrl } from '@/utils/index.ts'
const resultInfo = ref<ResultInfoDataItem[]>([])
const resultRefs = ref()
......@@ -2772,7 +2774,10 @@ const handleDownloadMaterial = async () => {
? await downloadMaterialApi(ids as number[])
: await downloadOperationMaterialApi(ids as number[])
if (res.code !== 200) return
window.open(filePath + res.message, '_blank')
downloadByUrl(
filePath + res.message,
res.message?.split('/').pop() || 'download',
)
} catch (e) {
console.error(e)
} finally {
......@@ -2788,7 +2793,10 @@ const handleDownloadMaterialByProduct = async (row: ProductListData) => {
try {
const res = await downloadOperationMaterialApi([row.id])
if (res.code !== 200) return
window.open(filePath + res.message, '_blank')
downloadByUrl(
filePath + res.message,
res.message?.split('/').pop() || 'download',
)
} catch (e) {
console.error(e)
} finally {
......
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