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
6a840832
Commit
6a840832
authored
Nov 23, 2023
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量设置价格优化
parent
c6fad928
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
3 deletions
+54
-3
batchEdit.vue
src/views/ecw/productPrice/batchEdit.vue
+54
-3
No files found.
src/views/ecw/productPrice/batchEdit.vue
View file @
6a840832
...
...
@@ -39,10 +39,14 @@
{{
$t
(
'
第{index
}
阶梯定价方案
'
,
{
index
:
index
+
1
}
)
}}
:
<
template
v
-
if
=
"
index == form.priceStepList.length - 1
"
>
<
el
-
link
type
=
"
primary
"
@
click
.
native
=
"
form.priceStepList.push({
}
)
"
>
{{
$t
(
'
添加区间
'
)
}}
<
/el-link
>
<
el
-
divider
direction
=
"
vertical
"
><
/el-divider
>
<
el
-
link
type
=
"
danger
"
@
click
.
native
=
"
form.priceStepList.splice(index, 1)
"
>
{{
$t
(
'
删除
'
)
}}
<
/el-link
>
<
el
-
divider
v
-
if
=
"
index
"
direction
=
"
vertical
"
><
/el-divider
>
<
el
-
link
v
-
if
=
"
index
"
type
=
"
danger
"
@
click
.
native
=
"
form.priceStepList.splice(index, 1)
"
>
{{
$t
(
'
删除
'
)
}}
<
/el-link
>
<
/template
>
<
/div
>
<
div
v
-
if
=
"
willBeIgnore(item)
"
style
=
"
color:red
"
>
{{
$t
(
'
此阶梯未设置阶梯和价格,将会被忽略
'
)
}}
<
/div
>
<
div
v
-
else
-
if
=
"
!isStepPriceOk(item)
"
style
=
"
color:red
"
>
{{
$t
(
'
此阶梯价信息设置不完整
'
)
}}
<
/div
>
<
el
-
form
-
item
:
label
=
"
$t(`第{index
}
阶梯`, {index: index+1
}
)
"
>
<
el
-
input
v
-
model
=
"
item.startNum
"
type
=
"
number
"
placeholder
=
""
class
=
"
w100
"
><
/el-input
>
-
...
...
@@ -255,8 +259,34 @@ export default {
}
return
{
currency
,
unit
}
}
,
// 判断是否空值
isEmpty
(){
return
(
content
)
=>
{
return
!
content
&&
content
!==
0
&&
content
!==
'
0
'
}
}
,
// 判断某个阶梯价是否会被忽略
willBeIgnore
(){
return
(
stepPrice
)
=>
{
if
(
!
this
.
isEmpty
(
stepPrice
.
startNum
)
||
!
this
.
isEmpty
(
stepPrice
.
endNum
))
return
false
if
(
this
.
form
.
priceType
==
1
&&
!
this
.
isEmpty
(
stepPrice
.
allPrice
))
return
false
if
(
this
.
form
.
priceType
!=
1
&&
!
this
.
isEmpty
(
stepPrice
.
transportPrice
)
&&
!
this
.
isEmpty
(
stepPrice
.
clearancePrice
))
return
false
return
true
}
}
,
// 判断阶梯价是否设置不完整
isStepPriceOk
(){
return
(
stepPrice
)
=>
{
if
(
this
.
isEmpty
(
stepPrice
.
startNum
)
||
this
.
isEmpty
(
stepPrice
.
endNum
))
return
false
if
(
this
.
form
.
priceType
==
1
&&
(
this
.
isEmpty
(
stepPrice
.
allPrice
)
||
this
.
isEmpty
(
stepPrice
.
allPriceUnit
)
||
this
.
isEmpty
(
stepPrice
.
allVolumeUnit
)))
return
false
else
if
(
this
.
isEmpty
(
stepPrice
.
transportPrice
)
||
this
.
isEmpty
(
stepPrice
.
transportPriceUnit
)){
// 清关费可能为0或者空
return
false
}
return
true
}
}
,
}
,
watch
:
{
checkList
()
{
//选择路线
if
(
this
.
checkList
.
length
>
0
)
{
...
...
@@ -504,6 +534,27 @@ export default {
// 没有设置阶梯价格则不提交priceStepList
if
(
data
.
stepPrice
!=
1
){
delete
data
.
priceStepList
}
else
{
// 根据23-11-23 21点左右的群讨论,阶梯价如果留空则不提交,如果全部为空则不提交此字段
// 相关工单 https://zentao.test.jdshangmen.com/bug-view-5460.html
// 填写不完整的给提示
let
notOk
=
[]
data
.
priceStepList
.
forEach
((
item
,
index
)
=>
{
if
(
!
this
.
willBeIgnore
(
item
)
&&
!
this
.
isStepPriceOk
(
item
)){
notOk
.
push
(
index
+
1
)
}
}
)
if
(
notOk
.
length
){
return
this
.
$confirm
(
this
.
$t
(
"
第{steps
}
阶梯设置不完整
"
,
{
steps
:
notOk
.
join
(
"
,
"
)
}
))
}
// 删除未填写的阶梯价
data
.
priceStepList
=
data
.
priceStepList
.
filter
(
item
=>
{
return
!
this
.
willBeIgnore
(
item
)
}
)
if
(
!
data
.
priceStepList
.
length
){
delete
data
.
priceStepList
}
}
data
.
lineChannelList
=
this
.
selectedRoutes
...
...
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