Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-operator-master
Commits
390a19f6
Commit
390a19f6
authored
Jan 01, 2024
by
邓春圆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表单验证 重构,修复bug
parent
d3a32c24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
55 deletions
+42
-55
channel-route.vue
src/views/ecw/offer/channel-route.vue
+42
-55
No files found.
src/views/ecw/offer/channel-route.vue
View file @
390a19f6
...
...
@@ -30,12 +30,6 @@ export default {
]
}],
},
form1
:
{
bubbleWeightRatio
:
100
,
channelCostCreateReqVO
:
{},
channelPackagingList
:
[],
},
channelList
:
[],
dialogVisible
:
false
,
}
...
...
@@ -82,7 +76,7 @@ export default {
this
.
$set
(
this
.
form
.
channelList
[
index
],
'
packagingCreateReqVOList
'
,
arr
);
},
newChannelsAdd
(
index
)
{
this
.
form
.
channelList
.
splice
(
index
,
0
,
{
this
.
form
.
channelList
.
splice
(
index
+
1
,
0
,
{
"
channelIds
"
:
""
,
"
packagingCreateReqVOList
"
:
[
{
...
...
@@ -101,13 +95,8 @@ export default {
arr
[
index
].
packagingCreateReqVOList
.
splice
(
indexx
,
1
);
this
.
form
.
channelList
=
arr
;
},
getRouteDetails
(
id
,
callback
=
()
=>
{
})
{
getAirLineChannelPackagingList
(
id
).
then
(
(
r
)
=>
{
callback
(
r
.
data
)
}
)
getRouteDetails
(
id
,
callback
=
()
=>
{}){
getAirLineChannelPackagingList
(
id
).
then
((
r
)
=>
{
callback
(
r
.
data
)})
},
setChannelData
(
list
=
[])
{
let
arr
=
[]
...
...
@@ -180,7 +169,7 @@ export default {
return
arr
},
submit
()
{
if
(
!
this
.
validation
())
return
if
(
!
this
.
validation
())
return
createWarehouseLineChannelPackaging
(
this
.
getChannelDate
(
this
.
form
)).
then
(
r
=>
{
this
.
$message
.
success
(
'
保存成功
'
);
this
.
$router
.
back
()
...
...
@@ -194,53 +183,51 @@ export default {
},
validation
()
{
let
flag
=
true
this
.
form
.
channelList
.
forEach
((
item
,
index
)
=>
{
if
(
!
item
.
channelIds
.
length
)
{
this
.
$message
.
warning
(
`渠道
${
index
+
1
}
没有选择航道`
)
flag
=
false
return
}
item
.
packagingCreateReqVOList
.
forEach
((
itemm
,
indexx
)
=>
{
console
.
log
(
itemm
.
packagingTypes
);
if
(
!
itemm
.
packagingTypes
.
length
)
{
this
.
$message
.
warning
(
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
,没有选择包装类型。`
)
flag
=
false
return
}
if
(
!
(
itemm
.
airWeightLimit
>=
0
))
{
this
.
$message
.
warning
(
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
,没有输入空运订单重量上限。`
)
flag
=
false
return
}
let
check
=
(
indexxx
)
=>
{
this
.
$message
.
warning
(
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
- 第
${
indexxx
+
1
}
价格输入有问题。`
)
flag
=
false
try
{
this
.
form
.
channelList
.
forEach
((
item
,
index
)
=>
{
if
(
!
item
.
channelIds
.
length
)
{
throw
`渠道
${
index
+
1
}
没有选择航道`
;
}
itemm
.
priceStepClearanceCreateReqVOList
.
forEach
((
itemmm
,
indexxx
)
=>
{
if
(
!
itemmm
.
clearancePrice
||
itemmm
.
clearancePrice
===
''
)
{
check
(
indexxx
)
return
item
.
packagingCreateReqVOList
.
forEach
((
itemm
,
indexx
)
=>
{
if
(
!
itemm
.
packagingTypes
.
length
)
{
throw
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
,没有选择包装类型。`
;
}
if
(
!
itemmm
.
clearancePriceUnit
||
itemmm
.
clearancePriceUnit
===
''
)
{
check
(
indexxx
)
}
if
(
!
itemmm
.
clearanceVolumeUnit
||
itemmm
.
clearanceVolumeUnit
===
''
)
{
}
if
(
isNaN
(
itemmm
.
endNum
)
||
itemmm
.
endNum
===
''
)
{
check
(
indexxx
)
}
if
(
isNaN
(
itemmm
.
startNum
)
||
itemmm
.
startNum
===
''
)
{
check
(
indexxx
)
if
(
!
(
itemm
.
airWeightLimit
>=
0
))
{
throw
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
,没有输入空运订单重量上限。`
;
}
if
(
!
itemmm
.
weightUnit
||
itemmm
.
weightUnit
===
''
)
{
check
(
indexxx
)
let
check
=
(
indexxx
)
=>
{
return
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
- 第
${
indexxx
+
1
}
价格输入有问题。`
}
itemm
.
priceStepClearanceCreateReqVOList
.
forEach
((
itemmm
,
indexxx
)
=>
{
if
(
!
itemmm
.
clearancePrice
||
itemmm
.
clearancePrice
===
''
)
{
throw
check
(
indexxx
);
}
if
(
!
itemmm
.
clearancePriceUnit
||
itemmm
.
clearancePriceUnit
===
''
)
{
throw
check
(
indexxx
);
}
if
(
!
itemmm
.
clearanceVolumeUnit
||
itemmm
.
clearanceVolumeUnit
===
''
)
{
throw
check
(
indexxx
);
}
if
(
isNaN
(
itemmm
.
endNum
)
||
itemmm
.
endNum
===
''
)
{
throw
check
(
indexxx
);
}
if
(
isNaN
(
itemmm
.
startNum
)
||
itemmm
.
startNum
===
''
)
{
throw
check
(
indexxx
);
}
if
(
!
itemmm
.
weightUnit
||
itemmm
.
weightUnit
===
''
)
{
throw
check
(
indexxx
);
}
})
})
})
})
}
catch
(
e
)
{
flag
=
false
console
.
log
(
e
.
Error
,
'
eee
'
)
this
.
$message
.
warning
(
e
);
}
return
flag
}
}
...
...
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