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
984e319f
Commit
984e319f
authored
Nov 20, 2025
by
sunyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
us排版开关
parent
5dac4fdb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
2 deletions
+72
-2
src/api/podUsSchedulingRules.ts
+8
-0
src/views/order/podUsSchedulingRules/index.vue
+64
-2
No files found.
src/api/podUsSchedulingRules.ts
View file @
984e319f
...
...
@@ -23,6 +23,14 @@ export function updateRuleByIdApi(data: PostData) {
)
}
// 规则开关
export
function
ruleSwitchApi
(
data
:
PostData
)
{
return
axios
.
post
<
never
,
BasePaginationData
<
never
>>
(
'factory/podJomallOrderUsArrangeRule/ruleSwitch'
,
data
,
)
}
// us规则列表
export
function
getByFactoryNoApi
(
data
:
{
factoryNo
:
number
})
{
return
axios
.
get
<
never
,
BaseRespData
<
never
>>
(
...
...
src/views/order/podUsSchedulingRules/index.vue
View file @
984e319f
...
...
@@ -17,8 +17,24 @@
<div
class=
"box"
>
批次数量:
{{
item
.
arrangeMax
}}
</div>
<div
class=
"box"
>
每天
{{
getTime
(
item
)
}}
开始自动排单
</div>
</div>
<div
class=
"action"
>
<div
style=
"display: flex;align-items: center;gap: 2px;"
>
<div>
状态:
</div>
<el-switch
v-model=
"item.status"
@
change=
"(val:string) => ruleSwitch(item.id || 0, val)"
active-value=
'ACTIVE'
inactive-value=
'INACTIVE'
active-text=
"开"
inactive-text=
"关"
inline-prompt
class=
"ml-2"
style=
"
--el-switch-on-color: #42b983;
--el-switch-off-color: #f56c6c;
"
/>
</div>
<el-icon
size=
"24"
title=
"编辑"
...
...
@@ -180,6 +196,24 @@
"
/>
</div>
<div
style=
"display: flex; align-items: center"
>
<div
style=
"color: #606266; margin-right: 10px"
>
状态:
</div>
<el-switch
v-model=
"editForm.status"
active-value=
'ACTIVE'
inactive-value=
'INACTIVE'
active-text=
"开"
inactive-text=
"关"
inline-prompt
class=
"ml-2"
style=
"
--el-switch-on-color: #42b983;
--el-switch-off-color: #f56c6c;
"
/>
</div>
<div
v-if=
"editForm.isAuto"
>
<div
label=
"排版类型:"
>
<el-radio-group
v-model=
"editForm.type"
>
...
...
@@ -215,6 +249,7 @@ import {
usArrangeRuleApi
,
getByFactoryNoApi
,
updateRuleByIdApi
,
ruleSwitchApi
,
}
from
'@/api/podUsSchedulingRules.ts'
import
{
Plus
,
Minus
}
from
'@element-plus/icons-vue'
...
...
@@ -223,7 +258,7 @@ import CustomizeForm from '@/components/CustomizeForm.tsx'
import
{
Edit
}
from
'@element-plus/icons-vue'
import
{
debounce
}
from
'lodash-es'
const
editForm
=
ref
<
BaseForm
>
({
isAuto
:
false
})
const
editForm
=
ref
<
BaseForm
>
({
isAuto
:
false
,
status
:
'ACTIVE'
})
const
tableData
=
ref
([])
import
userUserStore
from
'@/store/user'
const
userStore
=
userUserStore
()
...
...
@@ -311,6 +346,7 @@ interface BaseForm {
hour
?:
string
|
number
minute
?:
string
|
number
second
?:
string
|
number
status
?:
string
}
type
ParamKey
=
`param
${
number
}
`
type
ParamValue
=
string
|
number
|
boolean
|
null
|
undefined
...
...
@@ -433,6 +469,29 @@ const changeSwitch = () => {
editForm
.
value
.
templateWidth
=
undefined
}
const
ruleSwitch
=
async
(
id
:
number
,
status
:
string
)
=>
{
if
(
id
===
0
){
return
}
try
{
const
params
=
{
id
:
id
,
status
:
status
,
}
const
res
=
await
ruleSwitchApi
({
...
params
,
})
ElMessage
({
message
:
res
.
message
,
type
:
'success'
,
offset
:
window
.
innerHeight
/
2
,
})
getList
()
}
catch
(
e
)
{
}
}
const
padTimeUnit
=
(
value
:
string
|
number
):
string
=>
{
const
num
=
Number
(
value
)
// 若转换后是 NaN(无效值),或原始值不存在(null/undefined/''),均返回 '00'
...
...
@@ -513,6 +572,9 @@ const getTime = (item: BaseForm) => {
}
.action
{
display
:
flex
;
align-items
:
center
;
gap
:
100px
;
.iconView
{
}
}
...
...
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