Commit 8c7055ae by qinjianhui

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

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