Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weiqiao-vue
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
0
Merge Requests
0
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
金民
weiqiao-vue
Commits
15ab89c5
Commit
15ab89c5
authored
Feb 03, 2026
by
史雅文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
库存盘点新增弹窗添加筛选
parent
d02b3597
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
43 deletions
+127
-43
xjrsoft-vue3/.env.development
+2
-2
xjrsoft-vue3/src/api/ckgl/kcpd/index.ts
+36
-31
xjrsoft-vue3/src/api/ckgl/kcpd/model/KcpdModel.ts
+17
-0
xjrsoft-vue3/src/views/ckgl/kcpd/components/KcpdModal.vue
+1
-1
xjrsoft-vue3/src/views/ckgl/kcpd/components/config.ts
+71
-9
No files found.
xjrsoft-vue3/.env.development
View file @
15ab89c5
...
...
@@ -9,14 +9,14 @@ VITE_PUBLIC_PATH = /
# 可以有多个,注意多个不能换行,否则代理将会失效
# VITE_PROXY = [["/basic-api","http://localhost:3000"],["/upload","http://localhost:3300/upload"]]
# VITE_PROXY=[["/api","https://vvbin.cn/test"]]
VITE_PROXY = [["/system","http://192.168.8.1
49:8053"],["/language","http://192.168.8.149:8053"],["/api","http://192.168.8.1
49:8053"]]
VITE_PROXY = [["/system","http://192.168.8.1
06:8053"],["/language","http://192.168.8.49:8053"],["/api","http://192.168.8.
49:8053"]]
# 是否删除Console.log
VITE_DROP_CONSOLE = false
# 接口地址
# 如果没有跨域问题,直接在这里配置即可
VITE_GLOB_API_URL=http://192.168.8.
100
:8053
VITE_GLOB_API_URL=http://192.168.8.
49
:8053
# 文件上传接口 可选
VITE_GLOB_UPLOAD_URL = /system/oss/upload
...
...
xjrsoft-vue3/src/api/ckgl/kcpd/index.ts
View file @
15ab89c5
import
{
MesWarehouseInventoryPageModel
,
MesWarehouseInventoryPageParams
,
MesWarehouseInventoryPageResult
}
from
'./model/KcpdModel'
;
import
{
InventoryFilterParams
,
InventoryItem
,
MesWarehouseInventoryPageModel
,
MesWarehouseInventoryPageParams
,
MesWarehouseInventoryPageResult
,
}
from
'./model/KcpdModel'
;
import
{
defHttp
}
from
'/@/utils/http/axios'
;
import
{
ErrorMessageMode
}
from
'/#/axios'
;
...
...
@@ -8,16 +13,14 @@ enum Api {
List
=
'/ckgl/kcpd/list'
,
Info
=
'/ckgl/kcpd/info'
,
MesWarehouseInventory
=
'/ckgl/kcpd'
,
Inventory
=
'/ckgl/kczb/Inventory'
,
Export
=
'/ckgl/kcpd/export'
,
}
/**
* @description: 查询MesWarehouseInventory分页列表
*/
export
async
function
getMesWarehouseInventoryPage
(
params
:
MesWarehouseInventoryPageParams
,
mode
:
ErrorMessageMode
=
'modal'
)
{
export
async
function
getMesWarehouseInventoryPage
(
params
:
MesWarehouseInventoryPageParams
,
mode
:
ErrorMessageMode
=
'modal'
,
)
{
return
defHttp
.
get
<
MesWarehouseInventoryPageResult
>
(
{
url
:
Api
.
Page
,
...
...
@@ -29,9 +32,6 @@ export async function getMesWarehouseInventoryPage(params: MesWarehouseInventory
);
}
/**
* @description: 获取MesWarehouseInventory信息
*/
export
async
function
getMesWarehouseInventory
(
id
:
String
,
mode
:
ErrorMessageMode
=
'modal'
)
{
return
defHttp
.
get
<
MesWarehouseInventoryPageModel
>
(
{
...
...
@@ -44,10 +44,10 @@ export async function getMesWarehouseInventory(id: String, mode: ErrorMessageMod
);
}
/**
* @description: 新增MesWarehouseInventory
*/
export
async
function
addMesWarehouseInventory
(
mesWarehouseInventory
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
)
{
export
async
function
addMesWarehouseInventory
(
mesWarehouseInventory
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
,
)
{
return
defHttp
.
post
<
boolean
>
(
{
url
:
Api
.
MesWarehouseInventory
,
...
...
@@ -59,10 +59,10 @@ export async function addMesWarehouseInventory(mesWarehouseInventory: Recordable
);
}
/**
* @description: 更新MesWarehouseInventory
*/
export
async
function
updateMesWarehouseInventory
(
mesWarehouseInventory
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
)
{
export
async
function
updateMesWarehouseInventory
(
mesWarehouseInventory
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
,
)
{
return
defHttp
.
put
<
boolean
>
(
{
url
:
Api
.
MesWarehouseInventory
,
...
...
@@ -74,9 +74,6 @@ export async function updateMesWarehouseInventory(mesWarehouseInventory: Recorda
);
}
/**
* @description: 删除MesWarehouseInventory(批量删除)
*/
export
async
function
deleteMesWarehouseInventory
(
ids
:
string
[],
mode
:
ErrorMessageMode
=
'modal'
)
{
return
defHttp
.
delete
<
boolean
>
(
{
...
...
@@ -89,14 +86,9 @@ export async function deleteMesWarehouseInventory(ids: string[], mode: ErrorMess
);
}
/**
* @description: 导出MesWarehouseInventory
*/
export
async
function
exportMesWarehouseInventory
(
params
?:
object
,
mode
:
ErrorMessageMode
=
'modal'
params
?:
object
,
mode
:
ErrorMessageMode
=
'modal'
,
)
{
return
defHttp
.
download
(
{
...
...
@@ -110,5 +102,18 @@ export async function exportMesWarehouseInventory(
},
);
}
export
async
function
getInventoryByFilter
(
params
:
InventoryFilterParams
,
mode
:
ErrorMessageMode
=
'modal'
,
)
{
return
defHttp
.
post
<
{
data
:
InventoryItem
[];
success
:
boolean
;
msg
?:
string
;
code
?:
number
}
>
(
{
url
:
Api
.
Inventory
,
data
:
params
,
},
{
errorMessageMode
:
mode
,
},
);
}
xjrsoft-vue3/src/api/ckgl/kcpd/model/KcpdModel.ts
View file @
15ab89c5
...
...
@@ -212,3 +212,20 @@ export interface MesWarehouseInventoryRelaModel {
* @description: MesWarehouseInventory分页返回值结构
*/
export
type
MesWarehouseInventoryPageResult
=
BasicFetchResult
<
MesWarehouseInventoryPageModel
>
;
export
interface
InventoryFilterParams
{
ckwz
:
string
[];
cplx
:
string
[];
cp
:
string
[];
}
export
interface
InventoryItem
{
id
:
string
;
cpmc
:
string
;
cplx
:
string
;
ck
:
string
;
hw
:
string
;
pch
:
string
;
pdsl
:
number
|
null
;
zbid
:
string
;
}
xjrsoft-vue3/src/views/ckgl/kcpd/components/KcpdModal.vue
View file @
15ab89c5
...
...
@@ -148,7 +148,7 @@
function
customClick
(
item
)
{
if
(
item
.
key
==
'confirm'
)
{
handleSubmit
();
}
else
if
(
item
.
key
==
'cancel'
&&
props
.
formType
!==
'normal'
)
{
}
else
if
(
item
.
key
==
'cancel'
)
{
handleClose
();
closeModal
();
}
else
if
(
item
.
key
==
'reset'
)
{
...
...
xjrsoft-vue3/src/views/ckgl/kcpd/components/config.ts
View file @
15ab89c5
import
{
FormProps
,
FormSchema
}
from
'/@/components/Form'
;
import
{
BasicColumn
}
from
'/@/components/Table'
;
import
{
getInventoryByFilter
}
from
'/@/api/ckgl/kcpd'
;
import
type
{
InventoryFilterParams
,
InventoryItem
}
from
'/@/api/ckgl/kcpd/model/KcpdModel'
;
const
parseSelectValueToArray
=
(
value
:
unknown
):
string
[]
=>
{
if
(
Array
.
isArray
(
value
))
return
value
.
filter
(
Boolean
)
as
string
[];
if
(
typeof
value
===
'string'
)
{
return
value
?
value
.
split
(
','
)
.
map
((
s
)
=>
s
.
trim
())
.
filter
(
Boolean
)
:
[];
}
if
(
value
===
undefined
||
value
===
null
||
value
===
''
)
return
[];
return
[
String
(
value
)];
};
async
function
handleStartInventory
(
_schema
,
formModel
,
formActionType
)
{
if
(
formModel
?.
id
)
{
formActionType
?.
showMessage
?.(
'编辑状态不可开始盘点'
);
return
;
}
const
payload
:
InventoryFilterParams
=
{
// 这里的 ckwz/cp 在 schema 中已配置为保存 label(名称)
ckwz
:
parseSelectValueToArray
(
formModel
?.
ckwz
),
cplx
:
parseSelectValueToArray
(
formModel
?.
cplx
),
cp
:
parseSelectValueToArray
(
formModel
?.
cp
),
};
console
.
log
(
'[库存盘点] 请求参数:'
,
payload
);
if
(
!
payload
.
ckwz
.
length
&&
!
payload
.
cplx
.
length
&&
!
payload
.
cp
.
length
)
{
formActionType
?.
showMessage
?.(
'请先选择仓库位置、产品类型或产品'
);
return
;
}
try
{
const
res
=
await
getInventoryByFilter
(
payload
,
'message'
);
console
.
log
(
'[库存盘点] /ckgl/kczb/Inventory 返回:'
,
res
);
// 注意:defHttp 可能已解包,res 可能直接就是 data 数组
const
inventoryList
=
Array
.
isArray
(
res
)
?
res
:
res
?.
data
||
[];
console
.
log
(
'[库存盘点] /ckgl/kczb/Inventory 解析后的列表:'
,
inventoryList
);
const
list
=
(
inventoryList
||
[]).
map
((
item
:
InventoryItem
)
=>
({
id
:
item
.
id
,
cp
:
item
.
cpmc
,
cplx
:
item
.
cplx
,
wz
:
item
.
hw
,
pch
:
item
.
pch
,
pdsl
:
item
.
pdsl
??
0
,
zbid
:
item
.
zbid
,
}))
||
[];
await
formActionType
?.
setFieldsValue
?.({
mesWarehouseInventoryRelaList
:
list
});
formActionType
?.
showMessage
?.(
list
.
length
?
'开始盘点成功'
:
'未查询到匹配数据'
);
}
catch
(
error
)
{
console
.
error
(
'开始盘点失败'
,
error
);
formActionType
?.
showMessage
?.(
'开始盘点失败,请稍后重试'
);
}
}
export
const
searchFormSchema
:
FormSchema
[]
=
[
{
...
...
@@ -160,6 +219,7 @@ export const formProps: FormProps = {
labelAlign
:
'right'
,
layout
:
'horizontal'
,
size
:
'default'
,
buttonList
:
[],
schemas
:
[
{
key
:
'44f1b3495b854c708ce9f13c0e6afc94'
,
...
...
@@ -201,7 +261,7 @@ export const formProps: FormProps = {
disabled
:
false
,
isShow
:
true
,
margin
:
'10px'
,
events
:
{
click
:
"formActionType.showMessage('开始盘点')"
},
events
:
{
click
:
handleStartInventory
},
type
:
1
,
event
:
[],
tooltipConfig
:
{
visible
:
false
,
title
:
'提示文本'
},
...
...
@@ -335,8 +395,8 @@ export const formProps: FormProps = {
span
:
4
,
placeholder
:
'请选择仓库位置'
,
showLabel
:
true
,
showSearch
:
fals
e
,
isMultiple
:
fals
e
,
showSearch
:
tru
e
,
isMultiple
:
tru
e
,
clearable
:
false
,
disabled
:
false
,
staticOptions
:
[
...
...
@@ -346,7 +406,8 @@ export const formProps: FormProps = {
],
datasourceType
:
'api'
,
labelField
:
'label'
,
valueField
:
'value'
,
// 保存名称(=label),开始盘点接口要求传名称
valueField
:
'label'
,
apiConfig
:
{
path
:
'/getStoreLocation'
,
method
:
'GET'
,
...
...
@@ -386,8 +447,8 @@ export const formProps: FormProps = {
span
:
4
,
placeholder
:
'请选择产品类型类型'
,
showLabel
:
true
,
showSearch
:
fals
e
,
isMultiple
:
fals
e
,
showSearch
:
tru
e
,
isMultiple
:
tru
e
,
clearable
:
false
,
disabled
:
false
,
staticOptions
:
[
...
...
@@ -431,8 +492,8 @@ export const formProps: FormProps = {
span
:
4
,
placeholder
:
'请选择产品'
,
showLabel
:
true
,
showSearch
:
fals
e
,
isMultiple
:
fals
e
,
showSearch
:
tru
e
,
isMultiple
:
tru
e
,
clearable
:
false
,
disabled
:
false
,
staticOptions
:
[
...
...
@@ -442,7 +503,8 @@ export const formProps: FormProps = {
],
datasourceType
:
'api'
,
labelField
:
'label'
,
valueField
:
'value'
,
// 保存名称(=label),开始盘点接口要求传名称
valueField
:
'label'
,
apiConfig
:
{
path
:
'/scgl/scjh/getAllProduct'
,
method
:
'GET'
,
...
...
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