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
5edb0f1a
Commit
5edb0f1a
authored
Aug 04, 2026
by
wusiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 配货分拣规则增加订单所属客户条件 #1012529
parent
08060a26
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
8 deletions
+61
-8
src/api/order.ts
+7
-0
src/views/order/allocationSortingRule/components/addDialog.vue
+37
-8
src/views/order/allocationSortingRule/index.vue
+17
-0
No files found.
src/api/order.ts
View file @
5edb0f1a
...
...
@@ -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 @
5edb0f1a
...
...
@@ -75,7 +75,6 @@
:value=
"operator.code"
/>
</el-select>
<template
v-if=
"item.conditionType === 'order_platform'"
>
<el-select
v-model=
"item.conditionValue"
...
...
@@ -141,6 +140,27 @@
</
template
>
</el-cascader>
</template>
<
template
v-else-if=
"item.conditionType === 'order_user'"
>
<el-select
v-model=
"item.conditionValue"
class=
"platform-select"
style=
"width: 190px"
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
...
...
@@ -250,6 +270,7 @@ const props = defineProps<{
categoryList
:
OperatorList
[]
pickingRuleList
:
OperatorList
[]
operatorList
:
OperatorList
[]
sortingUserList
:
OperatorList
[]
}
>
()
const
emit
=
defineEmits
<
{
(
e
:
'update:modelValue'
,
value
:
boolean
):
void
...
...
@@ -303,6 +324,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 +345,10 @@ const handleConditionTypeChange = (item: SortingRuleCondition) => {
item
.
conditionValue
=
undefined
item
.
operator
=
'contain'
break
case
'order_user'
:
item
.
conditionValue
=
undefined
item
.
operator
=
'contain'
break
}
}
...
...
@@ -342,11 +368,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 +418,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
}
...
...
src/views/order/allocationSortingRule/index.vue
View file @
5edb0f1a
...
...
@@ -137,6 +137,7 @@
:category-list=
"categoryList"
:picking-rule-list=
"pickingRuleList"
:operator-list=
"operatorList"
:sorting-user-list=
"sortingUserList"
@
submit=
"getSortingRuleList"
/>
<el-dialog
...
...
@@ -171,6 +172,7 @@ import {
getCategoryListApi
,
getConditionTypeListApi
,
getOperatorListApi
,
getSortingUserListApi
,
}
from
'@/api/order'
import
TableView
from
'@/components/TableView.vue'
import
LogList
from
'@/components/LogList.vue'
...
...
@@ -243,6 +245,7 @@ const sortingList = ref<SortingList[]>([]) // 规则列表
const
categoryList
=
ref
<
OperatorList
[]
>
([])
// 商品类目
const
pickingRuleList
=
ref
<
OperatorList
[]
>
([])
// 配货规则条件
const
operatorList
=
ref
<
OperatorList
[]
>
([])
// 配货规则操作符
const
sortingUserList
=
ref
<
OperatorList
[]
>
([])
// 所属客户列表
const
isEnableSorting
=
ref
(
false
)
// 是否开启配货分拣
const
currentId
=
ref
(
0
)
// 当前操作id
const
isEdit
=
ref
(
false
)
// 是否编辑
...
...
@@ -362,6 +365,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
...
...
@@ -404,6 +413,13 @@ const loadWarehouseList = async () => {
}
}
// 获取所属客户列表
const
getSortingUserList
=
async
()
=>
{
const
res
=
await
getSortingUserListApi
()
if
(
res
.
code
!==
200
)
return
sortingUserList
.
value
=
res
.
data
}
const
handleWarehouseChange
=
(
warehouseId
:
number
)
=>
{
searchForm
.
value
.
warehouseId
=
warehouseId
if
(
!
isEnableSorting
.
value
)
return
...
...
@@ -512,6 +528,7 @@ onMounted(async () => {
getCategoryList
(),
getConditionTypeList
(),
getOperatorList
(),
getSortingUserList
(),
])
await
getSortingRuleList
()
loading
.
value
=
false
...
...
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