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
f801a9f9
Commit
f801a9f9
authored
Jan 12, 2024
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
海运非阶梯价包装类型
parent
c862a18e
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
214 additions
and
152 deletions
+214
-152
SeaPrice.vue
src/views/ecw/productPrice/components/SeaPrice.vue
+120
-137
edit.vue
src/views/ecw/productPrice/edit.vue
+94
-15
No files found.
src/views/ecw/productPrice/components/SeaPrice.vue
View file @
f801a9f9
This diff is collapsed.
Click to expand it.
src/views/ecw/productPrice/edit.vue
View file @
f801a9f9
...
...
@@ -161,17 +161,49 @@
</el-col>
</el-row>
</template>
<
template
v-else
>
<
template
v-else
-if=
"form.priceType === 1"
>
<sea-price
ref=
"seaPrice"
:price-type=
"form.priceType"
:currency-list=
"currencyList"
:unit-list=
"unitList"
:value=
"form"
:readonly=
"readonly"
field-prefix=
"all"
:price-name=
"$t('全包价')"
packaging-field=
"fullPricePackagingList"
@
changeUnit=
"handleFormUnitChange($event)"
></sea-price>
</
template
>
<
template
v-else
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<sea-price
ref=
"seaPrice"
:currency-list=
"currencyList"
:unit-list=
"unitList"
:value=
"form"
:readonly=
"readonly"
field-prefix=
"transport"
:price-name=
"$t('运费')"
packaging-field=
"freightPricePackagingList"
@
changeUnit=
"handleFormUnitChange($event)"
></sea-price>
</el-col>
<el-col
:span=
"12"
>
<sea-price
ref=
"seaPrice"
:currency-list=
"currencyList"
:unit-list=
"unitList"
:value=
"form"
:readonly=
"readonly"
field-prefix=
"clearance"
:price-name=
"$t('清关费')"
packaging-field=
"clearancePricePackagingList"
@
changeUnit=
"handleFormUnitChange($event)"
></sea-price>
</el-col>
</el-row>
</
template
>
<el-form-item
:label=
"$t('价格有效期')"
>
<el-date-picker
v-model=
"form.validateStartDate"
value-format=
"yyyy-MM-dd HH:mm:ss"
></el-date-picker>
...
...
@@ -608,6 +640,15 @@ export default {
})
return
stepPriceList
},
// 格式化包装类型费用
getPackingPrice
(
packging
){
if
(
!
packging
?.
length
)
return
packging
=
JSON
.
parse
(
JSON
.
stringify
(
packging
))
return
packging
.
map
(
item
=>
{
item
.
packagingTypes
=
item
.
packagingTypes
.
join
(
"
,
"
)
return
item
})
},
// 非阶梯价格更新单位
handleFormUnitChange
(
data
){
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
...
...
@@ -621,7 +662,23 @@ export default {
})
}
// TODO 等加了包装之后还需要同步包装的单位
// 同步包装的单位
let
packingField
=
{
transportVolumeUnit
:
'
freightPricePackagingList
'
,
clearanceVolumeUnit
:
'
clearancePricePackagingList
'
,
allVolumeUnit
:
'
fullPricePackagingList
'
}[
data
.
field
]
if
(
!
this
.
form
[
packingField
]?.
length
){
return
false
}
this
.
form
[
packingField
].
forEach
(
item
=>
{
if
(
data
.
field
.
indexOf
(
"
PriceUnit
"
)
>
-
1
){
p
[
'
packagingPriceUnit
'
]
=
data
.
value
}
if
(
data
.
field
.
indexOf
(
"
VolumeUnit
"
)
>
-
1
){
p
[
'
packagingVolumeUnit
'
]
=
data
.
value
}
})
},
initStepPrice
(){
if
(
this
.
form
.
priceType
==
1
&&
!
this
.
form
.
fullPriceStepList
?.
length
){
...
...
@@ -638,7 +695,6 @@ export default {
},
// force 为是否强制提交,在价格过期的时候需要确认后强制提交
submitForm
(
force
=
false
)
{
console
.
log
(
"
this.$refs[
\"
form
\"
]
"
,
this
.
$refs
[
"
form
"
])
this
.
$refs
[
"
form
"
].
validate
(
async
(
valid
)
=>
{
if
(
!
valid
)
{
return
;
...
...
@@ -658,7 +714,8 @@ export default {
// specialList: this.specialProducts,
isAllProduct
:
0
})
if
(
this
.
$refs
.
stepPrice
){
// 阶梯价
if
(
this
.
form
.
stepPrice
){
let
isValid
=
true
for
(
let
stepPrice
of
this
.
$refs
.
stepPrice
){
if
(
!
stepPrice
.
validate
()){
...
...
@@ -667,18 +724,40 @@ export default {
}
}
if
(
!
isValid
)
return
}
// 全包价
if
(
this
.
form
.
priceType
==
1
)
{
data
.
fullPriceStepList
=
this
.
getPriceList
(
this
.
form
.
fullPriceStepList
)
delete
data
.
clearancePriceStepList
delete
data
.
freightPriceStepList
}
else
{
data
.
clearancePriceStepList
=
this
.
getPriceList
(
this
.
form
.
clearancePriceStepList
)
data
.
freightPriceStepList
=
this
.
getPriceList
(
this
.
form
.
freightPriceStepList
)
delete
data
.
fullPriceStepList
}
}
//海运非阶梯价校验
else
{
// 有多个组件则表示清关费 + 运费
if
(
this
.
$refs
.
seaPrice
?.
length
){
let
isValid
=
true
for
(
let
seaPrice
of
this
.
$refs
.
seaPrice
){
if
(
!
seaPrice
.
validate
()){
isValid
=
false
break
}
}
if
(
!
isValid
)
return
}
// 只有一个海运费组件,全包价
else
if
(
this
.
$refs
.
seaPrice
&&
!
this
.
$refs
.
seaPrice
.
validate
()){
return
}
// 全包价
if
(
this
.
form
.
priceType
==
1
)
{
data
.
fullPriceStepList
=
this
.
getPriceList
(
this
.
form
.
fullPriceStepList
)
delete
data
.
clearancePriceStepList
delete
data
.
freightPriceStepList
}
else
{
data
.
clearancePriceStepList
=
this
.
getPriceList
(
this
.
form
.
clearancePriceStepList
)
data
.
freightPriceStepList
=
this
.
getPriceList
(
this
.
form
.
freightPriceStepList
)
delete
data
.
fullPriceStepList
// 格式化
data
.
fullPricePackagingList
=
this
.
getPackingPrice
(
data
.
fullPricePackagingList
)
data
.
freightPricePackagingList
=
this
.
getPackingPrice
(
data
.
freightPricePackagingList
)
data
.
clearancePricePackagingList
=
this
.
getPackingPrice
(
data
.
clearancePricePackagingList
)
}
// 设置了有效期,且已过期则给提示
...
...
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