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
fbcb198b
Commit
fbcb198b
authored
Dec 28, 2023
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑空运价格,还没测完
parent
23a160e8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
429 additions
and
397 deletions
+429
-397
productPrice.js
src/api/ecw/productPrice.js
+17
-0
PriceStep.vue
src/views/ecw/productPrice/components/PriceStep.vue
+182
-7
QuickSet.vue
src/views/ecw/productPrice/components/QuickSet.vue
+2
-2
editAir.vue
src/views/ecw/productPrice/editAir.vue
+228
-388
No files found.
src/api/ecw/productPrice.js
View file @
fbcb198b
...
...
@@ -9,6 +9,14 @@ export function createProductPrice(data) {
})
}
export
function
createProductPriceAir
(
data
)
{
return
request
({
url
:
'
/ecw/product-price/createAir
'
,
method
:
'
post
'
,
data
:
data
})
}
// 更新产品价格
export
function
updateProductPrice
(
data
)
{
return
request
({
...
...
@@ -18,6 +26,15 @@ export function updateProductPrice(data) {
})
}
// 更新空运价格
export
function
updateProductPriceAir
(
data
)
{
return
request
({
url
:
'
/ecw/product-price/updateAir
'
,
method
:
'
put
'
,
data
:
data
})
}
// 删除产品价格
export
function
deleteProductPrice
(
id
)
{
return
request
({
...
...
src/views/ecw/productPrice/components/PriceStep.vue
View file @
fbcb198b
<
script
>
import
Selector
from
"
@/components/Selector/index.vue
"
;
import
Inputor
from
"
@/components/Inputor/index.vue
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
import
{
DICT_TYPE
,
getDictDatas
}
from
"
@/utils/dict
"
;
export
default
{
name
:
"
PriceStep
"
,
components
:
{
Inputor
,
Selector
},
components
:
{
Template
,
Inputor
,
Selector
},
props
:{
index
:
Number
,
priceName
:
String
,
...
...
@@ -17,6 +19,8 @@ export default {
type
:
Array
,
default
:
[]
},
showAdd
:
Boolean
,
readonly
:
Boolean
,
value
:{
type
:
Object
,
default
:
()
=>
{
...
...
@@ -26,9 +30,91 @@ export default {
}
}
},
created
()
{
if
(
!
this
.
value
.
packagingList
){
this
.
addPackage
()
}
this
.
initSpecialPrice
()
},
data
(){
return
{
form
:
{}
}
},
computed
:{
packagingList
(){
return
getDictDatas
(
DICT_TYPE
.
ECW_PACKAGING_TYPE
).
filter
(
dict
=>
{
let
enable
=
true
this
.
value
.
packagingList
.
forEach
(
item
=>
{
if
(
item
.
packagingTypes
?.
length
&&
item
.
packagingTypes
.
indexOf
(
dict
.
value
)
>
-
1
){
enable
=
false
}
})
return
enable
})
}
},
methods
:{
getDictDatas
,
// 初始化特需加价
initSpecialPrice
(){
if
(
!
this
.
value
.
specialList
){
this
.
$set
(
this
.
value
,
'
specialList
'
,
[])
}
this
.
getDictDatas
(
this
.
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
).
forEach
(
item
=>
{
if
(
!
this
.
value
.
specialList
.
find
(
special
=>
special
.
specialDictType
==
item
.
value
)){
this
.
value
.
specialList
.
push
({
[
`
${
this
.
fieldPrefix
}
Price`
]:
0
,
// 新建默认给0,否则默认是null
[
`
${
this
.
fieldPrefix
}
PriceUnit`
]:
this
.
value
[
`
${
this
.
fieldPrefix
}
PriceUnit`
],
[
`
${
this
.
fieldPrefix
}
VolumeUnit`
]:
this
.
value
[
`
${
this
.
fieldPrefix
}
VolumeUnit`
],
"
specialDictType
"
:
item
.
value
})
}
})
},
// 添加包装类型运费
addPackage
(){
if
(
!
this
.
value
.
packagingList
){
this
.
$set
(
this
.
value
,
'
packagingList
'
,
[])
}
this
.
value
.
packagingList
.
push
({
packagingPrice
:
undefined
,
packagingPriceUnit
:
this
.
value
[
`
${
this
.
fieldPrefix
}
PriceUnit`
],
packagingVolumeUnit
:
this
.
value
[
`
${
this
.
fieldPrefix
}
VolumeUnit`
],
})
},
// 删除包装类型运费
deletePackage
(
index
){
this
.
value
.
packagingList
.
splice
(
index
,
1
)
},
// 校验
validate
(){
let
valid
=
true
const
index
=
this
.
index
// 区间设置检查
if
(
index
>
0
&&
!
this
.
value
.
startNum
){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的起始值`
)
}
if
(
!
this
.
value
.
endNum
){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的结束值`
)
}
// 价格检查
if
(
!
this
.
value
[
`
${
this
.
fieldPrefix
}
Price`
]){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的
${
this
.
priceName
}
`
)
}
// 包装价格检查
if
(
this
.
value
.
packagingList
?.
length
){
this
.
value
.
packagingList
.
forEach
((
item
,
i
)
=>
{
if
(
item
.
packagingTypes
?.
length
&&
!
item
.
packagingPrice
){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的包装类型
${
i
+
1
}
的
${
this
.
priceName
}
`
)
}
})
}
return
valid
}
}
}
...
...
@@ -36,21 +122,110 @@ export default {
<
template
>
<div>
<el-form-item
:label=
"$t('第
{index}阶梯', {index})">
<div
class=
"bold text-lg"
>
{{
$t
(
'
空运{type
}
设置
'
,
{
type
:
priceName
}
)
}}
<
/div
>
<
div
style
=
"
font-size:14px; margin:10px 0
"
>
{{
$t
(
'
第{index
}
阶梯定价方案
'
,
{
index
:
index
+
1
}
)
}}
:
<
template
v
-
if
=
"
showAdd
"
>
<
el
-
link
type
=
"
primary
"
@
click
.
native
=
"
$emit('add', fieldPrefix)
"
>
{{
$t
(
'
添加区间
'
)
}}
<
/el-link
>
<
el
-
divider
direction
=
"
vertical
"
><
/el-divider
>
<
el
-
link
type
=
"
danger
"
@
click
.
native
=
"
$emit( 'delete', index)
"
>
{{
$t
(
'
删除
'
)
}}
<
/el-link
>
<
/template
>
<
/div
>
<
el
-
form
-
item
:
label
=
"
$t('第{index
}
阶梯', {index: index+1
}
)
"
>
<
el
-
input
-
number
v
-
model
=
"
value.startNum
"
:
controls
=
"
false
"
class
=
"
w-100
"
><
/el-input-number
>
-
<
el
-
input
-
number
v
-
model
=
"
value.endNum
"
:
controls
=
"
false
"
class
=
"
w-100
"
><
/el-input-number
>
/
<selector
:disabled=
"index > 0"
v-model=
"value.weightUnit"
:options=
"unitList"
:label-field=
"$l(null, 'title')"
value-field=
"id"
class=
"w-100"
/>
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value.weightUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: 'weightUnit'
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认') + priceName
"
>
<
el
-
input
-
number
v
-
model
=
"
value[`${fieldPrefix
}
Price`]
"
:
placeholder
=
"
$t('整数或者两位小数')
"
:
precision
=
"
2
"
:
controls
=
"
false
"
class
=
"
w-100 mr-10
"
/>
<selector
:disabled=
"index > 1"
v-model=
"value[`$
{fieldPrefix}PriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
/
<selector
:disabled=
"index > 1"
v-model=
"value[`$
{fieldPrefix}VolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value[`${fieldPrefix
}
PriceUnit`]
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: `${fieldPrefix
}
PriceUnit`
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value[`${fieldPrefix
}
VolumeUnit`]
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: `${fieldPrefix
}
VolumeUnit`
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<!--
特性加价
-->
<
template
v
-
for
=
"
(special, specialIndex) in value.specialList
"
>
<
el
-
form
-
item
:
label
=
"
getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + priceName
"
:
key
=
"
specialIndex + 'transport'
"
>
<
el
-
input
-
number
v
-
model
.
number
=
"
special[`${fieldPrefix
}
Price`]
"
:
controls
=
"
false
"
:
min
=
"
0
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
selector
disabled
v
-
model
=
"
special[`${fieldPrefix
}
PriceUnit`]
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
special[`${fieldPrefix
}
VolumeUnit`]
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
/el-form-item
>
<
/template
>
<!--
包装类型价格
-->
<
template
v
-
for
=
"
(item, i) in value.packagingList
"
>
<
el
-
form
-
item
:
label
=
"
$t('包装类型') + priceName + (i+1)
"
>
<
template
#
label
>
<
div
class
=
"
el-form-item__label
"
style
=
"
width: 150px;
"
>
{{
$t
(
'
包装类型
'
)
+
priceName
+
(
i
+
1
)
}}
<
/div
>
<
/template
>
<
el
-
select
v
-
model
=
"
item.packagingTypes
"
multiple
placeholder
=
"
请选择
"
style
=
"
width: 100%; max-width: 450px; margin-bottom: 5px; display: block
"
>
<
el
-
option
v
-
for
=
"
item in packagingList
"
:
key
=
"
item.value
"
:
label
=
"
$l(item, 'label')
"
:
value
=
"
item.value
"
>
<
/el-option
>
<
/el-select
>
<
el
-
input
-
number
v
-
model
=
"
item.packagingPrice
"
:
controls
=
"
false
"
:
min
=
"
0
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
selector
disabled
v
-
model
=
"
item.packagingPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
item.packagingVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
template
v
-
if
=
"
i == value.packagingList.length -1 && !readonly
"
>
<
el
-
link
type
=
"
primary
"
@
click
.
native
=
"
addPackage
"
class
=
"
ml-5
"
>
{{
$t
(
'
添加
'
)
}}
<
/el-link
>
<
el
-
divider
direction
=
"
vertical
"
><
/el-divider
>
<
el
-
link
type
=
"
danger
"
@
click
.
native
=
"
deletePackage(i)
"
>
{{
$t
(
'
删除
'
)
}}
<
/el-link
>
<
/template
>
<
div
v
-
if
=
"
!item.packagingTypes || !item.packagingTypes.length
"
class
=
"
tips
"
>
{{
$t
(
'
未选择包装类型,将被忽略
'
)
}}
<
/div
>
<
/el-form-item
>
<
/template
>
<
/div
>
<
/template
>
<
style
scoped
lang
=
"
scss
"
>
.
bold
{
font
-
weight
:
bold
;
}
.
text
-
lg
{
font
-
size
:
1.3
rem
;
}
.
tips
{
font
-
size
:
1
rem
;
color
:
red
;
}
<
/style
>
src/views/ecw/productPrice/components/QuickSet.vue
View file @
fbcb198b
...
...
@@ -32,7 +32,7 @@ export default {
</
script
>
<
template
>
<dv>
<d
i
v>
<h2>
{{
$t
(
'
快捷设置
'
)
}}
</h2>
<div
class=
"flex items-center"
>
{{
$t
(
'
批量加价
'
)
}}
+
...
...
@@ -51,7 +51,7 @@ export default {
<div
class=
"mt-10"
>
<el-button
@
click=
"$emit('confirm', quickForm)"
type=
"primary"
:disabled=
"!quickForm.plus && !quickForm.minus"
>
{{
$t
(
'
确定
'
)
}}
</el-button>
</div>
</dv>
</d
i
v>
</
template
>
<
style
scoped
lang=
"scss"
>
...
...
src/views/ecw/productPrice/editAir.vue
View file @
fbcb198b
This diff is collapsed.
Click to expand it.
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