Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinjianhui
factory_front
Commits
ddf3222a
Commit
ddf3222a
authored
Nov 20, 2025
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 缺货统计添加导出功能
parent
ce4120d9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
6 deletions
+89
-6
components.d.ts
+1
-0
src/api/outOfStockStis.ts
+11
-1
src/types/api/outOfStockStatistics.ts
+1
-0
src/views/supply/OutOfStockStatistics.vue
+76
-5
No files found.
components.d.ts
View file @
ddf3222a
...
@@ -53,6 +53,7 @@ declare module 'vue' {
...
@@ -53,6 +53,7 @@ declare module 'vue' {
ElTag
:
typeof
import
(
'element-plus/es'
)[
'ElTag'
]
ElTag
:
typeof
import
(
'element-plus/es'
)[
'ElTag'
]
ElTimeline
:
typeof
import
(
'element-plus/es'
)[
'ElTimeline'
]
ElTimeline
:
typeof
import
(
'element-plus/es'
)[
'ElTimeline'
]
ElTimelineItem
:
typeof
import
(
'element-plus/es'
)[
'ElTimelineItem'
]
ElTimelineItem
:
typeof
import
(
'element-plus/es'
)[
'ElTimelineItem'
]
ElTimePicker
:
typeof
import
(
'element-plus/es'
)[
'ElTimePicker'
]
ElTooltip
:
typeof
import
(
'element-plus/es'
)[
'ElTooltip'
]
ElTooltip
:
typeof
import
(
'element-plus/es'
)[
'ElTooltip'
]
ElTree
:
typeof
import
(
'element-plus/es'
)[
'ElTree'
]
ElTree
:
typeof
import
(
'element-plus/es'
)[
'ElTree'
]
ElUpload
:
typeof
import
(
'element-plus/es'
)[
'ElUpload'
]
ElUpload
:
typeof
import
(
'element-plus/es'
)[
'ElUpload'
]
...
...
src/api/outOfStockStis.ts
View file @
ddf3222a
import
axios
from
'./axios'
import
axios
from
'./axios'
import
{
BasePaginationData
}
from
'@/types/api'
import
{
BasePaginationData
,
BaseRespData
}
from
'@/types/api'
import
{
SearchForm
,
OutOfStockItem
}
from
'@/types/api/outOfStockStatistics'
import
{
SearchForm
,
OutOfStockItem
}
from
'@/types/api/outOfStockStatistics'
export
function
getOutOfStockStatisticsListApi
(
export
function
getOutOfStockStatisticsListApi
(
data
:
SearchForm
,
data
:
SearchForm
,
...
@@ -11,3 +11,13 @@ export function getOutOfStockStatisticsListApi(
...
@@ -11,3 +11,13 @@ export function getOutOfStockStatisticsListApi(
{
...
data
,
currentPage
,
pageSize
},
{
...
data
,
currentPage
,
pageSize
},
)
)
}
}
export
function
exportOutOfStockStatisticsListApi
(
data
:
{
exportAll
:
boolean
indexes
?:
number
[]
})
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'stockOutStatistics/exportStockOutStatistics'
,
data
,
)
}
src/types/api/outOfStockStatistics.ts
View file @
ddf3222a
...
@@ -16,6 +16,7 @@ export interface OutOfStockItem {
...
@@ -16,6 +16,7 @@ export interface OutOfStockItem {
freezeInventory
?:
number
freezeInventory
?:
number
purchaseNotInQuantity
?:
number
purchaseNotInQuantity
?:
number
longestDelayDays
?:
number
longestDelayDays
?:
number
sort
?:
number
}
}
export
interface
SearchForm
{
export
interface
SearchForm
{
...
...
src/views/supply/OutOfStockStatistics.vue
View file @
ddf3222a
...
@@ -74,6 +74,33 @@
...
@@ -74,6 +74,33 @@
></ElPagination>
></ElPagination>
</div>
</div>
</div>
</div>
<ElDialog
v-model=
"exportVisible"
title=
"导出选项"
width=
"500px"
:close-on-click-modal=
"false"
>
<el-form
:model=
"exportForm"
label-width=
"80px"
>
<el-form-item
label=
""
prop=
"resource"
>
<el-radio-group
v-model=
"exportForm.resource"
>
<el-radio
label=
"currentPage"
>
导出本页
</el-radio>
<el-radio
label=
"selectedRows"
>
导出选中
</el-radio>
<el-radio
label=
"all"
>
全部
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template
#
footer
>
<span
class=
"dialog-footer"
>
<el-button
@
click=
"exportVisible = false"
>
取消
</el-button>
<el-button
:loading=
"exportLoading"
type=
"primary"
@
click=
"submitExportForm"
>
确认
</el-button
>
</span>
</
template
>
</ElDialog>
</template>
</template>
<
script
setup
lang=
"tsx"
>
<
script
setup
lang=
"tsx"
>
...
@@ -83,8 +110,12 @@ import usePageList from '@/utils/hooks/usePageList'
...
@@ -83,8 +110,12 @@ import usePageList from '@/utils/hooks/usePageList'
import
{
loadWarehouseListApi
}
from
'@/api/podCnOrder'
import
{
loadWarehouseListApi
}
from
'@/api/podCnOrder'
import
type
{
WarehouseListData
}
from
'@/types/api/podCnOrder'
import
type
{
WarehouseListData
}
from
'@/types/api/podCnOrder'
import
{
SearchForm
,
OutOfStockItem
}
from
'@/types/api/outOfStockStatistics'
import
{
SearchForm
,
OutOfStockItem
}
from
'@/types/api/outOfStockStatistics'
import
{
getOutOfStockStatisticsListApi
}
from
'@/api/outOfStockStis'
import
{
getOutOfStockStatisticsListApi
,
exportOutOfStockStatisticsListApi
,
}
from
'@/api/outOfStockStis'
import
ImageView
from
'@/components/ImageView.vue'
import
ImageView
from
'@/components/ImageView.vue'
import
{
filePath
}
from
'@/api/axios'
const
searchForm
=
ref
<
SearchForm
>
({
const
searchForm
=
ref
<
SearchForm
>
({
warehouseId
:
''
,
warehouseId
:
''
,
...
@@ -94,7 +125,11 @@ const searchForm = ref<SearchForm>({
...
@@ -94,7 +125,11 @@ const searchForm = ref<SearchForm>({
})
})
const
warehouseList
=
ref
<
WarehouseListData
[]
>
([])
const
warehouseList
=
ref
<
WarehouseListData
[]
>
([])
const
exportVisible
=
ref
(
false
)
const
exportForm
=
ref
({
resource
:
null
,
})
const
exportLoading
=
ref
(
false
)
// 表格列配置
// 表格列配置
const
tableColumns
=
computed
(()
=>
{
const
tableColumns
=
computed
(()
=>
{
return
[
return
[
...
@@ -213,7 +248,7 @@ const {
...
@@ -213,7 +248,7 @@ const {
refresh
:
search
,
refresh
:
search
,
onCurrentPageChange
:
handleCurrentChange
,
onCurrentPageChange
:
handleCurrentChange
,
onPageSizeChange
:
handleSizeChange
,
onPageSizeChange
:
handleSizeChange
,
}
=
usePageList
({
}
=
usePageList
<
OutOfStockItem
>
({
query
:
(
page
,
pageSize
)
=>
query
:
(
page
,
pageSize
)
=>
getOutOfStockStatisticsListApi
(
getOutOfStockStatisticsListApi
(
{
{
...
@@ -236,9 +271,45 @@ const loadWarehouseList = async () => {
...
@@ -236,9 +271,45 @@ const loadWarehouseList = async () => {
console
.
error
(
e
)
console
.
error
(
e
)
}
}
}
}
// 导出数据
// 导出数据
const
exportData
=
async
()
=>
{}
const
exportData
=
async
()
=>
{
exportForm
.
value
.
resource
=
null
exportVisible
.
value
=
true
}
const
submitExportForm
=
async
()
=>
{
if
(
!
exportForm
.
value
.
resource
)
{
return
ElMessage
.
error
(
'请选择导出类型'
)
}
const
params
:
{
exportAll
:
boolean
;
indexes
?:
number
[]
}
=
{
exportAll
:
false
,
indexes
:
[],
}
if
(
exportForm
.
value
.
resource
===
'currentPage'
)
{
params
.
exportAll
=
false
params
.
indexes
=
undefined
}
else
if
(
exportForm
.
value
.
resource
===
'selectedRows'
)
{
if
(
!
selectedRows
.
value
.
length
)
{
return
ElMessage
.
error
(
'请选择要导出的数据'
)
}
params
.
exportAll
=
false
params
.
indexes
=
selectedRows
.
value
.
map
((
el
:
OutOfStockItem
)
=>
Number
(
el
.
sort
),
)
}
else
if
(
exportForm
.
value
.
resource
===
'all'
)
{
params
.
exportAll
=
true
params
.
indexes
=
undefined
}
try
{
const
res
=
await
exportOutOfStockStatisticsListApi
({
...
searchForm
.
value
,
...
params
,
})
window
.
open
(
filePath
+
res
.
message
,
'_blank'
)
exportVisible
.
value
=
false
}
catch
(
e
)
{
console
.
error
(
e
)
}
}
// 处理表格选择变化
// 处理表格选择变化
const
selectedRows
=
ref
<
OutOfStockItem
[]
>
([])
const
selectedRows
=
ref
<
OutOfStockItem
[]
>
([])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment