Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
刘文虎
account-book
Commits
25be66d1
Commit
25be66d1
authored
Sep 21, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复APP新增自定义报价错误
parent
7907c2f6
Pipeline
#3516
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
33 deletions
+52
-33
index.vue
components/pop-input-view/index.vue
+1
-1
create-price.vue
pages/bill/quoted-price/create/create-price.vue
+49
-29
custom.vue
pages/bill/quoted-price/custom/custom.vue
+2
-3
No files found.
components/pop-input-view/index.vue
View file @
25be66d1
...
@@ -156,7 +156,7 @@ export default {
...
@@ -156,7 +156,7 @@ export default {
}
}
},
},
created
()
{
created
()
{
console
.
log
(
'-----'
,
this
.
$slots
);
//
console.log('-----', this.$slots);
},
},
destroyed
()
{},
destroyed
()
{},
methods
:
{
methods
:
{
...
...
pages/bill/quoted-price/create/create-price.vue
View file @
25be66d1
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
</view>
</view>
</u-form-item>
</u-form-item>
<u-form-item
label=
"价格"
label-position=
"left"
prop=
"offerMinPrice"
required
>
<u-form-item
label=
"价格"
label-position=
"left"
prop=
"offerMinPrice"
required
>
<view
class=
"price-view"
:class=
"
{ scope: form.offerType === 'scope' }"
>
<view
class=
"price-view"
>
<u-input
<u-input
type=
"digit"
type=
"digit"
v-model=
"form.offerMinPrice"
v-model=
"form.offerMinPrice"
...
@@ -44,7 +44,8 @@
...
@@ -44,7 +44,8 @@
:clearable=
"false"
:clearable=
"false"
input-align=
"right"
input-align=
"right"
maxlength=
"11"
maxlength=
"11"
class=
"form-input price-view-input"
class=
"form-input"
:custom-style=
"inputCustomStyle"
/>
/>
<view
class=
"price-view-max"
v-if=
"form.offerType === 'scope'"
>
<view
class=
"price-view-max"
v-if=
"form.offerType === 'scope'"
>
<text
class=
"price-view-max-line"
>
-
</text>
<text
class=
"price-view-max-line"
>
-
</text>
...
@@ -55,7 +56,8 @@
...
@@ -55,7 +56,8 @@
:clearable=
"false"
:clearable=
"false"
input-align=
"right"
input-align=
"right"
maxlength=
"11"
maxlength=
"11"
class=
"form-input price-view-input"
class=
"form-input"
:custom-style=
"inputCustomStyle"
/>
/>
</view>
</view>
</view>
</view>
...
@@ -87,7 +89,7 @@ import PopInput from '@/components/pop-input-view';
...
@@ -87,7 +89,7 @@ import PopInput from '@/components/pop-input-view';
import
CheckboxGroups
from
'@/components/checkbox-groups/checkbox-groups.vue'
;
import
CheckboxGroups
from
'@/components/checkbox-groups/checkbox-groups.vue'
;
import
{
baseUrl
}
from
'@/utils/config.js'
;
import
{
baseUrl
}
from
'@/utils/config.js'
;
import
{
priceTypeOptions
}
from
'@/utils/options/bill/quoted-price.js'
;
import
{
priceTypeOptions
}
from
'@/utils/options/bill/quoted-price.js'
;
import
{
getOfferPriceInfo
,
updateOfferPrice
,
getClassificationList
,
deleteOfferPrice
}
from
'@/api/bill/quoted-price.js'
;
import
{
getOfferPriceInfo
,
updateOfferPrice
,
getClassificationList
,
deleteOfferPrice
}
from
'@/api/bill/quoted-price.js'
;
export
default
{
export
default
{
components
:
{
NavbarRight
,
PopInput
,
CheckboxGroups
,
BottomButtons
},
components
:
{
NavbarRight
,
PopInput
,
CheckboxGroups
,
BottomButtons
},
...
@@ -122,31 +124,33 @@ export default {
...
@@ -122,31 +124,33 @@ export default {
},
},
errorType
:
[
'toast'
,
'border-bottom'
],
errorType
:
[
'toast'
,
'border-bottom'
],
rules
:
{
rules
:
{
classificationId
:
[{
required
:
true
,
message
:
'请选择服务分类'
,
trigger
:
[
'
change'
,
'
blur'
]
}],
classificationId
:
[{
required
:
true
,
message
:
'请选择服务分类'
,
trigger
:
[
'blur'
]
}],
offerName
:
[{
required
:
true
,
message
:
'请输入价格名称'
,
trigger
:
[
'
change'
,
'
blur'
]
}],
offerName
:
[{
required
:
true
,
message
:
'请输入价格名称'
,
trigger
:
[
'blur'
]
}],
offerType
:
[{
required
:
true
,
message
:
'请选择价格类型'
,
trigger
:
[
'
change'
,
'
blur'
]
}],
offerType
:
[{
required
:
true
,
message
:
'请选择价格类型'
,
trigger
:
[
'blur'
]
}],
offerMinPrice
:
[
offerMinPrice
:
[
{
required
:
true
,
message
:
'请输入价格'
,
trigger
:
[
'blur'
]
},
{
required
:
true
,
message
:
'请输入价格'
,
trigger
:
[
'blur'
]
},
{
{
required
:
true
,
// 自定义验证函数,见上说明
// 自定义验证函数,见上说明
asyncValidator
:
(
rule
,
value
,
callback
)
=>
{
asyncValidator
:
(
rule
,
value
,
callback
)
=>
{
// 上面有说,返回true表示校验通过,返回false表示不通过
// 上面有说,返回true表示校验通过,返回false表示不通过
// this.$u.test.mobile()就是返回true或者false的
// this.$u.test.mobile()就是返回true或者false的
console
.
log
(
"asyncValidator"
)
if
(
this
.
form
.
offerType
===
'scope'
)
{
if
(
this
.
form
.
offerType
===
'scope'
){
if
(
!
value
)
{
if
(
!
value
){
callback
(
new
Error
(
'请输入完整价格'
));
callback
(
new
Error
(
'请输入完整价格'
))
}
else
if
(
!
this
.
form
.
offerMaxPrice
)
{
}
else
if
(
this
.
form
.
offerMaxPrice
<=
value
){
callback
(
new
Error
(
'请输入完整价格'
));
callback
(
new
Error
(
'最高价格不能低于最低价格'
))
}
else
if
(
parseFloat
(
this
.
form
.
offerMaxPrice
)
<
parseFloat
(
value
))
{
}
else
{
callback
(
new
Error
(
'最高价格不能低于最低价格'
));
callback
()
}
else
{
callback
();
}
}
}
else
{
}
else
{
callback
()
callback
()
;
}
}
},
},
// 触发器可以同时用blur和change
// 触发器可以同时用blur和change
trigger
:
[
'
change'
,
'
blur'
]
trigger
:
[
'blur'
]
}
}
]
]
},
},
...
@@ -154,6 +158,19 @@ export default {
...
@@ -154,6 +158,19 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
inputCustomStyle
()
{
let
style
=
{
'font-size'
:
'28rpx'
};
let
style1
=
{
'font-size'
:
'28rpx'
,
width
:
'156rpx'
,
padding
:
'0 24rpx'
,
'background-color'
:
'#f6f7fa'
,
'border-radius'
:
'16rpx'
};
return
this
.
form
.
offerType
===
'scope'
?
style1
:
style
;
},
disabled
()
{
disabled
()
{
let
flag
=
!
this
.
form
.
classificationId
||
!
this
.
form
.
offerName
||
!
this
.
form
.
offerType
||
!
this
.
form
.
offerMinPrice
;
let
flag
=
!
this
.
form
.
classificationId
||
!
this
.
form
.
offerName
||
!
this
.
form
.
offerType
||
!
this
.
form
.
offerMinPrice
;
if
(
this
.
form
.
offerType
===
'scope'
)
{
if
(
this
.
form
.
offerType
===
'scope'
)
{
...
@@ -219,8 +236,7 @@ export default {
...
@@ -219,8 +236,7 @@ export default {
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
$refs
.
uForm
.
validate
(
valid
=>
{
this
.
$refs
.
uForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
let
{
createdTime
,
time
}
=
this
.
form
;
console
.
log
(
'验证成功'
);
this
.
form
.
startTime
=
createdTime
+
' '
+
time
+
':00'
;
this
.
save
();
this
.
save
();
}
else
{
}
else
{
this
.
loading
=
false
;
this
.
loading
=
false
;
...
@@ -232,7 +248,10 @@ export default {
...
@@ -232,7 +248,10 @@ export default {
let
title
=
this
.
form
.
id
?
'修改'
:
'新增'
;
let
title
=
this
.
form
.
id
?
'修改'
:
'新增'
;
try
{
try
{
let
{
data
}
=
await
updateOfferPrice
({
...
this
.
form
,
templateId
:
this
.
templateId
});
let
{
data
}
=
await
updateOfferPrice
({
...
this
.
form
,
templateId
:
this
.
templateId
});
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
title
+
'成功'
,
title
:
title
+
'成功'
,
type
:
'success'
,
type
:
'success'
,
...
@@ -355,6 +374,13 @@ export default {
...
@@ -355,6 +374,13 @@ export default {
}
}
.form-input
{
.form-input
{
font-weight
:
bold
;
font-weight
:
bold
;
font-size
:
28rpx
;
}
.price-view-input
{
width
:
156rpx
;
background-color
:
#f6f7fa
;
padding
:
0
24rpx
;
border-radius
:
16rpx
;
}
}
.price-view
{
.price-view
{
width
:
100%
;
width
:
100%
;
...
@@ -365,19 +391,13 @@ export default {
...
@@ -365,19 +391,13 @@ export default {
&
-max
{
&
-max
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
flex-shrink
:
0
;
width
:
270rpx
;
&
-line
{
&
-line
{
margin
:
0
24rpx
;
margin
:
0
24rpx
;
}
}
}
}
}
}
.scope
{
.price-view-input
{
width
:
156rpx
;
background-color
:
#f6f7fa
;
padding
:
0
24rpx
;
border-radius
:
16rpx
;
}
}
}
}
.submit
{
.submit
{
width
:
100%
;
width
:
100%
;
...
...
pages/bill/quoted-price/custom/custom.vue
View file @
25be66d1
...
@@ -45,11 +45,10 @@
...
@@ -45,11 +45,10 @@
<view
class=
"collapse-body-bottom"
>
<view
class=
"collapse-body-bottom"
>
<text
class=
"collapse-body-bottom-price"
>
<text
class=
"collapse-body-bottom-price"
>
<text>
¥
</text>
<text>
¥
</text>
<text>
{{
item2
.
offerMinPrice
}}
</text>
<text
v-if=
"item2.offerType === 'scope'"
>
<text
v-if=
"item2.offerType === 'scope'"
>
<text>
-
</text>
{{
item2
.
customPrice
||
0
}}
<text>
{{
item2
.
offerMaxPrice
}}
</text>
</text>
</text>
<text
v-else
>
{{
item2
.
offerMinPrice
}}
</text>
</text>
</text>
<view
class=
"collapse-body-bottom-add"
>
<view
class=
"collapse-body-bottom-add"
>
<zb-tooltip
placement=
"top-end"
ref=
"tooltip1"
color=
"#7f7f7f"
:visible=
"!quotedPriceTooltip"
>
<zb-tooltip
placement=
"top-end"
ref=
"tooltip1"
color=
"#7f7f7f"
:visible=
"!quotedPriceTooltip"
>
...
...
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