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
0f2a06fa
Commit
0f2a06fa
authored
Oct 31, 2023
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复新建价格默认空运千克,海运立方米
parent
1e2f3497
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
41 deletions
+61
-41
index.vue
src/components/Selector/index.vue
+6
-4
edit.vue
src/views/ecw/productPrice/edit.vue
+55
-37
No files found.
src/components/Selector/index.vue
View file @
0f2a06fa
...
...
@@ -7,7 +7,7 @@
export
default
{
data
(){
return
{
valueSync
:
null
valueSync
:
undefined
}
},
props
:{
...
...
@@ -47,10 +47,12 @@ export default {
},
watch
:{
valueSync
(
val
){
console
.
log
(
'
valueSync变化
'
,
val
,
this
.
value
)
this
.
$emit
(
'
input
'
,
val
)
},
value
(
value
){
this
.
valueSync
=
value
console
.
log
(
'
value传值变化
'
,
value
,
this
.
valueSync
)
if
(
value
!==
undefined
)
this
.
valueSync
=
value
},
optionsFormated
(){
this
.
setDefault
()
...
...
src/views/ecw/productPrice/edit.vue
View file @
0f2a06fa
...
...
@@ -111,17 +111,17 @@
-
<
el
-
input
v
-
model
=
"
item.endNum
"
type
=
"
number
"
placeholder
=
""
class
=
"
w-100
"
><
/el-input
>
/
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.weightUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable
class
=
"
w-100
"
/>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.weightUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认运费')
"
v
-
if
=
"
form.priceType != 1
"
:
prop
=
"
`priceStepList.${index
}
.transportPrice`
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
item.transportPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.transportPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable
class
=
"
w-100
"
/>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id"
defaultable
class="w-100" /
>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.transportPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id" class="w-100" /
>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认清关费')
"
v
-
if
=
"
form.priceType != 1 && type != 'air'
"
:
prop
=
"
`priceStepList.${index
}
.transportPrice`
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
item.clearancePrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
/>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.clearancePriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable
class
=
"
w-100
"
/>
/ <selector disabled @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id"
defaultable
class="w-100" /
>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.clearancePriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/ <selector disabled @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id" class="w-100" /
>
<
/el-form-item
>
<
el
-
form
-
item
...
...
@@ -130,31 +130,31 @@
:
prop
=
"
`priceStepList.${index
}
.allPrice`
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.allPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable
class
=
"
w-100
"
/>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.allPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
item.allPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 ml-10
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
/>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id"
defaultable
class="w-100" /
>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id" class="w-100" /
>
<
/el-form-item
>
<
/div
>
<
/template
>
<
template
v
-
else
>
<
el
-
form
-
item
:
label
=
"
$t('默认全包价')
"
v
-
if
=
"
form.priceType == 1
"
prop
=
"
allPrice
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
test
=
"
allPriceUnit
"
v
-
model
=
"
form.allPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10 aaa
"
/>
<
selector
test
=
"
allPriceUnit
"
v
-
model
=
"
form.allPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100 mr-10 aaa
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
form.allPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
v
-
model
=
"
form.allVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
selector
v
-
model
=
"
form.allVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
template
v
-
else
>
<
el
-
form
-
item
:
label
=
"
$t('默认运费')
"
prop
=
"
transportPrice
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
v
-
model
=
"
form.transportPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
selector
v
-
model
=
"
form.transportPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100 mr-10
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
form.transportPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
v
-
model
=
"
form.transportVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
selector
v
-
model
=
"
form.transportVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
v
-
if
=
"
type != 'air'
"
:
label
=
"
$t('默认清关费')
"
prop
=
"
clearancePrice
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
v
-
model
=
"
form.clearancePriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
selector
v
-
model
=
"
form.clearancePriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100 mr-10
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
form.clearancePrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
form.clearanceVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
selector
disabled
v
-
model
=
"
form.clearanceVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
/template
>
...
...
@@ -505,7 +505,7 @@ export default {
if
(
priceType
==
1
&&
!
this
.
form
.
allPrice
){
this
.
$set
(
this
.
form
,
'
allPriceUnit
'
,
1
)
}
this
.
syncAllUnit
()
this
.
syncAllUnit
(
'
watch:form.priceType
'
)
}
,
'
form.minWeightUnit
'
(
minWeightUnit
){
console
.
log
(
'
最小起计量单位
'
,
minWeightUnit
)
...
...
@@ -541,7 +541,7 @@ export default {
if
(
stepPrice
==
1
&&
(
!
this
.
form
.
priceStepList
||
!
this
.
form
.
priceStepList
.
length
)){
this
.
$set
(
this
.
form
,
'
priceStepList
'
,
[{
}
,{
}
])
}
this
.
syncAllUnit
()
this
.
syncAllUnit
(
'
watch:form.stepPrice
'
)
this
.
stepPrice
=
!!
stepPrice
}
,
needPay
(
val
){
...
...
@@ -570,6 +570,13 @@ export default {
if
(
this
.
$route
.
query
.
readonly
){
this
.
readonly
=
true
}
if
(
this
.
type
==
'
air
'
){
this
.
stepPrice
=
true
}
const
defaultVolumeUnit
=
this
.
type
===
'
air
'
?
6
:
7
const
defaultPriceUnit
=
1
// action=batchUpdate 表示批量修改单个商品的价格(一条或者多条),如果没有ids显示路线选择组件,否则不显示路线组件
// action=update 表示修改单个商品的单条路线价格,需要回显
if
(
this
.
$route
.
query
.
action
==
'
update
'
){
...
...
@@ -594,6 +601,21 @@ export default {
this
.
form
.
validateEndDate
=
parseTime
(
res
.
data
.
validateEndDate
)
}
this
.
lineList
=
[
res
.
data
]
// 如果是阶梯价格,但是一个阶梯价都没有(异常数据),则默认给两个阶梯价
if
(
this
.
form
.
stepPrice
==
1
&&
(
!
this
.
form
.
priceStepList
||
!
this
.
form
.
priceStepList
.
length
)){
const
defaultStep
=
this
.
form
.
priceType
==
1
?
{
allPriceUnit
:
defaultPriceUnit
,
allVolumeUnit
:
defaultVolumeUnit
,
weightUnit
:
defaultVolumeUnit
}
:
{
transportVolumeUnit
:
defaultVolumeUnit
,
transportPriceUnit
:
defaultPriceUnit
,
weightUnit
:
defaultVolumeUnit
}
console
.
log
(
'
阶梯价没有阶梯信息,默认给两个
'
,
{...
defaultStep
}
)
this
.
$set
(
this
.
form
,
'
priceStepList
'
,
[{...
defaultStep
}
,{...
defaultStep
}
])
}
}
// action=batchUpdate且ids不为空
...
...
@@ -641,17 +663,7 @@ export default {
// 是否单询,默认否
needOrderInquiry
:
0
}
this
.
$nextTick
(()
=>
{
// 默认体积单位,空运为千克,海运为立方米
this
.
setDefaultVolumeUnit
(
this
.
type
===
'
air
'
?
6
:
7
)
// 默认货币单位(美元)
this
.
setDefaultPriceUnit
(
1
)
// 空运默认的阶梯重量单位是千克
if
(
this
.
type
===
'
air
'
){
this
.
$set
(
this
.
form
.
priceStepList
[
0
],
'
weightUnit
'
,
6
)
}
}
)
this
.
form
.
validateStartDate
=
parseTime
(
Date
.
now
())
this
.
form
.
validateEndDate
=
parseTime
(
Date
.
now
()
+
86400
*
365
*
2
*
1000
)
...
...
@@ -674,7 +686,21 @@ export default {
}
)
}
}
if
(
!
this
.
$route
.
query
.
action
||
this
.
$route
.
query
.
action
==
'
batchUpdate
'
){
this
.
$nextTick
(()
=>
{
// 默认体积单位,空运为千克,海运为立方米
console
.
log
(
'
指定默认单位
'
,
this
.
type
===
'
air
'
?
6
:
7
)
this
.
setDefaultVolumeUnit
(
this
.
type
===
'
air
'
?
6
:
7
)
// 默认货币单位(美元)
this
.
setDefaultPriceUnit
(
1
)
// 空运默认的阶梯重量单位是千克
if
(
this
.
type
===
'
air
'
){
this
.
$set
(
this
.
form
.
priceStepList
[
0
],
'
weightUnit
'
,
6
)
}
}
)
}
if
(
this
.
$route
.
query
.
product_type
)
{
...
...
@@ -700,18 +726,10 @@ export default {
}
)
}
}
)
// 空命则阶梯订单
this
.
$nextTick
(()
=>
{
if
(
this
.
type
==
'
air
'
){
this
.
stepPrice
=
true
}
}
)
}
,
methods
:
{
// 同步全部单位
syncAllUnit
(){
syncAllUnit
(
from
){
let
obj
=
this
.
form
.
stepPrice
==
1
?
this
.
form
.
priceStepList
[
0
]
:
this
.
form
let
fields
=
{
}
// 全包价
...
...
@@ -729,11 +747,11 @@ export default {
}
}
//
全包
价还需要同步阶梯的重量单位
//
阶梯
价还需要同步阶梯的重量单位
if
(
this
.
form
.
stepPrice
==
1
){
fields
[
'
weightUnit
'
]
=
obj
.
weightUnit
}
console
.
log
(
'
-> 同步特需单位
'
,
fields
)
console
.
log
(
'
-> 同步特需单位
'
,
fields
,
{
from
}
)
this
.
syncSpecialUnit
(
fields
)
}
,
// 同步特需的货币单位和体积单位
...
...
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