Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c0b11903
authored
Aug 19, 2025
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加前挡
1 parent
110b1e90
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
30 deletions
assets/css/sprite.scss
pages/boutique/tool/components/CreateOrder.vue
pages/boutique/tool/components/Product.vue
pages/boutique/tool/contant.js
assets/css/sprite.scss
View file @
c0b1190
This diff is collapsed.
Click to expand it.
pages/boutique/tool/components/CreateOrder.vue
View file @
c0b1190
...
...
@@ -21,7 +21,7 @@
</scroll-view>
</view>
<!-- 弹窗 -->
<order-popup
ref=
"orderPopup"
:data=
"orderObj"
@
onConfirm=
"onConfirm"
:externalData=
"externalData"
<order-popup
ref=
"orderPopup"
:data=
"orderObj"
:dataKey=
"valueKey"
@
onConfirm=
"onConfirm"
:externalData=
"externalData"
:popupType=
"popupType"
/>
</view>
</template>
...
...
@@ -59,19 +59,6 @@ export default {
},
data
()
{
return
{
formObj
:
{
userInfo
:
{},
deliveryUserInfo
:
{},
subShopMerchantInfo
:
{},
sellerUserInfo
:
{},
salesType
:
'0'
,
customerSex
:
'1'
,
experienceFlag
:
'Y'
,
payeeType
:
0
,
selectPayType
:
'3'
,
carBrand
:
{},
customerPhone
:
''
},
formList
:
utils
.
deepClone
(
FORM_LIST
),
userInfo
:
{},
baseConfigData
:
{},
...
...
@@ -80,7 +67,7 @@ export default {
customer
:
{},
customerSex
:
'1'
,
experienceFlag
:
'Y'
,
payeeType
:
0
,
payeeType
:
1
,
salesType
:
'0'
,
frontGear
:
null
,
},
// 弹窗传入的数据},
...
...
@@ -94,7 +81,8 @@ export default {
configPayTypeList
:
[],
// 园区店配置支持的支付方式
payTypeList
,
goodsList
:
[],
positionTypeList
:
[]
positionTypeList
:
[],
valueKey
:
''
,
}
},
computed
:
{
...
...
@@ -145,6 +133,11 @@ export default {
}
else
{
this
.
externalData
=
[];
}
// 定义产品相关字段数组
const
productFields
=
[
'frontGear'
,
'frontWindow'
,
'rearGear'
,
'rearWindow'
,
'sunRoof'
];
if
(
productFields
.
includes
(
val
.
value
))
{
this
.
valueKey
=
val
.
value
;
}
console
.
log
(
this
.
popupType
,
this
.
externalData
,
'-------------'
)
this
.
$refs
.
orderPopup
.
open
();
},
...
...
@@ -402,7 +395,6 @@ export default {
})
if
(
data
&&
data
.
length
)
{
this
.
employeeList
=
data
this
.
formObj
.
userInfo
=
data
[
0
]
this
.
$set
(
this
.
orderObj
,
'employeeName'
,
data
[
0
].
staffName
)
this
.
orderObj
.
userId
=
data
[
0
].
uuid
}
...
...
pages/boutique/tool/components/Product.vue
View file @
c0b1190
...
...
@@ -15,13 +15,13 @@
positionTypeList
)
}}
</view>
<view
class=
"front-gear-input"
>
<view
class=
"unit"
>
¥
</view>
<input
class=
"uni-input"
type=
"digit"
placeholder=
"请输入价格"
placeholder-style=
"font-size: 14px"
v-model=
"item.goods.sellPrice"
@
input
=
"validatePrice($event, item, index)"
/>
<input
class=
"uni-input"
type=
"digit"
maxlength=
"9"
placeholder=
"请输入价格"
placeholder-style=
"font-size: 14px"
v-model=
"item.goods.sellPrice"
@
blur
=
"validatePrice($event, item, index)"
/>
</view>
</view>
<view
class=
"control"
>
<view
class=
"minus"
@
click=
"decreaseNumber(item)"
>
-
</view>
<input
class=
"uni-input control-input"
type=
"number"
v-model=
"item.goods.number"
@
input=
"validateNumber($event, item)"
/>
<input
class=
"uni-input control-input"
type=
"number"
maxlength=
"3"
v-model=
"item.goods.number"
@
input=
"validateNumber($event, item)"
/>
<view
class=
"add"
@
click=
"increaseNumber(item)"
>
+
</view>
</view>
</view>
...
...
@@ -57,14 +57,25 @@ export default {
})
},
methods
:
{
circulation
(
data
,
str
)
{
let
arr
=
str
.
split
(
'.'
),
result
;
if
(
arr
.
length
)
{
result
=
arr
.
reduce
((
pre
,
key
)
=>
{
return
pre
[
key
]
},
data
)
}
return
result
;
},
// 格式化位置信息
formatPosition
(
item
,
positionTypeList
)
{
const
filterData
=
positionTypeList
.
filter
(
v
=>
v
.
positionValue
==
item
)
return
(
filterData
.
length
&&
filterData
[
0
]
&&
filterData
[
0
].
positionName
)
||
''
},
// 验证价格输入
validatePrice
(
event
,
item
)
{
validatePrice
(
event
,
item
,
index
)
{
let
value
=
event
.
detail
.
value
console
.
log
(
'value'
,
value
)
// 限制只能输入数字和小数点
value
=
value
.
replace
(
/
[^\d
.
]
/g
,
''
)
// 限制只能有一个小数点
...
...
@@ -79,12 +90,12 @@ export default {
value
=
parts
.
join
(
'.'
)
}
}
// 限制最大值为100000
// 限制最
大值为100000
if
(
parseFloat
(
value
)
>
100000
)
{
value
=
'100000'
}
// 限制最小值为0
if
(
parseFloat
(
value
)
<
0
)
{
if
(
parseFloat
(
value
)
<
0
||
parseFloat
(
value
)
==
0
)
{
value
=
'0'
}
if
(
item
.
goods
.
validMinSellPrice
===
'Y'
&&
item
.
goods
.
minSellPrice
&&
parseFloat
(
value
)
<
parseFloat
(
item
.
goods
.
minSellPrice
))
{
...
...
@@ -92,7 +103,8 @@ export default {
value
=
item
.
goods
.
minSellPrice
.
toString
()
}
// 更新值
this
.
$set
(
item
.
goods
,
'sellPrice'
,
value
)
// this.$set(item.goods, 'sellPrice', value)
this
.
$set
(
this
.
list
[
index
].
goods
,
'sellPrice'
,
value
)
},
// 验证数量输入
validateNumber
(
event
,
item
)
{
...
...
@@ -100,7 +112,7 @@ export default {
// 限制只能输入整数
value
=
value
.
replace
(
/
[^\d]
/g
,
''
)
// 如果为空或0,设置为1
if
(
!
value
||
parseInt
(
value
)
===
0
)
{
if
(
!
value
||
value
.
trim
()
===
''
||
parseInt
(
value
)
===
0
)
{
value
=
'1'
}
// 更新值
...
...
@@ -111,18 +123,23 @@ export default {
if
(
!
item
.
goods
.
number
)
{
this
.
$set
(
item
.
goods
,
'number'
,
'1'
)
}
else
{
const
newValue
=
parseInt
(
item
.
goods
.
number
)
+
1
const
currentValue
=
parseInt
(
item
.
goods
.
number
)
// 限制最大数量为999
const
newValue
=
currentValue
>=
999
?
999
:
currentValue
+
1
this
.
$set
(
item
.
goods
,
'number'
,
newValue
.
toString
())
}
},
// 减少数量
decreaseNumber
(
item
)
{
// 如果商品数量不存在或小于等于1,设置为1
if
(
!
item
.
goods
.
number
||
parseInt
(
item
.
goods
.
number
)
<=
1
)
{
this
.
$set
(
item
.
goods
,
'number'
,
'1'
)
}
else
{
const
newValue
=
parseInt
(
item
.
goods
.
number
)
-
1
this
.
$set
(
item
.
goods
,
'number'
,
newValue
.
toString
())
return
}
const
currentValue
=
parseInt
(
item
.
goods
.
number
)
// 确保减少后的值不小于1
const
newValue
=
Math
.
max
(
1
,
currentValue
-
1
)
this
.
$set
(
item
.
goods
,
'number'
,
newValue
.
toString
())
}
}
}
...
...
pages/boutique/tool/contant.js
View file @
c0b1190
...
...
@@ -133,7 +133,7 @@ const FORM_LIST = [
noBorder
:
true
},
{
label
:
'前
档
'
,
label
:
'前
挡
'
,
value
:
'frontGear'
,
type
:
'select'
,
key
:
'name'
,
...
...
@@ -196,7 +196,7 @@ const FORM_LIST = [
value
:
'payeeType'
,
type
:
'radio'
,
key
:
'name'
,
current
:
'
0
'
,
current
:
'
1
'
,
radioList
:
[
{
value
:
'0'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment