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
d2b3b13e
Commit
d2b3b13e
authored
Aug 07, 2026
by
wusiyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_sorting_rule' into 'dev'
Dev sorting rule See merge request
!299
parents
18f72f82
9e016cfd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
45 deletions
+115
-45
src/api/order.ts
+7
-0
src/views/order/allocationSortingRule/components/addDialog.vue
+90
-36
src/views/order/allocationSortingRule/index.vue
+18
-9
No files found.
src/api/order.ts
View file @
d2b3b13e
...
...
@@ -776,6 +776,13 @@ export function getOperatorListApi() {
)
}
// 配货分拣 所属客户列表
export
function
getSortingUserListApi
()
{
return
axios
.
get
<
never
,
BaseRespData
<
OperatorList
[]
>>
(
'dbDiyUser/userMarkListByFactory'
,
)
}
// 配货分拣 操作日志
export
function
getSortingLogApi
(
id
:
number
)
{
return
axios
.
get
<
never
,
BaseRespData
<
LogListData
[]
>>
(
'sorting/getLog'
,
{
...
...
src/views/order/allocationSortingRule/components/addDialog.vue
View file @
d2b3b13e
...
...
@@ -75,12 +75,11 @@
:value=
"operator.code"
/>
</el-select>
<template
v-if=
"item.conditionType === 'order_platform'"
>
<el-select
v-model=
"item.conditionValue"
class=
"platform-select"
style=
"width:
19
0px"
style=
"width:
21
0px"
:disabled=
"isDisabled"
placeholder=
"请选择平台"
filterable
...
...
@@ -109,7 +108,7 @@
<el-cascader
v-model=
"item.conditionValue"
class=
"category-cascader"
style=
"width:
19
0px"
style=
"width:
21
0px"
placeholder=
"请选择商品类目"
:options=
"categoryList"
:props=
"
{
...
...
@@ -141,39 +140,61 @@
</
template
>
</el-cascader>
</template>
<
template
v-else-if=
"item.conditionType === 'order_user'"
>
<el-select
v-model=
"item.conditionValue"
class=
"platform-select"
style=
"width: 210px"
placeholder=
"请选择所属客户"
:disabled=
"isDisabled"
filterable
multiple
collapse-tags
:max-collapse-tags=
"1"
clearable
>
<el-option
v-for=
"user in sortingUserList"
:key=
"user"
:label=
"user"
:value=
"user"
/>
</el-select>
</
template
>
<
template
v-else
>
<el-input-number
v-model=
"item.conditionValue"
style=
"width:
19
0px"
style=
"width:
21
0px"
:min=
"1"
:max=
"999"
:disabled=
"isDisabled"
placeholder=
"请输入数字"
/>
</
template
>
<el-button
v-if=
"form.conditions.length < (pickingRuleList?.length ?? 0)"
type=
"primary"
class=
"rule-action-btn"
:icon=
"Plus"
size=
"small"
circle
:disabled=
"isDisabled"
@
click=
"addPickingRuleItem"
/>
<el-button
v-if=
"form.conditions.length > 1"
color=
"#F56C6C"
class=
"rule-action-btn"
:icon=
"Minus"
size=
"small"
circle
plain
:disabled=
"isDisabled"
@
click=
"removePickingRuleItem(index)"
/>
<div
class=
"btn-group"
>
<el-button
v-if=
"form.conditions.length < (pickingRuleList?.length ?? 0)"
type=
"primary"
class=
"rule-action-btn"
:icon=
"Plus"
size=
"small"
circle
:disabled=
"isDisabled"
@
click=
"addPickingRuleItem"
/>
<el-button
v-if=
"form.conditions.length > 1"
color=
"#F56C6C"
class=
"rule-action-btn"
:icon=
"Minus"
size=
"small"
circle
plain
:disabled=
"isDisabled"
@
click=
"removePickingRuleItem(index)"
/>
</div>
</div>
</div>
</el-form-item>
...
...
@@ -238,7 +259,13 @@ import type {
SortingRuleCondition
,
SortingRuleDetail
,
}
from
'@/types/api/order'
import
{
getAreaListApi
,
addAreaApi
,
editAreaApi
}
from
'@/api/order'
import
{
getAreaListApi
,
addAreaApi
,
editAreaApi
,
getSortingUserListApi
,
getCategoryListApi
,
}
from
'@/api/order'
const
props
=
defineProps
<
{
modelValue
:
boolean
...
...
@@ -247,7 +274,6 @@ const props = defineProps<{
warehouseId
:
number
warehouseName
:
string
isDisabled
?:
boolean
categoryList
:
OperatorList
[]
pickingRuleList
:
OperatorList
[]
operatorList
:
OperatorList
[]
}
>
()
...
...
@@ -267,6 +293,8 @@ const visible = computed({
const
formRef
=
ref
<
FormInstance
>
()
const
areaList
=
ref
<
OperatorList
[]
>
([])
const
sortingUserList
=
ref
<
OperatorList
[]
>
([])
const
categoryList
=
ref
<
OperatorList
[]
>
([])
const
form
=
ref
<
SortingRuleDetail
>
({
areaDesc
:
''
,
areaCode
:
''
,
...
...
@@ -303,6 +331,7 @@ const getAvailableOperators = (conditionType: string) => {
order_total_num
:
(
code
)
=>
code
!==
'in'
&&
code
!==
'contain'
,
order_platform
:
(
code
)
=>
code
===
'in'
,
order_category
:
(
code
)
=>
code
===
'contain'
,
order_user
:
(
code
)
=>
code
===
'contain'
,
}
const
matcher
=
matchers
[
conditionType
]
return
matcher
?
list
.
filter
((
operator
)
=>
matcher
(
operator
.
code
))
:
list
...
...
@@ -323,6 +352,10 @@ const handleConditionTypeChange = (item: SortingRuleCondition) => {
item
.
conditionValue
=
undefined
item
.
operator
=
'contain'
break
case
'order_user'
:
item
.
conditionValue
=
undefined
item
.
operator
=
'contain'
break
}
}
...
...
@@ -342,11 +375,13 @@ const validateConditions = (
const
items
=
form
.
value
.
conditions
for
(
let
i
=
0
;
i
<
items
.
length
;
i
++
)
{
const
item
=
items
[
i
]
const
isValueValid
=
item
.
conditionType
===
'order_platform'
||
item
.
conditionType
===
'order_category'
?
Array
.
isArray
(
item
.
conditionValue
)
&&
item
.
conditionValue
.
length
>
0
:
item
.
conditionValue
!==
null
&&
item
.
conditionValue
!==
undefined
const
isValueValid
=
[
'order_platform'
,
'order_category'
,
'order_user'
,
].
includes
(
item
.
conditionType
)
?
Array
.
isArray
(
item
.
conditionValue
)
&&
item
.
conditionValue
.
length
>
0
:
item
.
conditionValue
!==
null
&&
item
.
conditionValue
!==
undefined
if
(
!
item
.
conditionType
||
!
isValueValid
||
!
item
.
operator
)
{
callback
(
new
Error
(
'请完善配货规则'
))
return
...
...
@@ -390,8 +425,9 @@ const formatConditionsForForm = (conditions: SortingRuleCondition[]) =>
conditions
.
map
((
item
)
=>
{
if
(
typeof
item
.
conditionValue
!==
'string'
||
(
item
.
conditionType
!==
'order_platform'
&&
item
.
conditionType
!==
'order_category'
)
!
[
'order_platform'
,
'order_category'
,
'order_user'
].
includes
(
item
.
conditionType
,
)
)
{
return
item
}
...
...
@@ -445,6 +481,20 @@ const loadAreaList = async () => {
}
}
// 获取所属客户列表
const
getSortingUserList
=
async
()
=>
{
const
res
=
await
getSortingUserListApi
()
if
(
res
.
code
!==
200
)
return
sortingUserList
.
value
=
res
.
data
}
// 获取商品类目
const
getCategoryList
=
async
()
=>
{
const
res
=
await
getCategoryListApi
()
if
(
res
.
code
!==
200
)
return
categoryList
.
value
=
res
.
data
}
// 提交
const
handleSubmit
=
async
()
=>
{
form
.
value
.
warehouseId
=
props
.
warehouseId
...
...
@@ -478,7 +528,7 @@ const handleSubmit = async () => {
}
onMounted
(
async
()
=>
{
await
loadAreaList
(
)
await
Promise
.
all
([
loadAreaList
(),
getSortingUserList
(),
getCategoryList
()]
)
if
(
props
.
editData
)
{
form
.
value
=
{
...
props
.
editData
,
...
...
@@ -523,6 +573,10 @@ onMounted(async () => {
}
}
.btn-group
{
display
:
flex
;
}
.rule-action-btn
{
font-size
:
16px
;
}
...
...
src/views/order/allocationSortingRule/index.vue
View file @
d2b3b13e
...
...
@@ -134,7 +134,6 @@
:edit-data=
"editData"
:warehouse-id=
"searchForm.warehouseId"
:warehouse-name=
"searchForm.warehouseName"
:category-list=
"categoryList"
:picking-rule-list=
"pickingRuleList"
:operator-list=
"operatorList"
@
submit=
"getSortingRuleList"
...
...
@@ -362,6 +361,12 @@ const formatConditionText = (item: SortingRuleCondition) => {
.
filter
(
Boolean
)
.
join
(
'、'
)
break
case
'order_user'
:
valueText
=
String
(
item
.
conditionValue
??
''
)
.
split
(
','
)
.
filter
(
Boolean
)
.
join
(
'、'
)
break
default
:
valueText
=
String
(
item
.
conditionValue
??
''
)
break
...
...
@@ -446,12 +451,18 @@ const updateConfig = async () => {
// 查询列表
const
getSortingRuleList
=
async
()
=>
{
loading
.
value
=
true
const
res
=
await
getSortingRuleListApi
({
warehouseId
:
searchForm
.
value
.
warehouseId
,
})
if
(
res
.
code
!==
200
)
return
sortingList
.
value
=
res
.
data
.
records
loading
.
value
=
false
try
{
const
[,
res
]
=
await
Promise
.
all
([
getCategoryList
(),
getSortingRuleListApi
({
warehouseId
:
searchForm
.
value
.
warehouseId
,
}),
])
if
(
res
.
code
!==
200
)
return
sortingList
.
value
=
res
.
data
.
records
}
finally
{
loading
.
value
=
false
}
}
// 新增/编辑
...
...
@@ -509,12 +520,10 @@ onMounted(async () => {
await
Promise
.
all
([
loadWarehouseList
(),
getFunctionSwitch
(),
getCategoryList
(),
getConditionTypeList
(),
getOperatorList
(),
])
await
getSortingRuleList
()
loading
.
value
=
false
})
</
script
>
...
...
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