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
63b7899c
Commit
63b7899c
authored
Nov 17, 2025
by
wusiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 备货计划页面1000860
parent
681244f3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
374 additions
and
171 deletions
+374
-171
public/files/stockingPlan.xlsx
+0
-0
public/files/warehousingEntry.xlsx
+0
-0
src/api/warehouse.ts
+33
-6
src/types/api/warehouse.ts
+6
-1
src/views/warehouse/stockingPlan.vue
+335
-164
No files found.
public/files/stockingPlan.xlsx
0 → 100644
View file @
63b7899c
File added
public/files/warehousingEntry.xlsx
View file @
63b7899c
No preview for this file type
src/api/warehouse.ts
View file @
63b7899c
...
...
@@ -11,7 +11,8 @@ import {
InterProductList
,
ExportInWarehouseInfo
,
stockingPlanSearchForm
,
InterStackingPlanDetail
InterStackingPlanDetail
,
InterWarehouseBase
}
from
'@/types/api/warehouse'
export
interface
LogListData
{
createTime
:
string
...
...
@@ -683,11 +684,36 @@ export function deleteStackingPlanApi(ids: string) {
},
)
}
// 备货计划 审核
export
function
auditStackingPlanApi
(
data
:
WarehouseParams
)
{
// 备货计划 更新物流单号
export
function
updateShipmentNumberApi
(
data
:
InterWarehouseBase
[])
{
return
axios
.
post
<
never
,
BaseRespData
<
never
>>
(
'factoryStockingPlanRecord/audit'
,
{
data
},
'factoryStockingPlanRecord/update_shipmentNumber'
,
{
stockingPlanRecordParamList
:
data
},
)
}
// 备货计划 导出
export
function
stackingPlanRecordExport
(
data
:
ExportInWarehouseInfo
)
{
return
axios
.
post
<
never
,
BasePaginationData
<
never
>>
(
'factoryStockingPlanRecord/export'
,
data
,
{
responseType
:
'blob'
,
},
)
}
// 备货计划 盘点
export
function
scanBoxCodeApi
(
boxCode
:
string
)
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
'factoryStockingPlanRecord/scan_box_code'
,
{
params
:
{
boxCode
},
},
)
}
// 备货计划 打印箱贴
export
function
printBarcodeApi
(
data
:
{
id
:
number
,
dataVersion
:
number
}[])
{
return
axios
.
post
<
never
,
BaseRespData
<
never
[]
>>
(
'factoryStockingPlanRecord/print_barcode'
,
data
,
)
}
\ No newline at end of file
src/types/api/warehouse.ts
View file @
63b7899c
...
...
@@ -21,6 +21,7 @@ export interface InterProductList {
productNo
?:
string
|
null
//custom的货号
buyStored
?:
number
|
null
//入库数量
outCount
?:
number
|
null
//出库数量
stockUpStored
?:
number
|
null
//备货数量
remark
?:
string
|
null
skuImage
?:
string
skuName
?:
string
...
...
@@ -80,6 +81,7 @@ export interface InterProductList {
productNo
?:
string
|
null
//货号
buyStored
?:
number
|
null
//入库数量
outCount
?:
number
|
null
//出库数量
stockUpStored
?:
number
|
null
//备货数量
usableInventory
?:
number
|
null
//可用库存数量
remark
?:
string
|
null
skuImage
?:
string
...
...
@@ -127,8 +129,11 @@ export interface stockingPlanSearchForm extends InterWarehouseBase {
warehouseSku
?:
string
}
// 备货计划
新增编辑
// 备货计划
export
interface
InterStackingPlanDetail
extends
InterWarehouseDetail
{
boxSum
?:
number
checkBoxSum
?:
number
box
?:
number
|
string
}
src/views/warehouse/stockingPlan.vue
View file @
63b7899c
...
...
@@ -109,8 +109,8 @@
<
/ElFormItem
>
<
ElFormItem
>
<
el
-
button
type
=
"success"
@
click
=
"handleExport"
>
导出
<
/el-butto
n
>
导出
<
/el-button
>
<
/ElFormItem
>
<
ElFormItem
v
-
if
=
"nodeCode === 'PENDING_SUBMIT'"
>
<
el
-
button
type
=
"primary"
@
click
=
"addDialog(1, null)"
>
...
...
@@ -118,8 +118,12 @@
<
/el-button
>
<
/ElFormItem
>
<
ElFormItem
v
-
if
=
"nodeCode === 'PENDING_AUDIT'"
>
<
el
-
button
type
=
"danger"
@
click
=
"rejectedInRecord"
>
<
ElFormItem
v
-
if
=
"
nodeCode === 'PENDING_AUDIT' || nodeCode === 'WAIT_SHIPMENT'
"
>
<
el
-
button
type
=
"danger"
@
click
=
"rejectedInRecord('record')"
>
驳回
<
/el-button
>
<
/ElFormItem
>
...
...
@@ -133,19 +137,39 @@
提交审核
<
/el-button
>
<
/ElFormItem
>
<
ElFormItem
>
<
el
-
button
type
=
"primary"
@
click
=
"printProductTag"
>
打印库存
SKU
标签
<
ElFormItem
v
-
if
=
"nodeCode === 'WAIT_SHIPMENT'"
>
<
el
-
button
type
=
"success"
@
click
=
"printProductTag"
>
打印箱贴
<
/el-button
>
<
/ElFormItem
>
<
ElFormItem
>
<
ElFormItem
v
-
if
=
"nodeCode === 'IN_TRANSIT'"
>
<
el
-
button
type
=
"primary"
@
click
=
"openUpdateShipmentNumberDialog"
>
更新物流单号
<
/el-button
>
<
/ElFormItem
>
<
ElFormItem
v
-
if
=
"nodeCode === 'IN_TRANSIT'"
>
<
el
-
button
type
=
"warning"
@
click
=
"auditOrder('toWaitLoadedCabinets')"
>
转至待卸柜
<
/el-button
>
<
/ElFormItem
>
<
ElFormItem
v
-
if
=
"nodeCode === 'WAIT_UNLOADED_CABINETS'"
>
<
ElButton
type
=
"warning"
@
click
=
"openScanDialog"
>
盘点
<
/ElButton
>
<
/ElFormItem
>
<
ElFormItem
v
-
if
=
"nodeCode === 'WAIT_INBOUND'"
>
<
el
-
button
v
-
if
=
"nodeCode === 'COMPLETED'"
type
=
"success"
@
click
=
"auditOrder('
archiving
')"
@
click
=
"auditOrder('
toWaitInbound
')"
>
归档
转至待上架
<
/el-button
>
<
/ElFormItem
>
<
/ElForm
>
...
...
@@ -229,7 +253,7 @@
<
ElTableColumn
label
=
"总金额"
show
-
overflow
-
tooltip
width
=
"1
2
0"
width
=
"1
0
0"
prop
=
"totalPrice"
header
-
align
=
"center"
align
=
"center"
...
...
@@ -238,7 +262,7 @@
label
=
"箱数"
header
-
align
=
"center"
prop
=
"boxSum"
width
=
"
9
0"
width
=
"
6
0"
align
=
"center"
show
-
overflow
-
tooltip
/>
...
...
@@ -246,7 +270,7 @@
label
=
"盘点箱数"
header
-
align
=
"center"
prop
=
"checkBoxSum"
width
=
"
9
0"
width
=
"
8
0"
align
=
"center"
show
-
overflow
-
tooltip
/>
...
...
@@ -285,7 +309,7 @@
<
ElTableColumn
label
=
"发货时间"
header
-
align
=
"center"
prop
=
"
shipment
Time"
prop
=
"
delivery
Time"
width
=
"130"
align
=
"center"
show
-
overflow
-
tooltip
...
...
@@ -293,7 +317,7 @@
<
ElTableColumn
label
=
"入库时间"
header
-
align
=
"center"
prop
=
"
delivery
Time"
prop
=
"
warehouse
Time"
width
=
"130"
align
=
"center"
show
-
overflow
-
tooltip
...
...
@@ -301,8 +325,9 @@
<
ElTableColumn
label
=
"驳回原因"
show
-
overflow
-
tooltip
prop
=
"reject
Reason
"
prop
=
"reject
Cause
"
header
-
align
=
"center"
width
=
"130"
align
=
"center"
/>
<
ElTableColumn
...
...
@@ -325,14 +350,24 @@
type
=
"primary"
link
@
click
=
"addDialog(2, row)"
>
编辑
>
编辑
<
/ElButton
>
<
ElButton
v
-
if
=
"nodeCode === 'PENDING_AUDIT'"
type
=
"warning"
link
@
click
=
"addDialog(3, row)"
>
审核
>
审核
<
/ElButton
>
<
ElButton
v
-
if
=
"nodeCode === 'WAIT_SHIPMENT'"
type
=
"success"
link
@
click
=
"addDialog(4, row)"
>
完成发货
<
/ElButton
>
<
/template
>
<
/ElTableColumn
>
...
...
@@ -433,13 +468,6 @@
<
ElTableColumn
show
-
overflow
-
tooltip
align
=
"center"
width
=
"240"
label
=
"备注"
prop
=
"remark"
/>
<
ElTableColumn
show
-
overflow
-
tooltip
align
=
"center"
label
=
"创建时间"
width
=
"130"
prop
=
"createTime"
...
...
@@ -447,9 +475,9 @@
<
ElTableColumn
show
-
overflow
-
tooltip
align
=
"center"
label
=
"更新时间
"
width
=
"130
"
prop
=
"
updateTime
"
width
=
"240
"
label
=
"备注
"
prop
=
"
remark
"
/>
<
/ElTable
>
<
/div
>
...
...
@@ -485,7 +513,7 @@
<
/div
>
<
ElDialog
v
-
model
=
"importDialogVisible"
title
=
"导入
入库
单"
title
=
"导入
备货
单"
width
=
"500px"
:
close
-
on
-
click
-
modal
=
"false"
>
...
...
@@ -494,8 +522,8 @@
<
UploadExcel
v
-
model
=
"importedFileUrl"
:
import
-
type
=
"'localAndXlsx'"
:
import
-
name
=
"'
入库
单'"
:
import
-
url
=
"'/files/
warehousingEntry
.xlsx'"
:
import
-
name
=
"'
备货
单'"
:
import
-
url
=
"'/files/
stockingPlan
.xlsx'"
@
imported
=
"handleLocalImport"
/>
<
/div
>
...
...
@@ -503,7 +531,7 @@
<
/ElDialog
>
<
ElDialog
v
-
model
=
"newDialogVisible"
:
title
=
"actionMap[currentAction - 1].label
+ '备货计划'
"
:
title
=
"actionMap[currentAction - 1].label"
width
=
"80%"
:
close
-
on
-
click
-
modal
=
"false"
>
...
...
@@ -542,7 +570,7 @@
<
ElInput
v
-
model
.
trim
=
"editForm.boxSum"
placeholder
=
"请输入箱数"
:
disabled
=
"currentAction === 3"
:
disabled
=
"currentAction === 3
|| currentAction === 4
"
style
=
"width: 160px"
clearable
/>
...
...
@@ -550,7 +578,7 @@
<
ElFormItem
label
=
"备注"
prop
=
"remark"
>
<
ElInput
v
-
model
.
trim
=
"editForm.remark"
:
disabled
=
"currentAction === 3"
:
disabled
=
"currentAction === 3
|| currentAction === 4
"
placeholder
=
"请输入备注"
style
=
"width: 160px"
clearable
...
...
@@ -611,7 +639,7 @@
<
template
#
default
=
"{ row
}
"
>
<
el
-
input
v
-
model
.
number
=
"row.stockUpStored"
:
disabled
=
"currentAction === 3"
:
disabled
=
"currentAction === 3
|| currentAction === 4
"
placeholder
=
"备货数量"
style
=
"width: 120px"
clearable
...
...
@@ -645,7 +673,7 @@
v
-
model
=
"row.locationId"
clearable
placeholder
=
"请输入库位"
:
disabled
=
"currentAction === 3"
:
disabled
=
"currentAction === 3
|| currentAction === 4
"
style
=
"width: 120px"
filterable
@
change
=
"handleLocationChange(row.locationId, row)"
...
...
@@ -671,7 +699,7 @@
v
-
model
.
trim
=
"row.remark"
clearable
size
=
"small"
:
disabled
=
"currentAction === 3"
:
disabled
=
"currentAction === 3
|| currentAction === 4
"
/>
<
/template
>
<
/ElTableColumn
>
...
...
@@ -679,14 +707,14 @@
<
/div
>
<
template
#
footer
>
<
div
class
=
"product-dialog-footer"
>
<
div
v
-
if
=
"currentAction !== 3"
>
<
div
v
-
if
=
"currentAction !== 3
&& currentAction !== 4
"
>
<
el
-
input
v
-
model
.
trim
=
"selectSku"
placeholder
=
"库存SKU"
style
=
"width: 200px; margin: 0 10px"
clearable
size
=
"small"
><
/el-input
>
/
>
<
el
-
popover
placement
=
"top-start"
width
=
"1000"
trigger
=
"click"
>
<
div
v
-
if
=
"skuData.length > 0"
style
=
"height: 50vh"
>
<
ElTable
size
=
"small"
:
data
=
"filterSkuData"
height
=
"100%"
border
>
...
...
@@ -799,24 +827,24 @@
导入
<
/el-button
>
<
/div
>
<
div
:
style
=
"{ margin: currentAction === 3 ? '0 auto' : ''
}
"
>
<
div
:
style
=
"{
margin: currentAction === 3 || currentAction === 4 ? '0 auto' : '',
}
"
>
<
el
-
button
size
=
"small"
@
click
=
"newDialogVisible = false"
>
取消
<
/el-button
>
<
el
-
button
v
-
if
=
"currentAction === 3"
v
-
if
=
"currentAction === 3
|| currentAction === 4
"
type
=
"danger"
size
=
"small"
@
click
=
"reject
InAudit
"
@
click
=
"reject
edInRecord('audit')
"
>
驳回
<
/el-button
>
<
el
-
button
type
=
"primary"
size
=
"small"
@
click
=
"currentAction === 2 ? addOtherCurrency : handleOudit"
>
保存
<
el
-
button
type
=
"primary"
size
=
"small"
@
click
=
"addOtherCurrency"
>
确认
<
/el-button
>
<
/div
>
<
/div
>
...
...
@@ -849,32 +877,11 @@
<
/ElDialog
>
<
el
-
dialog
v
-
model
=
"showPrintDialog"
title
=
"打印参数设置"
>
<
el
-
table
height
=
"400px"
:
data
=
"printData"
border
>
<
el
-
table
-
column
width
=
"60"
align
=
"center"
type
=
"index"
label
=
"序号"
><
/el-table-column
>
<
el
-
table
-
column
align
=
"center"
prop
=
"skuName"
label
=
"商品名称"
><
/el-table-column
>
<
el
-
table
-
column
align
=
"center"
prop
=
"warehouseSku"
label
=
"库存SKU"
><
/el-table-column
>
<
el
-
table
-
column
align
=
"center"
prop
=
"locationName"
label
=
"库位编码"
><
/el-table-column
>
<
el
-
table
-
column
align
=
"center"
prop
=
"supplierItemNo"
label
=
"款号"
><
/el-table-column
>
<
el
-
table
-
column
width
=
"60"
align
=
"center"
type
=
"index"
label
=
"序号"
/>
<
el
-
table
-
column
align
=
"center"
prop
=
"skuName"
label
=
"商品名称"
/>
<
el
-
table
-
column
align
=
"center"
prop
=
"warehouseSku"
label
=
"库存SKU"
/>
<
el
-
table
-
column
align
=
"center"
prop
=
"locationName"
label
=
"库位编码"
/>
<
el
-
table
-
column
align
=
"center"
prop
=
"supplierItemNo"
label
=
"款号"
/>
<
el
-
table
-
column
align
=
"center"
prop
=
"number"
label
=
"打印数量"
>
<
template
#
default
=
"{ row
}
"
>
<
el
-
input
...
...
@@ -918,6 +925,60 @@
<
/span
>
<
/template
>
<
/ElDialog
>
<
ElDialog
v
-
model
=
"updateShipmentNumberVisible"
title
=
"更新物流单号"
width
=
"500px"
>
<
ElTable
:
data
=
"updateShipmentNumberForm"
border
>
<
ElTableColumn
prop
=
"inNo"
label
=
"备货单号"
/>
<
ElTableColumn
prop
=
"shipmentNumber"
label
=
"物流单号"
>
<
template
#
default
=
"{ row
}
"
>
<
el
-
input
v
-
model
=
"row.shipmentNumber"
clearable
placeholder
=
"请输入物流单号"
/>
<
/template
>
<
/ElTableColumn
>
<
/ElTable
>
<
template
#
footer
>
<
el
-
button
@
click
=
"updateShipmentNumberVisible = false"
>
取消
<
/el-button
>
<
el
-
button
type
=
"primary"
@
click
=
"updateShipmentNumber"
>
确认
<
/el-button
>
<
/template
>
<
/ElDialog
>
<
ElDialog
v
-
model
=
"scanDialogVisible"
width
=
"800px"
title
=
"盘点"
>
<
el
-
input
v
-
model
=
"scanInput"
placeholder
=
"请输入备货单号"
style
=
"width: 90%"
clearable
@
keyup
.
enter
=
"scan"
/>
<
el
-
button
type
=
"primary"
style
=
"margin-left: 10px"
@
click
=
"scan"
>
查询
<
/el-button
>
<
el
-
descriptions
style
=
"margin-top: 50px"
>
<
el
-
descriptions
-
item
label
=
"备货仓库"
>
{{
scanData
.
warehouseName
||
'-'
}}
<
/el-descriptions-item
>
<
el
-
descriptions
-
item
label
=
"备货单号"
>
{{
scanData
.
inNo
||
'-'
}}
<
/el-descriptions-item
>
<
el
-
descriptions
-
item
label
=
"物流单号"
>
{{
scanData
.
shipmentNumber
||
'-'
}}
<
/el-descriptions-item
>
<
el
-
descriptions
-
item
label
=
"当前箱子"
>
{{
scanData
.
box
||
'-'
}}
<
/el-descriptions-item
>
<
el
-
descriptions
-
item
label
=
"箱数"
>
{{
scanData
.
boxSum
||
'-'
}}
<
/el-descriptions-item
>
<
el
-
descriptions
-
item
label
=
"盘点箱数"
>
{{
scanData
.
checkBoxSum
||
'-'
}}
<
/el-descriptions-item
>
<
/el-descriptions
>
<
/ElDialog
>
<
/template
>
<
script
setup
lang
=
"ts"
>
...
...
@@ -943,10 +1004,11 @@ import {
rejectStackingPlanApi
,
LogListData
,
warehouseInfo
,
InRecordBatchCheckPrint
Api
,
printBarcode
Api
,
factoryWarehouseInventoryPrint
,
warehouseInRecordExport
,
auditStackingPlanApi
,
stackingPlanRecordExport
,
updateShipmentNumberApi
,
scanBoxCodeApi
,
}
from
'@/api/warehouse'
import
{
filePath
}
from
'@/api/axios.ts'
import
BigNumber
from
'bignumber.js'
...
...
@@ -960,6 +1022,7 @@ import {
InterskuList
,
ILocation
,
InterStackingPlanDetail
,
InterWarehouseBase
,
}
from
'@/types/api/warehouse'
import
ImageView
from
'@/components/ImageView.vue'
import
UploadExcel
from
'@/components/UploadExcel.vue'
...
...
@@ -1087,7 +1150,9 @@ function getStartTime() {
}
const
selectSku
=
ref
(
''
)
const
treeData
=
ref
<
InterWarehouseTree
[]
>
()
const
[
searchForm
,
resetSearchForm
]
=
useValue
<
stockingPlanSearchForm
>
({
}
)
const
[
searchForm
,
resetSearchForm
]
=
useValue
<
stockingPlanSearchForm
>
({
dateStr
:
'createTime'
,
}
)
const
tradingTime
=
ref
<
string
[]
>
([])
const
selections
=
ref
<
InterWarehousePage
[]
>
([])
...
...
@@ -1122,7 +1187,7 @@ const {
getStackingPlanListPage
(
{
...
searchForm
.
value
,
billStatus
:
nodeCode
.
value
==
'all'
?
'
all
'
:
nodeCode
.
value
,
billStatus
:
nodeCode
.
value
==
'all'
?
''
:
nodeCode
.
value
,
startDate
:
tradingTime
.
value
&&
tradingTime
.
value
[
0
],
endDate
:
tradingTime
.
value
&&
tradingTime
.
value
[
1
],
}
,
...
...
@@ -1137,9 +1202,11 @@ const setCostPrice = (item: InterProductList) => {
return
}
if
(
item
)
{
const
buyStored
=
item
.
buy
Stored
??
0
const
stockUpStored
=
item
.
stockUp
Stored
??
0
const
costPrice
=
item
.
costPrice
??
0
const
amount
=
new
BigNumber
(
buyStored
).
multipliedBy
(
costPrice
).
toFixed
(
2
)
const
amount
=
new
BigNumber
(
stockUpStored
)
.
multipliedBy
(
costPrice
)
.
toFixed
(
2
)
item
.
totalPrice
=
Number
(
amount
)
}
}
...
...
@@ -1157,22 +1224,37 @@ const getTreeNum = async () => {
}
const
showPrintDialog
=
ref
(
false
)
const
printData
=
ref
([])
// const printProductTag = async () =>
{
// if (!selections.value.length)
{
// return ElMessage.warning('请选择要操作的数据')
//
}
// const str = selections.value.map((el: InterWarehousePage) => el.id).join(',')
// try
{
// const res = await printBarcodeApi(str)
// if (res.code === 200)
{
// printData.value = res.data
// showPrintDialog.value = true
//
}
else
{
// ElMessage.error(res.message)
//
}
//
}
catch
(
e
)
{
// console.error(e)
//
}
//
}
const
printProductTag
=
async
()
=>
{
if
(
!
selections
.
value
.
length
)
{
return
ElMessage
.
warning
(
'请选择要操作的数据'
)
}
const
str
=
selections
.
value
.
map
((
el
:
InterWarehousePage
)
=>
el
.
id
).
join
(
','
)
try
{
const
res
=
await
InRecordBatchCheckPrintApi
(
str
)
if
(
res
.
code
===
200
)
{
printData
.
value
=
res
.
data
showPrintDialog
.
value
=
true
}
else
{
ElMessage
.
error
(
res
.
message
)
}
}
catch
(
e
)
{
console
.
error
(
e
)
}
const
str
:
{
id
:
number
;
dataVersion
:
number
}
[]
=
selections
.
value
.
map
(
(
el
:
InterWarehousePage
)
=>
({
id
:
el
.
id
??
0
,
dataVersion
:
el
.
dataVersion
??
0
,
}
),
)
const
res
=
await
printBarcodeApi
(
str
)
showPrintDialog
.
value
=
false
window
.
open
(
filePath
+
res
.
message
,
'_blank'
)
}
async
function
handlePrintProductTag
()
{
...
...
@@ -1291,6 +1373,7 @@ const handleLocalImport = async ({
return
obj
}
)
.
filter
((
item
)
=>
item
.
warehouseSku
)
// console.log('@', importedData, data)
if
(
importedData
.
length
===
0
)
{
ElMessage
.
warning
(
'导入数据中没有有效的商品SKU'
)
...
...
@@ -1321,16 +1404,17 @@ const handleLocalImport = async ({
warehouseSku
:
skuItem
.
sku
,
skuName
:
skuItem
.
skuName
,
productNo
:
skuItem
.
productNo
,
locationCode
:
target
?.
locationCode
??
''
,
locationCode
:
importedItem
?.
locationCode
??
null
,
locationId
:
target
?.
locationId
,
costPrice
:
skuItem
.
factoryPrice
,
buyStored
:
importedItem
?.
buyStored
??
null
,
totalPrice
:
new
BigNumber
(
(
importedItem
?.
buy
Stored
??
0
)
as
number
|
string
,
(
importedItem
?.
stockUp
Stored
??
0
)
as
number
|
string
,
)
.
multipliedBy
(
skuItem
.
factoryPrice
??
0
)
.
toNumber
(),
usableInventory
:
skuItem
.
usableInventory
,
stockUpStored
:
importedItem
?.
stockUpStored
??
null
,
remark
:
importedItem
?.
remark
??
null
,
}
as
InterProductList
// 明确类型
}
)
...
...
@@ -1366,23 +1450,31 @@ const submitExportForm = async () => {
}
else
if
(
resourceType
===
2
)
{
purchaseIds
=
''
exportTotal
=
total
.
value
params
.
billStatus
=
nodeCode
.
value
==
'all'
?
'
all
'
:
nodeCode
.
value
params
.
billStatus
=
nodeCode
.
value
==
'all'
?
''
:
nodeCode
.
value
}
params
.
idList
=
purchaseIds
if
(
exportTotal
!==
undefined
)
{
params
.
total
=
exportTotal
}
try
{
const
res
=
await
warehouseInRecordExport
({
showDetail
:
exportForm
.
value
.
delivery
,
...
params
,
...
searchForm
.
value
,
stackingPlanRecordExport
({
showDetail
:
exportForm
.
value
.
delivery
,
...
params
,
...
searchForm
.
value
,
}
)
.
then
((
res
)
=>
{
const
blob
=
new
Blob
([
res
as
unknown
as
BlobPart
],
{
type
:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
,
}
)
const
filename
=
`备货计划_${new Date().getTime()
}
.xlsx`
const
link
=
document
.
createElement
(
'a'
)
link
.
href
=
window
.
URL
.
createObjectURL
(
blob
)
link
.
download
=
filename
link
.
click
()
window
.
URL
.
revokeObjectURL
(
link
.
href
)
}
)
.
finally
(()
=>
{
exportVisible
.
value
=
false
}
)
window
.
open
(
filePath
+
res
.
message
,
'_blank'
)
exportVisible
.
value
=
false
}
catch
(
e
)
{
exportVisible
.
value
=
false
}
}
const
getWarehouseList
=
async
()
=>
{
try
{
...
...
@@ -1487,19 +1579,19 @@ const editFormRef = ref()
const
editForm2
=
ref
({
}
)
const
formId
=
ref
<
number
|
undefined
>
(
undefined
)
const
actionMap
=
[
{
label
:
'新增'
,
value
:
1
}
,
{
label
:
'编辑'
,
value
:
2
}
,
{
label
:
'审核'
,
value
:
3
}
,
{
label
:
'新增备货计划'
,
value
:
1
}
,
{
label
:
'编辑备货计划'
,
value
:
2
}
,
{
label
:
'备货计划审核'
,
value
:
3
}
,
{
label
:
'完成发货'
,
value
:
4
}
,
]
const
currentAction
=
ref
<
number
>
(
1
)
const
otherPurchaseData
=
ref
<
InterProductList
[]
>
([])
const
addDialog
=
async
(
i
:
number
,
v
:
InterWarehousePage
|
null
)
=>
{
currentAction
.
value
=
i
if
(
i
===
2
||
i
===
3
)
{
if
(
i
!==
1
)
{
if
(
v
)
formId
.
value
=
v
.
id
if
(
v
)
getProduct
(
v
.
id
)
if
(
!
formId
.
value
)
return
ElMessage
(
'请勾选至少一条记录'
)
// editForm.value = JSON.parse(JSON.stringify(v))
}
else
{
await
nextTick
()
editForm
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
editForm2
.
value
))
...
...
@@ -1528,6 +1620,7 @@ const addDialog = async (i: number, v: InterWarehousePage | null) => {
selectSku
.
value
=
''
newDialogVisible
.
value
=
true
}
const
getProduct
=
async
(
id
:
number
|
undefined
)
=>
{
try
{
const
res
=
await
getStackingPlanDetailApi
(
id
)
...
...
@@ -1544,27 +1637,32 @@ const otherWarehouseSelection = ref<InterProductList[]>([])
const
productSelectionChange
=
(
v
:
InterProductList
[])
=>
{
otherWarehouseSelection
.
value
=
v
}
const
auditOrder
=
(
key
:
string
)
=>
{
const
auditOrder
=
async
(
key
:
string
)
=>
{
if
(
selections
.
value
.
length
===
0
)
{
return
ElMessage
.
warning
(
'请选择要操作的数据'
)
}
let
url
=
''
let
text
=
''
switch
(
key
)
{
case
'archiving'
:
url
=
'factory/warehouseInRecord/archive'
text
=
'归档'
break
case
'submitAudit'
:
url
=
'factoryStockingPlanRecord/submit_audit'
text
=
'提交审核'
break
case
'toWaitLoadedCabinets'
:
url
=
'factoryStockingPlanRecord/to_wait_unloaded_cabinets'
text
=
'转至待卸柜'
break
case
'toWaitInbound'
:
url
=
'factoryStockingPlanRecord/to_wait_inbound'
text
=
'转至待上架'
break
}
const
confimText
=
`确定对选中的信息进行${text
}
?`
ElMessageBox
.
confirm
(
confimText
,
'重要提示'
,
{
await
ElMessageBox
.
confirm
(
confimText
,
'重要提示'
,
{
confirmButtonText
:
'确定'
,
type
:
'warning'
,
}
).
then
(
async
()
=>
{
}
)
try
{
const
data
=
selections
.
value
.
map
(
({
id
,
dataVersion
}
:
InterWarehousePage
)
=>
({
id
,
...
...
@@ -1575,49 +1673,18 @@ const auditOrder = (key: string) => {
ElMessage
.
success
(
'操作成功'
)
search
()
await
getTreeNum
()
}
)
}
const
handleOudit
=
async
()
=>
{
await
auditStackingPlanApi
({
id
:
currentRow
.
value
?.
id
,
dataVersion
:
currentRow
.
value
?.
dataVersion
,
}
)
ElMessage
.
success
(
'操作成功'
)
search
()
await
getTreeNum
()
}
catch
(
e
)
{
console
.
error
(
e
)
}
}
const
rejectInAudit
=
()
=>
{
ElMessageBox
.
prompt
(
'请输入驳回原因'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
inputPattern
:
/.+/
,
customClass
:
'reject'
,
inputErrorMessage
:
'请输入驳回原因'
,
inputPlaceholder
:
'驳回原因'
,
}
).
then
(
async
({
value
}
:
{
value
:
string
}
)
=>
{
const
data
=
[
currentRow
.
value
as
InterProductList
]
try
{
await
rejectStackingPlanApi
({
list
:
data
,
rejectReason
:
value
,
status
:
nodeCode
.
value
,
}
)
ElMessage
.
success
(
'操作成功'
)
newDialogVisible
.
value
=
false
search
()
await
getTreeNum
()
}
catch
(
e
)
{
console
.
error
(
e
)
const
rejectedInRecord
=
(
type
:
'audit'
|
'record'
)
=>
{
if
(
type
===
'record'
)
{
if
(
selections
.
value
.
length
===
0
)
{
return
ElMessage
.
warning
(
'请选择要操作的数据'
)
}
}
)
}
const
rejectedInRecord
=
()
=>
{
if
(
selections
.
value
.
length
===
0
)
{
return
ElMessage
.
warning
(
'请选择要操作的数据'
)
}
ElMessageBox
.
prompt
(
'请输入驳回原因'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
...
...
@@ -1697,10 +1764,39 @@ const addOtherCurrency = async () => {
arr
[
i
].
locationCode
=
found
?
found
?.
locationCode
:
''
}
}
if
(
!
formId
.
value
)
{
addSection
()
}
else
{
upSection
()
let
url
=
''
switch
(
nodeCode
.
value
)
{
// 新增
case
'PENDING_SUBMIT'
:
if
(
!
formId
.
value
)
{
addSection
()
}
else
{
upSection
()
}
return
// 审核
case
'PENDING_AUDIT'
:
url
=
'factoryStockingPlanRecord/audit'
break
// 完成发货
case
'WAIT_SHIPMENT'
:
url
=
'factoryStockingPlanRecord/complete_shipment'
break
}
try
{
console
.
log
(
currentRow
.
value
)
const
data
=
[
{
id
:
currentRow
.
value
?.
id
,
dataVersion
:
currentRow
.
value
?.
dataVersion
}
,
]
as
InterWarehousePage
[]
await
auditOrderApi
(
url
,
data
)
newDialogVisible
.
value
=
false
ElMessage
.
success
(
'操作成功'
)
search
()
await
getTreeNum
()
}
catch
(
e
)
{
console
.
error
(
e
)
}
}
...
...
@@ -1737,7 +1833,7 @@ const upSection = async () => {
)
try
{
await
updateStackingPlanApi
(
result
as
InterStackingPlanDetail
)
await
updateStackingPlanApi
(
result
as
unknown
as
InterStackingPlanDetail
)
newDialogVisible
.
value
=
false
ElMessage
.
success
(
'修改成功'
)
search
()
...
...
@@ -1890,6 +1986,81 @@ const handleWarehouseChange = (val: number | string | undefined) => {
editForm
.
value
.
warehouseName
=
found
?
found
.
name
:
''
}
// 更新物流单号
const
updateShipmentNumberVisible
=
ref
(
false
)
const
updateShipmentNumberForm
=
ref
<
InterWarehouseBase
[]
>
([
{
inNo
:
''
,
shipmentNumber
:
''
,
warehouseId
:
''
,
id
:
0
,
}
,
])
// 打开更新物流单号弹窗
const
openUpdateShipmentNumberDialog
=
()
=>
{
if
(
selections
.
value
.
length
===
0
)
{
return
ElMessage
.
warning
(
'请选择要操作的数据'
)
}
updateShipmentNumberForm
.
value
=
selections
.
value
.
map
(
(
item
:
InterWarehousePage
)
=>
{
return
{
inNo
:
item
.
inNo
,
shipmentNumber
:
item
.
shipmentNumber
,
warehouseId
:
item
.
warehouseId
,
id
:
item
.
id
,
}
}
,
)
updateShipmentNumberVisible
.
value
=
true
}
// 更新物流单号
const
updateShipmentNumber
=
async
()
=>
{
try
{
await
updateShipmentNumberApi
(
updateShipmentNumberForm
.
value
as
InterWarehouseBase
[],
)
updateShipmentNumberVisible
.
value
=
false
ElMessage
.
success
(
'更新成功'
)
search
()
await
getTreeNum
()
}
catch
(
e
)
{
console
.
error
(
e
)
}
}
// 盘点
const
scanDialogVisible
=
ref
(
false
)
const
scanInput
=
ref
(
''
)
const
scanData
=
ref
<
InterStackingPlanDetail
>
({
}
as
InterStackingPlanDetail
)
const
openScanDialog
=
()
=>
{
scanInput
.
value
=
''
scanData
.
value
=
{
}
as
InterStackingPlanDetail
scanDialogVisible
.
value
=
true
}
// 扫码盘点
const
scan
=
async
()
=>
{
if
(
!
scanInput
.
value
)
{
return
ElMessage
.
warning
(
'请输入备货单号'
)
}
const
loading
=
ElLoading
.
service
({
lock
:
true
,
text
:
'加载中...'
,
background
:
'rgba(0, 0, 0, 0.7)'
,
}
)
try
{
const
res
=
await
scanBoxCodeApi
(
scanInput
.
value
)
if
(
res
.
code
===
200
)
{
scanData
.
value
=
res
.
data
}
else
{
ElMessage
.
error
(
res
.
message
)
}
}
catch
(
e
)
{
console
.
error
(
e
)
}
finally
{
loading
.
close
()
scanInput
.
value
=
''
}
}
/**
* @description: 页面添加回车监听
*/
...
...
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