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
e6f88fe5
Commit
e6f88fe5
authored
Sep 04, 2025
by
wusiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 入库单出库单优化
parent
c17bd18e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
20 deletions
+33
-20
public/files/outboundOrder.xlsx
+0
-0
src/api/warehouse.ts
+3
-5
src/views/warehouse/issueDoc.vue
+19
-11
src/views/warehouse/receiptDoc.vue
+11
-4
No files found.
public/files/outboundOrder.xlsx
View file @
e6f88fe5
No preview for this file type
src/api/warehouse.ts
View file @
e6f88fe5
...
...
@@ -508,13 +508,11 @@ export function getBySkuAndWarehouseIdApi(
warehouseId
:
number
|
string
|
undefined
,
sku
:
string
|
null
,
)
{
return
axios
.
ge
t
<
never
,
BaseRespData
<
InterskuList
[]
>>
(
return
axios
.
pos
t
<
never
,
BaseRespData
<
InterskuList
[]
>>
(
'factoryWarehouseInventory/getBySkuAndWarehouseId'
,
{
params
:
{
warehouseId
,
sku
,
},
warehouseId
,
sku
,
},
)
}
...
...
src/views/warehouse/issueDoc.vue
View file @
e6f88fe5
...
...
@@ -467,6 +467,13 @@
><
/ElTableColumn
>
<
ElTableColumn
show
-
overflow
-
tooltip
width
=
"60"
align
=
"center"
label
=
"序号"
type
=
"index"
><
/ElTableColumn
>
<
ElTableColumn
show
-
overflow
-
tooltip
align
=
"center"
width
=
"100"
label
=
"SKU图片"
...
...
@@ -1097,7 +1104,7 @@ const batchAddCommodity = async (sku: string): Promise<InterskuList[]> => {
interface
InterImportData
{
warehouseSku
:
string
remark
?:
string
|
null
buyStored
?:
string
|
number
|
null
|
object
// 扩大 buyStored
类型,以兼容原始数据
outCount
?:
string
|
number
|
null
|
object
// 扩大 outCount
类型,以兼容原始数据
[
propName
:
string
]:
string
|
number
|
boolean
|
undefined
|
unknown
}
// 前端导入Excel
...
...
@@ -1105,7 +1112,7 @@ const excelFieldMap: Record<string, keyof InterImportData> = {
// SKU图片: 'skuImage',
库存
SKU
:
'warehouseSku'
,
// SKU名称: 'skuName',
//
出库数量: 'outCount',
出库数量
:
'outCount'
,
// 可用库存数量: 'usableInventory',
// '成本价(¥)': 'costPrice',
// '总成本(¥)': 'totalPrice',
...
...
@@ -1136,8 +1143,8 @@ const handleLocalImport = async ({
:
value
===
null
||
value
===
undefined
?
null
:
String
(
value
)
}
else
if
(
field
===
'
buyStored
'
)
{
// 处理
buyStored
: 确保它是一个数字、数字字符串,否则设置为 null
}
else
if
(
field
===
'
outCount
'
)
{
// 处理
outCount
: 确保它是一个数字、数字字符串,否则设置为 null
if
(
typeof
value
===
'number'
)
{
obj
[
field
]
=
String
(
value
)
// 将数字转换为字符串
}
else
if
(
typeof
value
===
'string'
&&
!
isNaN
(
Number
(
value
)))
{
...
...
@@ -1180,18 +1187,19 @@ const handleLocalImport = async ({
)
let
outCountValueForBigNumber
:
string
|
number
=
'0'
// 初始化为安全默认值
console
.
log
(
importedItem
)
if
(
importedItem
?.
buyStored
!==
null
&&
importedItem
?.
buyStored
!==
undefined
importedItem
?.
outCount
!==
null
&&
importedItem
?.
outCount
!==
undefined
)
{
if
(
typeof
importedItem
.
buyStored
===
'string'
&&
!
isNaN
(
Number
(
importedItem
.
buyStored
))
typeof
importedItem
.
outCount
===
'string'
&&
!
isNaN
(
Number
(
importedItem
.
outCount
))
)
{
outCountValueForBigNumber
=
importedItem
.
buyStored
}
else
if
(
typeof
importedItem
.
buyStored
===
'number'
)
{
outCountValueForBigNumber
=
importedItem
.
buyStored
outCountValueForBigNumber
=
importedItem
.
outCount
}
else
if
(
typeof
importedItem
.
outCount
===
'number'
)
{
outCountValueForBigNumber
=
importedItem
.
outCount
}
else
{
// 如果是对象或其他意外类型,则默认为 '0'
outCountValueForBigNumber
=
'0'
...
...
src/views/warehouse/receiptDoc.vue
View file @
e6f88fe5
...
...
@@ -490,6 +490,13 @@
><
/ElTableColumn
>
<
ElTableColumn
show
-
overflow
-
tooltip
width
=
"60"
align
=
"center"
label
=
"序号"
type
=
"index"
><
/ElTableColumn
>
<
ElTableColumn
show
-
overflow
-
tooltip
align
=
"center"
width
=
"100"
label
=
"SKU图片"
...
...
@@ -1706,10 +1713,10 @@ const fetchLocationList = async (query: string) => {
}
}
)
if
(
otherPurchaseData
.
value
?.
length
>
0
)
{
//const importedSkus = otherPurchaseData.value.map((item) => item.warehouseSku).join(',')
// // 3. 调用 batchAddCommodity 获取商品的完整信息并过滤掉已有的 SKU
// const filteredSkusList = await batchAddCommodity(importedSkus)
// console.log('filteredSkusList', otherPurchaseData.value)
//const importedSkus = otherPurchaseData.value.map((item) => item.warehouseSku).join(',')
// // 3. 调用 batchAddCommodity 获取商品的完整信息并过滤掉已有的 SKU
// const filteredSkusList = await batchAddCommodity(importedSkus)
// console.log('filteredSkusList', otherPurchaseData.value)
// 新增时切换仓库将重新匹配表格库位,确保该商品的库位和仓库一一对应
otherPurchaseData
.
value
=
otherPurchaseData
.
value
.
map
(
(
item
:
InterProductList
)
=>
{
...
...
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