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
1aab27f4
Commit
1aab27f4
authored
May 22, 2025
by
zhuzhequan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工厂端仓库
parent
92e8663c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
554 additions
and
133 deletions
+554
-133
src/api/warehouse.ts
+89
-1
src/router/index.ts
+7
-0
src/router/menu.ts
+1
-1
src/views/order/pod/index.vue
+5
-1
src/views/warehouse/position.vue
+324
-0
src/views/warehouse/warning.vue
+128
-130
No files found.
src/api/warehouse.ts
View file @
1aab27f4
...
@@ -4,11 +4,37 @@ export interface factoryWarehouseInfo{
...
@@ -4,11 +4,37 @@ export interface factoryWarehouseInfo{
pageSize
:
number
pageSize
:
number
currentPage
:
number
currentPage
:
number
total
?:
number
total
?:
number
warehouseId
?:
string
;
locationName
?:
string
;
remark
?:
string
;
}
export
interface
WarehouseInventory
{
pageSize
:
number
;
currentPage
:
number
;
total
?:
number
;
warehouseId
:
string
;
skuName
:
string
;
warehouseSku
:
string
;
occupyInventory
:
string
;
freezeInventory
:
string
;
inventory
:
string
;
upperLimit
:
string
;
usableInventoryStart
:
string
;
usableInventoryEnd
:
string
;
occupyInventoryEnd
:
string
;
occupyInventoryStart
:
string
;
floorLimit
:
string
;
}
}
export
interface
UpdateDefaulted
{
export
interface
UpdateDefaulted
{
id
?:
number
;
id
?:
number
;
defaulted
:
number
;
defaulted
:
number
;
}
}
export
interface
UpdateStatus
{
id
?:
number
;
status
:
number
|
undefined
;
}
export
interface
warehouseInfo
{
export
interface
warehouseInfo
{
id
?:
number
;
id
?:
number
;
name
:
string
;
name
:
string
;
...
@@ -19,6 +45,26 @@ export interface warehouseInfo{
...
@@ -19,6 +45,26 @@ export interface warehouseInfo{
factoryCode
?:
string
;
factoryCode
?:
string
;
remarks
:
string
remarks
:
string
}
}
export
interface
positionInfo
{
id
?:
number
;
warehouseId
:
string
;
locationName
:
string
;
pickingOrder
:
string
;
locationCode
:
string
;
warehouseName
?:
string
;
status
?:
number
;
remark
:
string
}
export
interface
positionFormInfo
{
id
?:
number
;
warehouseId
:
string
;
locationName
:
string
;
pickingOrder
:
string
;
locationCode
:
string
;
warehouseName
:
string
;
remark
:
string
}
interface
WarehouseWarningData
{
interface
WarehouseWarningData
{
id
:
number
;
id
:
number
;
factoryId
:
number
;
factoryId
:
number
;
...
@@ -41,12 +87,26 @@ interface WarehouseWarningData {
...
@@ -41,12 +87,26 @@ interface WarehouseWarningData {
createTime
:
string
;
createTime
:
string
;
updateTime
:
string
;
updateTime
:
string
;
}
}
export
function
getFactoryLocation
(
data
:
factoryWarehouseInfo
)
{
return
axios
.
post
<
never
,
BasePaginationData
<
positionInfo
>>
(
'factoryWarehouseLocation/list_page'
,
data
,
)
}
export
function
getFactoryWarehouseInfo
(
data
:
factoryWarehouseInfo
)
{
export
function
getFactoryWarehouseInfo
(
data
:
factoryWarehouseInfo
)
{
return
axios
.
post
<
never
,
BasePaginationData
<
warehouseInfo
>>
(
return
axios
.
post
<
never
,
BasePaginationData
<
warehouseInfo
>>
(
'factoryWarehouseInfo/list_page'
,
'factoryWarehouseInfo/list_page'
,
data
,
data
,
)
)
}
}
export
function
getWarehouseInventoryInfo
(
data
:
WarehouseInventory
)
{
return
axios
.
post
<
never
,
BasePaginationData
<
warehouseInfo
>>
(
'factoryWarehouseInventory/list_page'
,
data
,
)
}
export
function
createWarehouseApi
(
data
:
warehouseInfo
)
{
export
function
createWarehouseApi
(
data
:
warehouseInfo
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/factoryWarehouseInfo/add'
,
'/factoryWarehouseInfo/add'
,
...
@@ -54,18 +114,38 @@ export function createWarehouseApi(data:warehouseInfo) {
...
@@ -54,18 +114,38 @@ export function createWarehouseApi(data:warehouseInfo) {
)
)
}
}
export
function
createPositionApi
(
data
:
positionInfo
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/factoryWarehouseLocation/add'
,
data
)
}
export
function
warehouseInfoGetAll
()
{
return
axios
.
get
<
never
,
BaseRespData
<
warehouseInfo
[]
>>
(
'/factoryWarehouseInfo/getAll'
)
}
export
function
createWarehouseInventoryApi
(
data
:
WarehouseWarningData
)
{
export
function
createWarehouseInventoryApi
(
data
:
WarehouseWarningData
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/factoryWarehouseInventory/add'
,
'/factoryWarehouseInventory/add'
,
data
data
)
)
}
}
export
function
updateWarehouseApi
(
data
:
warehouse
Info
|
UpdateDefaulted
)
{
export
function
updateWarehouseApi
(
data
:
position
Info
|
UpdateDefaulted
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/factoryWarehouseInfo/update'
,
'/factoryWarehouseInfo/update'
,
data
data
)
)
}
}
export
function
updatePositionApi
(
data
:
positionInfo
|
UpdateStatus
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/factoryWarehouseLocation/update'
,
data
)
}
export
function
updateWarehouseInventoryApi
(
data
:
WarehouseWarningData
)
{
export
function
updateWarehouseInventoryApi
(
data
:
WarehouseWarningData
)
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'/factoryWarehouseInventory/update'
,
'/factoryWarehouseInventory/update'
,
...
@@ -80,6 +160,14 @@ export function deleteWarehouseApi(ids:string) {
...
@@ -80,6 +160,14 @@ export function deleteWarehouseApi(ids:string) {
},
},
)
)
}
}
export
function
deleteLocationApi
(
ids
:
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
'/factoryWarehouseLocation/delete'
,
{
params
:{
ids
}
},
)
}
export
function
deleteWarehouseInventory
(
ids
:
string
)
{
export
function
deleteWarehouseInventory
(
ids
:
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
'/factoryWarehouseInventory/delete'
,
'/factoryWarehouseInventory/delete'
,
...
...
src/router/index.ts
View file @
1aab27f4
...
@@ -23,6 +23,7 @@ import PodOrderList from '@/views/order/pod/index.vue'
...
@@ -23,6 +23,7 @@ import PodOrderList from '@/views/order/pod/index.vue'
import
PodDeliveryNoteList
from
'@/views/order/pod/deliveryOrderList.vue'
import
PodDeliveryNoteList
from
'@/views/order/pod/deliveryOrderList.vue'
import
WarehouseManage
from
'@/views/warehouse/manage.vue'
import
WarehouseManage
from
'@/views/warehouse/manage.vue'
import
WarehouseWarning
from
'@/views/warehouse/warning.vue'
import
WarehouseWarning
from
'@/views/warehouse/warning.vue'
import
WarehousePosition
from
'@/views/warehouse/position.vue'
const
router
=
createRouter
({
const
router
=
createRouter
({
history
:
createWebHistory
(),
history
:
createWebHistory
(),
routes
:
[
routes
:
[
...
@@ -117,6 +118,12 @@ const router = createRouter({
...
@@ -117,6 +118,12 @@ const router = createRouter({
title
:
'仓库预警'
,
title
:
'仓库预警'
,
},
},
component
:
WarehouseWarning
,
component
:
WarehouseWarning
,
},{
path
:
'/warehouse/position'
,
meta
:
{
title
:
'库位管理'
,
},
component
:
WarehousePosition
,
},
},
],
],
},
},
...
...
src/router/menu.ts
View file @
1aab27f4
...
@@ -27,7 +27,7 @@ const menu: MenuItem[] = [
...
@@ -27,7 +27,7 @@ const menu: MenuItem[] = [
label
:
'仓库管理'
,
label
:
'仓库管理'
,
},
},
{
{
index
:
'/
order/list
'
,
index
:
'/
warehouse/position
'
,
id
:
122
,
id
:
122
,
label
:
'库位管理'
,
label
:
'库位管理'
,
},
},
...
...
src/views/order/pod/index.vue
View file @
1aab27f4
...
@@ -231,7 +231,7 @@
...
@@ -231,7 +231,7 @@
v
-
if
=
"['TO_BE_CONFIRMED', 'IN_PRODUCTION'].includes(status)"
v
-
if
=
"['TO_BE_CONFIRMED', 'IN_PRODUCTION'].includes(status)"
class
=
"item"
class
=
"item"
>
>
<
ElButton
type
=
"warning"
is
-
dark
@
click
=
"synchronousPlan"
>
<
ElButton
:
loading
=
"syncLoading"
type
=
"warning"
is
-
dark
@
click
=
"synchronousPlan"
>
同步素材图
<
/ElButto
n
同步素材图
<
/ElButto
n
>
>
<
/span
>
<
/span
>
...
@@ -1731,6 +1731,7 @@ const openAll = (row: CardOrderData) => {
...
@@ -1731,6 +1731,7 @@ const openAll = (row: CardOrderData) => {
// 表格和卡片的选中值:有两种约束
// 表格和卡片的选中值:有两种约束
const
selection
=
ref
<
(
CardOrderData
|
PodProductList
)[]
>
([])
const
selection
=
ref
<
(
CardOrderData
|
PodProductList
)[]
>
([])
const
tableData
=
ref
<
OrderData
[]
>
([])
const
tableData
=
ref
<
OrderData
[]
>
([])
const
syncLoading
=
ref
<
boolean
>
(
false
)
const
handleSelectionChange
=
(
s
:
CardOrderData
[])
=>
{
const
handleSelectionChange
=
(
s
:
CardOrderData
[])
=>
{
selection
.
value
=
s
selection
.
value
=
s
}
}
...
@@ -1813,6 +1814,7 @@ const synchronousPlan = async () => {
...
@@ -1813,6 +1814,7 @@ const synchronousPlan = async () => {
offset
:
window
.
innerHeight
/
2
,
offset
:
window
.
innerHeight
/
2
,
}
)
}
)
}
}
syncLoading
.
value
=
true
try
{
try
{
await
showConfirm
(
'是否同步素材图?'
,
{
await
showConfirm
(
'是否同步素材图?'
,
{
confirmButtonText
:
'确认'
,
confirmButtonText
:
'确认'
,
...
@@ -1826,9 +1828,11 @@ const synchronousPlan = async () => {
...
@@ -1826,9 +1828,11 @@ const synchronousPlan = async () => {
const
res
=
await
syncSubOrderDesignImages
(
selection
.
value
.
map
(
item
=>
item
.
id
))
const
res
=
await
syncSubOrderDesignImages
(
selection
.
value
.
map
(
item
=>
item
.
id
))
await
loadDiffList
()
await
loadDiffList
()
await
loadTabData
()
await
loadTabData
()
syncLoading
.
value
=
false
ElMessage
.
success
(
res
.
message
)
ElMessage
.
success
(
res
.
message
)
}
catch
(
e
)
{
}
catch
(
e
)
{
// showError(e)
// showError(e)
syncLoading
.
value
=
false
}
}
}
}
// 下载稿件
// 下载稿件
...
...
src/views/warehouse/position.vue
0 → 100644
View file @
1aab27f4
<
script
setup
lang=
"ts"
>
import
{
factoryWarehouseInfo
,
warehouseInfo
,
getFactoryLocation
,
warehouseInfoGetAll
,
createPositionApi
,
updatePositionApi
,
positionInfo
,
deleteLocationApi
,
positionFormInfo
,
}
from
'@/api/warehouse.ts'
import
{
nextTick
,
ref
}
from
'vue'
import
SplitDiv
from
'@/components/splitDiv/splitDiv.vue'
const
searchForm
=
ref
({
warehouseId
:
''
,
locationCode
:
''
,
locationName
:
''
,
remark
:
''
,
})
const
warehouseList
=
ref
<
warehouseInfo
[]
>
([])
const
selections
=
ref
<
positionInfo
[]
>
([])
const
formRef
=
ref
()
const
form
=
ref
<
positionFormInfo
>
({
locationName
:
''
,
locationCode
:
''
,
pickingOrder
:
''
,
warehouseName
:
''
,
warehouseId
:
''
,
remark
:
''
,
})
const
createData
=
ref
({
title
:
''
,
show
:
false
,
isEdit
:
false
,
form
:
{
locationName
:
''
,
locationCode
:
''
,
pickingOrder
:
''
,
warehouseName
:
''
,
warehouseId
:
''
,
remark
:
''
,
},
})
const
rules
=
{
locationName
:
[
{
required
:
true
,
message
:
'请输入库位名称'
,
trigger
:
'blur'
},
],
locationCode
:
[
{
required
:
true
,
message
:
'请输入库位编码'
,
trigger
:
'blur'
},
],
pickingOrder
:
[
{
required
:
true
,
message
:
'请输入拣货顺序'
,
trigger
:
'blur'
},
],
warehouseId
:
[
{
required
:
true
,
message
:
'请选择仓库'
,
trigger
:
'change'
},
],
}
const
leftData
=
ref
<
positionInfo
[]
>
([])
const
pagination
=
ref
<
factoryWarehouseInfo
>
({
pageSize
:
50
,
currentPage
:
1
,
total
:
0
,
})
async
function
getData
()
{
const
res
=
await
getFactoryLocation
({
...
pagination
.
value
,
...
searchForm
.
value
,
})
leftData
.
value
=
res
.
data
.
records
pagination
.
value
.
total
=
res
.
data
.
total
}
const
handleSelectionChange
=
(
data
:
positionInfo
[])
=>
{
selections
.
value
=
data
}
const
handleSizeChange
=
(
pageSize
:
number
)
=>
{
pagination
.
value
.
pageSize
=
pageSize
getData
()
}
const
handleCurrentChange
=
(
currentPage
:
number
)
=>
{
pagination
.
value
.
currentPage
=
currentPage
getData
()
}
const
handleConfirm
=
async
()
=>
{
await
formRef
.
value
?.
validate
()
if
(
!
createData
.
value
.
isEdit
)
{
await
createPositionApi
(
form
.
value
)
}
else
{
await
updatePositionApi
(
form
.
value
)
}
createData
.
value
.
show
=
false
ElMessage
.
success
(
'操作成功'
)
await
getData
()
}
const
handleBatchDelete
=
async
(
row
:
positionInfo
)
=>
{
if
(
!
row
&&
!
selections
.
value
.
length
)
{
return
ElMessage
.
warning
(
'请选择要删除的数据'
)
}
await
ElMessageBox
.
confirm
(
'确定要删除吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
})
const
str
=
row
&&
row
.
id
?
row
.
id
?.
toString
()
:
selections
.
value
.
map
((
el
)
=>
el
.
id
).
join
(
','
)
await
deleteLocationApi
(
str
)
ElMessage
.
success
(
'删除成功'
)
await
getData
()
}
const
createWarehouse
=
()
=>
{
createData
.
value
.
show
=
true
createData
.
value
.
isEdit
=
false
createData
.
value
.
title
=
'新增库位'
form
.
value
=
{
locationName
:
''
,
locationCode
:
''
,
pickingOrder
:
''
,
warehouseName
:
''
,
warehouseId
:
''
,
remark
:
''
,
}
nextTick
(()
=>
{
formRef
.
value
?.
clearValidate
()
})
}
const
updateStatus
=
async
(
item
:
positionInfo
)
=>
{
await
updatePositionApi
({
id
:
item
.
id
,
status
:
item
.
status
,
})
}
const
updateWarehouse
=
(
item
:
positionFormInfo
)
=>
{
createData
.
value
.
show
=
true
createData
.
value
.
isEdit
=
true
createData
.
value
.
title
=
'修改仓库'
form
.
value
=
{
id
:
item
.
id
,
locationName
:
item
.
locationName
,
locationCode
:
item
.
locationCode
,
pickingOrder
:
item
.
pickingOrder
,
warehouseName
:
item
.
warehouseName
,
warehouseId
:
item
.
warehouseId
,
remark
:
item
.
remark
,
}
nextTick
(()
=>
{
formRef
.
value
?.
clearValidate
()
})
}
getData
()
const
getWarehouse
=
async
()
=>
{
const
{
data
}
=
await
warehouseInfoGetAll
()
warehouseList
.
value
=
data
}
const
warehouseChange
=
(
v
:
number
)
=>
{
const
warehouse
=
warehouseList
.
value
.
find
(
w
=>
w
.
id
==
v
)
form
.
value
.
warehouseName
=
warehouse
?
warehouse
.
name
:
''
}
getWarehouse
()
</
script
>
<
template
>
<split-div>
<template
#
top
>
<el-card>
<el-form
inline
:model=
"searchForm"
>
<el-form-item
label=
"仓库"
>
<el-select
v-model=
"searchForm.warehouseId"
clearable
filterable
style=
"width: 150px;"
>
<el-option
v-for=
"item in warehouseList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"库位名称"
>
<el-input
v-model=
"searchForm.locationName"
style=
"width: 140px;"
placeholder=
"请输入库位名称"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"库位编码"
>
<el-input
v-model=
"searchForm.locationCode"
style=
"width: 140px;"
placeholder=
"请输入库位编码"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-input
v-model=
"searchForm.remark"
style=
"width: 140px;"
placeholder=
"请输入备注"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"getData"
>
查询
</el-button>
<el-button
type=
"success"
@
click=
"createWarehouse"
>
新增库位
</el-button>
<el-button
type=
"danger"
@
click=
"handleBatchDelete"
>
删除
</el-button>
</el-form-item>
</el-form>
</el-card>
</
template
>
<
template
#
bottom
>
<el-card
style=
"height: 100%"
>
<div
class=
"manage"
>
<div
class=
"table-flex"
>
<div
class=
"left-table"
>
<div
class=
"table-container"
>
<el-table
height=
"100%"
:data=
"leftData"
border
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"60"
/>
<el-table-column
width=
"100"
label=
"启用状态"
prop=
"status"
align=
"center"
>
<template
#
default=
"
{row}">
<el-switch
v-model=
"row.status"
:active-value=
"1"
:inactive-value=
"0"
@
click=
"updateStatus(row)"
></el-switch>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"所属仓库"
prop=
"warehouseName"
></el-table-column>
<el-table-column
align=
"center"
label=
"库位名称"
prop=
"locationName"
></el-table-column>
<el-table-column
align=
"center"
label=
"库位编码"
prop=
"locationCode"
></el-table-column>
<el-table-column
align=
"center"
label=
"拣货顺序"
prop=
"pickingOrder"
></el-table-column>
<el-table-column
align=
"center"
label=
"备注"
prop=
"remark"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
#
default=
"{row}"
>
<el-button
type=
"primary"
@
click=
"updateWarehouse(row)"
>
编辑
</el-button>
<el-button
type=
"danger"
@
click=
"handleBatchDelete(row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<div
class=
"pagination"
>
<el-pagination
v-model:current-page=
"pagination.currentPage"
v-model:page-size=
"pagination.pageSize"
:page-sizes=
"[50, 100, 150, 200]"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"pagination.total"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
/>
</div>
</div>
</div>
<el-dialog
v-model=
"createData.show"
width=
"500px"
:title=
"createData.title"
>
<el-form
ref=
"formRef"
label-width=
"110px"
:rules=
"rules"
:model=
"form"
>
<el-form-item
label=
"库位名称"
prop=
"locationName"
>
<el-input
v-model=
"form.locationName"
clearable
placeholder=
"请输入库位名称"
></el-input>
</el-form-item>
<el-form-item
label=
"库位编码"
prop=
"locationCode"
>
<el-input
v-model=
"form.locationCode"
clearable
placeholder=
"请输入库位编码(例如:A1-01-03)"
></el-input>
</el-form-item>
<el-form-item
label=
"拣货顺序"
prop=
"pickingOrder"
>
<el-input-number
v-model=
"form.pickingOrder"
placeholder=
"拣货顺序"
></el-input-number>
</el-form-item>
<el-form-item
label=
"所属仓库"
prop=
"warehouseId"
>
<el-select
v-model=
"form.warehouseId"
@
change=
"warehouseChange"
>
<el-option
v-for=
"item in warehouseList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
:rows=
"4"
clearable
placeholder=
"请输入备注"
></el-input>
</el-form-item>
</el-form>
<
template
#
footer
>
<el-button
@
click=
"createData.show=false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
</
template
>
</el-dialog>
</div>
</el-card>
</template>
</split-div>
</template>
<
style
scoped
lang=
"scss"
>
.el-card
{
::v-deep(.el-card__body)
{
height
:
100%
;
}
}
.manage
{
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
.header
{
margin-bottom
:
10px
;
}
.table-flex
{
flex
:
1
;
flex-shrink
:
0
;
overflow
:
hidden
;
display
:
flex
;
}
.right-table
{
flex
:
1
;
margin-left
:
10px
;
flex-shrink
:
0
;
}
.left-table
{
height
:
100%
;
display
:
flex
;
width
:
100%
;
flex-direction
:
column
;
.pagination
{
display
:
flex
;
margin-top
:
10px
;
justify-content
:
center
;
}
.table-container
{
flex
:
1
;
flex-shrink
:
0
;
overflow
:
hidden
;
}
}
}
</
style
>
src/views/warehouse/warning.vue
View file @
1aab27f4
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
import
{
getFactoryWarehouseInfo
,
factoryWarehouseInfo
,
factoryWarehouseInfo
,
warehouseInfo
,
warehouseInfo
,
updateWarehouseApi
,
deleteWarehouseInventory
,
warehouseInfoGetAll
,
getWarehouseInventoryInfo
,
WarehouseInventory
,
deleteWarehouseInventory
,
createWarehouseInventoryApi
,
updateWarehouseInventoryApi
,
}
from
'@/api/warehouse.ts'
}
from
'@/api/warehouse.ts'
import
{
nextTick
,
ref
}
from
'vue'
import
{
nextTick
,
ref
}
from
'vue'
import
SplitDiv
from
'@/components/splitDiv/splitDiv.vue'
const
searchForm
=
ref
({
warehouseId
:
''
,
skuName
:
''
,
warehouseSku
:
''
,
occupyInventory
:
''
,
freezeInventory
:
''
,
inventory
:
''
,
upperLimit
:
''
,
usableInventoryStart
:
''
,
usableInventoryEnd
:
''
,
occupyInventoryEnd
:
''
,
occupyInventoryStart
:
''
,
floorLimit
:
''
,
})
const
warehouseList
=
ref
<
warehouseInfo
[]
>
([])
const
selections
=
ref
<
warehouseInfo
[]
>
([])
const
selections
=
ref
<
warehouseInfo
[]
>
([])
const
formRef
=
ref
()
const
formRef
=
ref
()
const
createData
=
ref
({
const
createData
=
ref
({
title
:
''
,
title
:
''
,
show
:
false
,
show
:
false
,
isEdit
:
false
,
isEdit
:
false
,
form
:
{
name
:
''
,
code
:
''
,
sort
:
''
,
defaulted
:
1
,
remarks
:
''
,
},
})
})
const
rules
=
{
name
:
[
{
required
:
true
,
message
:
'请输入仓库名称'
,
trigger
:
'blur'
},
],
code
:
[
{
required
:
true
,
message
:
'请输入仓库编码'
,
trigger
:
'blur'
},
],
defaulted
:
[
{
required
:
true
,
message
:
'请选择是否默认仓库'
,
trigger
:
'change'
},
],
}
const
leftData
=
ref
<
warehouseInfo
[]
>
([])
const
leftData
=
ref
<
warehouseInfo
[]
>
([])
const
pagination
=
ref
<
factoryWarehouseInfo
>
({
const
pagination
=
ref
<
factoryWarehouseInfo
>
({
pageSize
:
50
,
pageSize
:
50
,
...
@@ -43,8 +37,9 @@ const pagination = ref<factoryWarehouseInfo>({
...
@@ -43,8 +37,9 @@ const pagination = ref<factoryWarehouseInfo>({
})
})
async
function
getData
()
{
async
function
getData
()
{
const
res
=
await
get
FactoryWarehouse
Info
({
const
res
=
await
get
WarehouseInventory
Info
({
...
pagination
.
value
,
...
pagination
.
value
,
...
searchForm
.
value
,
})
})
leftData
.
value
=
res
.
data
.
records
leftData
.
value
=
res
.
data
.
records
pagination
.
value
.
total
=
res
.
data
.
total
pagination
.
value
.
total
=
res
.
data
.
total
...
@@ -61,17 +56,6 @@ const handleCurrentChange = (currentPage: number) => {
...
@@ -61,17 +56,6 @@ const handleCurrentChange = (currentPage: number) => {
pagination
.
value
.
currentPage
=
currentPage
pagination
.
value
.
currentPage
=
currentPage
getData
()
getData
()
}
}
const
handleConfirm
=
async
()
=>
{
await
formRef
.
value
?.
validate
()
if
(
!
createData
.
value
.
isEdit
)
{
await
createWarehouseInventoryApi
(
createData
.
value
.
form
)
}
else
{
await
updateWarehouseInventoryApi
(
createData
.
value
.
form
)
}
createData
.
value
.
show
=
false
ElMessage
.
success
(
'操作成功'
)
await
getData
()
}
const
handleBatchDelete
=
async
()
=>
{
const
handleBatchDelete
=
async
()
=>
{
if
(
!
selections
.
value
.
length
)
{
if
(
!
selections
.
value
.
length
)
{
...
@@ -87,112 +71,126 @@ const handleBatchDelete = async () => {
...
@@ -87,112 +71,126 @@ const handleBatchDelete = async () => {
ElMessage
.
success
(
'删除成功'
)
ElMessage
.
success
(
'删除成功'
)
await
getData
()
await
getData
()
}
}
const
createWarehouse
=
()
=>
{
const
getWarehouse
=
async
()
=>
{
createData
.
value
.
show
=
true
const
{
data
}
=
await
warehouseInfoGetAll
()
createData
.
value
.
isEdit
=
false
warehouseList
.
value
=
data
createData
.
value
.
title
=
'新增仓库'
createData
.
value
.
form
=
{
name
:
''
,
code
:
''
,
sort
:
''
,
defaulted
:
1
,
remarks
:
''
,
}
nextTick
(()
=>
{
formRef
.
value
?.
clearValidate
()
})
}
const
updateDefaulted
=
async
(
item
:
warehouseInfo
)
=>
{
await
updateWarehouseApi
({
id
:
item
.
id
,
defaulted
:
item
.
defaulted
,
})
}
const
updateWarehouse
=
(
item
:
warehouseInfo
)
=>
{
createData
.
value
.
show
=
true
createData
.
value
.
isEdit
=
true
createData
.
value
.
title
=
'修改仓库'
createData
.
value
.
form
=
{
...
item
}
nextTick
(()
=>
{
formRef
.
value
?.
clearValidate
()
})
}
}
getData
()
getData
()
getWarehouse
()
</
script
>
</
script
>
<
template
>
<
template
>
<el-card
style=
"height: 100%"
>
<split-div>
<div
class=
"manage"
>
<template
#
top
>
<div
class=
"header"
>
<el-card>
<el-button
type=
"success"
@
click=
"createWarehouse"
>
新增仓库
</el-button>
<el-form
inline
:model=
"searchForm"
>
<el-button
type=
"danger"
@
click=
"handleBatchDelete"
>
删除
</el-button>
<el-form-item
label=
"仓库"
>
</div>
<el-select
placeholder=
"请输入仓库"
v-model=
"searchForm.warehouseId"
style=
"width: 140px;"
>
<div
class=
"table-flex"
>
<el-option
v-for=
"item in warehouseList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
<div
class=
"left-table"
>
</el-select>
<div
class=
"table-container"
>
<el-table
height=
"100%"
:data=
"leftData"
border
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"60"
/>
<el-table-column
label=
"仓库名称"
prop=
"name"
align=
"center"
/>
<el-table-column
label=
"仓库类型"
prop=
"name"
align=
"center"
/>
<el-table-column
label=
"仓库编码"
prop=
"code"
align=
"center"
/>
<el-table-column
label=
"仓库地址"
prop=
"name"
align=
"center"
/>
<el-table-column
label=
"备注"
prop=
"remarks"
align=
"center"
/>
<el-table-column
label=
"默认仓库"
prop=
"defaulted"
align=
"center"
>
<template
#
default=
"
{row}">
<el-switch
v-model=
"row.defaulted"
:active-value=
"1"
:inactive-value=
"0"
@
click=
"updateDefaulted(row)"
></el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
#
default=
"{row}"
>
<el-button
type=
"primary"
@
click=
"updateWarehouse(row)"
>
编辑
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<div
class=
"pagination"
>
<el-pagination
v-model:current-page=
"pagination.currentPage"
v-model:page-size=
"pagination.pageSize"
:page-sizes=
"[50, 100, 150, 200]"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"pagination.total"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
/>
</div>
</div>
</div>
<el-dialog
v-model=
"createData.show"
:title=
"createData.title"
>
<el-form
ref=
"formRef"
label-width=
"110px"
:rules=
"rules"
:model=
"createData.form"
>
<el-form-item
label=
"仓库名称"
prop=
"name"
>
<el-input
v-model=
"createData.form.name"
clearable
placeholder=
"请输入仓库名称"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"仓库编码"
prop=
"code"
>
<el-form-item
label=
"商品SKU"
>
<el-input
v-model=
"createData.form.code"
clearable
placeholder=
"请输入仓库编码"
></el-input>
<el-input
v-model=
"searchForm.warehouseSku"
style=
"width: 140px;"
placeholder=
"请输入商品SKU"
clearable
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"仓库序号"
prop=
"sort"
>
<el-form-item
label=
"商品名称"
>
<el-input-number
v-model=
"createData.form.sort"
></el-input-number>
<el-input
v-model=
"searchForm.skuName"
style=
"width: 140px;"
placeholder=
"请输入商品名称"
clearable
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"是否默认仓库"
prop=
"defaulted"
>
<el-form-item
label=
"库存数"
>
<el-switch
v-model=
"createData.form.defaulted"
:active-value=
"1"
:inactive-value=
"0"
></el-switch>
<el-input
v-model=
"searchForm.upperLimit"
style=
"width: 80px;margin-right: 5px"
placeholder=
""
clearable
></el-input>
-
<el-input
v-model=
"searchForm.floorLimit"
style=
"width: 80px;margin-left: 5px"
placeholder=
""
clearable
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remarks"
>
<el-form-item
label=
"可用数"
>
<el-input
<el-input
v-model=
"searchForm.usableInventoryStart"
style=
"width: 80px;margin-right: 5px"
placeholder=
""
v-model=
"createData.form.remarks"
type=
"textarea"
:rows=
"4"
clearable
clearable
></el-input>
placeholder=
"请输入备注"
></el-input>
-
<el-input
v-model=
"searchForm.usableInventoryEnd"
style=
"width: 80px;margin-left: 5px"
placeholder=
""
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"占用数"
>
<el-input
v-model=
"searchForm.occupyInventoryStart"
style=
"width: 80px;margin-right: 5px"
placeholder=
""
clearable
></el-input>
-
<el-input
v-model=
"searchForm.occupyInventoryEnd"
style=
"width: 80px;margin-left: 5px"
placeholder=
""
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"getData"
>
查询
</el-button>
<el-button
type=
"danger"
@
click=
"handleBatchDelete"
>
删除
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<
template
#
footer
>
</el-card>
<el-button
@
click=
"createData.show=false"
>
取消
</el-button>
</
template
>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
<
template
#
bottom
>
</
template
>
<el-card
style=
"height: 100%"
>
</el-dialog>
<div
class=
"manage"
>
</div>
<div
class=
"table-flex"
>
</el-card>
<div
class=
"left-table"
>
<div
class=
"table-container"
>
<el-table
height=
"100%"
:data=
"leftData"
border
@
selection-change=
"handleSelectionChange"
>
<el-table-column
align=
"center"
fixed
type=
"selection"
/>
<el-table-column
align=
"center"
fixed=
"left"
type=
"index"
label=
"序号"
width=
"60"
/>
<el-table-column
align=
"center"
prop=
"warehouse"
label=
"仓库"
width=
"150"
></el-table-column>
<el-table-column
align=
"center"
prop=
"category"
label=
"商品类别"
width=
"150"
></el-table-column>
<el-table-column
align=
"center"
prop=
"sku"
label=
"商品SKU"
width=
"150"
></el-table-column>
<el-table-column
align=
"center"
prop=
"productName"
label=
"商品名称"
width=
"200"
></el-table-column>
<el-table-column
align=
"center"
prop=
"unit"
label=
"单位"
width=
"100"
></el-table-column>
<el-table-column
align=
"center"
prop=
"costPrice"
label=
"商品成本价(¥)"
width=
"150"
></el-table-column>
<el-table-column
align=
"center"
prop=
"weight"
label=
"商品重量(克)"
width=
"150"
></el-table-column>
<el-table-column
align=
"center"
prop=
"availableQuantity"
label=
"可用数量"
width=
"120"
></el-table-column>
<el-table-column
align=
"center"
prop=
"inventoryQuantity"
label=
"库存数量"
width=
"120"
></el-table-column>
<el-table-column
align=
"center"
prop=
"occupyQuantity"
label=
"占用数量"
width=
"120"
></el-table-column>
<el-table-column
align=
"center"
prop=
"freezeQuantity"
label=
"冻结数量"
width=
"120"
></el-table-column>
<el-table-column
align=
"center"
prop=
"outOfStockQuantity"
label=
"缺货数量"
width=
"120"
></el-table-column>
<el-table-column
align=
"center"
prop=
"unreceivedPurchase"
label=
"采购未入库"
width=
"160"
></el-table-column>
<el-table-column
align=
"center"
prop=
"unshippedReturns"
label=
"退回未出库"
width=
"160"
></el-table-column>
<el-table-column
align=
"center"
prop=
"estimatedSalesDays"
label=
"预计销售天数"
width=
"160"
></el-table-column>
<el-table-column
align=
"center"
prop=
"longestOutOfStockDays"
label=
"最长缺货天数"
width=
"160"
></el-table-column>
<el-table-column
align=
"center"
prop=
"location"
label=
"库位"
width=
"150"
></el-table-column>
<el-table-column
align=
"center"
prop=
"status"
label=
"商品状态"
width=
"120"
></el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
align=
"center"
>
<template
#
default=
"
{row}">
<el-button
type=
"primary"
@
click=
"updateWarehouse(row)"
>
编辑
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<div
class=
"pagination"
>
<el-pagination
v-model:current-page=
"pagination.currentPage"
v-model:page-size=
"pagination.pageSize"
:page-sizes=
"[50, 100, 150, 200]"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"pagination.total"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
/>
</div>
</div>
</div>
</div>
</el-card>
</template>
</split-div>
</template>
</template>
...
...
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