Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_admin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_admin
Commits
90aa6c74
Commit
90aa6c74
authored
Mar 27, 2024
by
gaia
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feature/20240301_1544_sale' into release_pre_20240327160030
parents
ae122326
08bfd3d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
28 deletions
+50
-28
src/views/sale/saleAdd.vue
src/views/sale/saleAdd.vue
+50
-28
No files found.
src/views/sale/saleAdd.vue
View file @
90aa6c74
...
@@ -69,25 +69,45 @@
...
@@ -69,25 +69,45 @@
<div
slot=
"header"
class=
"clearfix"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
商品设置
</span>
<span>
商品设置
</span>
</div>
</div>
<h5>
上架类型
</h5>
<el-form-item
label=
""
prop=
"type"
>
<el-radio-group
v-model=
"goods.type"
>
<el-radio
:label=
"1"
>
一口价
</el-radio>
<el-radio
:label=
"2"
>
竞拍
</el-radio>
</el-radio-group>
</el-form-item>
<h5>
定价
</h5>
<h5>
定价
</h5>
<div
class=
"item"
>
<div
class=
"item"
>
<el-form-item
label=
"供货
价"
prop=
"distributionPrice"
>
<el-form-item
v-if=
"goods.type === 1"
label=
"分销
价"
prop=
"distributionPrice"
>
<el-input
v-model=
"goods.distributionPrice"
style=
"width: 300px"
>
<el-input
v-model=
"goods.distributionPrice"
style=
"width: 300px"
@
input=
"limitInput($event, 1)"
>
<template
slot=
"prepend"
>
¥
</
template
>
<template
slot=
"prepend"
>
¥
</
template
>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"进货价"
prop=
"supplyPrice"
>
<el-form-item
label=
"进货价"
prop=
"supplyPrice"
>
<el-input
v-model=
"goods.supplyPrice"
style=
"width: 300px"
>
<el-input
v-model=
"goods.supplyPrice"
style=
"width: 300px"
@
input=
"limitInput($event, 2)"
>
<
template
slot=
"prepend"
>
¥
</
template
>
<
template
slot=
"prepend"
>
¥
</
template
>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
</div>
</div>
<div
v-if=
"goods.type === 1"
class=
"item"
>
<el-form-item
label=
"分佣比例"
prop=
"rebate"
>
<el-input
v-model=
"goods.rebate"
style=
"width: 300px"
@
input=
"limitInput($event, 3)"
>
<
template
slot=
"append"
>
%
</
template
>
</el-input>
</el-form-item>
</div>
<div
v-if=
"goods.type === 1"
>
<h5>
库存
</h5>
<h5>
库存
</h5>
<div
class=
"item"
>
<el-form-item
label=
"数量"
prop=
"stock"
>
<el-form-item
label=
"数量"
prop=
"stock"
>
<el-input-number
v-model=
"goods.stock"
:step=
"1"
style=
"width: 200px"
/>
<el-input-number
v-model=
"goods.stock"
:step=
"1"
style=
"width: 200px"
/>
</el-form-item>
</el-form-item>
</div>
</div>
<div
v-if=
"goods.type === 1"
>
<h5>
限购
</h5>
<h5>
限购
</h5>
<div
class=
"item"
>
<el-form-item
label=
""
prop=
"numType"
>
<el-form-item
label=
""
prop=
"numType"
>
<div
class=
"item"
>
<div
class=
"item"
>
<el-radio-group
v-model=
"numType"
@
change=
"handlerNumTypeChange"
>
<el-radio-group
v-model=
"numType"
@
change=
"handlerNumTypeChange"
>
...
@@ -98,17 +118,11 @@
...
@@ -98,17 +118,11 @@
<el-input-number
v-model=
"goods.buyLimitNum"
:step=
"1"
style=
"width: 200px"
/>
<el-input-number
v-model=
"goods.buyLimitNum"
:step=
"1"
style=
"width: 200px"
/>
</el-form-item>
</el-form-item>
</div>
</div>
</el-form-item>
<h5>
上架类型
</h5>
<el-form-item
label=
""
prop=
"type"
>
<el-radio-group
v-model=
"goods.type"
>
<el-radio
:label=
"1"
>
一口价
</el-radio>
<el-radio
:label=
"2"
>
竞拍
</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item>
</div>
</div>
<div
v-if=
"goods.type === 2"
>
<div
v-if=
"goods.type === 2"
>
<h5>
竞拍设置
</h5>
<div
class=
"item"
>
<div
class=
"item"
>
<el-form-item
label=
"开始时间"
prop=
"auctionStartTime"
>
<el-form-item
label=
"开始时间"
prop=
"auctionStartTime"
>
<el-date-picker
<el-date-picker
...
@@ -189,6 +203,7 @@ export default {
...
@@ -189,6 +203,7 @@ export default {
images
:
[{
required
:
true
,
message
:
'
至少一张图片
'
,
trigger
:
'
blur
'
}],
images
:
[{
required
:
true
,
message
:
'
至少一张图片
'
,
trigger
:
'
blur
'
}],
name
:
[{
required
:
true
,
message
:
'
商品名称不能为空
'
,
trigger
:
'
blur
'
}],
name
:
[{
required
:
true
,
message
:
'
商品名称不能为空
'
,
trigger
:
'
blur
'
}],
stock
:
[{
required
:
true
,
message
:
'
数量不能为空
'
,
trigger
:
'
blur
'
}],
stock
:
[{
required
:
true
,
message
:
'
数量不能为空
'
,
trigger
:
'
blur
'
}],
rebate
:
[{
required
:
true
,
message
:
'
数量不能为空
'
,
trigger
:
'
blur
'
}],
distributionPrice
:
[{
required
:
true
,
message
:
'
供货价不能为空
'
,
trigger
:
'
blur
'
}],
distributionPrice
:
[{
required
:
true
,
message
:
'
供货价不能为空
'
,
trigger
:
'
blur
'
}],
buyLimitNum
:
[{
required
:
true
,
message
:
'
限购数量不能为空
'
,
trigger
:
'
blur
'
}],
buyLimitNum
:
[{
required
:
true
,
message
:
'
限购数量不能为空
'
,
trigger
:
'
blur
'
}],
auctionStartTime
:
[{
required
:
true
,
message
:
'
开始时间不能为空
'
,
trigger
:
'
blur
'
}],
auctionStartTime
:
[{
required
:
true
,
message
:
'
开始时间不能为空
'
,
trigger
:
'
blur
'
}],
...
@@ -415,12 +430,19 @@ export default {
...
@@ -415,12 +430,19 @@ export default {
* 金额输入
* 金额输入
* @param value
* @param value
*/
*/
limitInput
(
value
)
{
limitInput
(
value
,
type
)
{
this
.
goods
.
price
=
(
''
+
value
)
// 第一步:转成字符串
const
price
=
(
''
+
value
)
// 第一步:转成字符串
.
replace
(
/
[^\d
^
\.]
+/g
,
''
)
// 第二步:把不是数字,不是小数点的过滤掉
.
replace
(
/
[^\d
^
\.]
+/g
,
''
)
// 第二步:把不是数字,不是小数点的过滤掉
.
replace
(
/^0+
(\d)
/
,
'
$1
'
)
// 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字
.
replace
(
/^0+
(\d)
/
,
'
$1
'
)
// 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字
.
replace
(
/^
\.
/
,
'
0.
'
)
// 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全
.
replace
(
/^
\.
/
,
'
0.
'
)
// 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全
.
match
(
/^
\d
*
(\.?\d{0,2})
/g
)[
0
]
||
''
// 第五步:最终匹配得到结果 以数字开头,只有一个小数点, 而且小数点后面只能有0到2位小数
.
match
(
/^
\d
*
(\.?\d{0,2})
/g
)[
0
]
||
''
// 第五步:最终匹配得到结果 以数字开头,只有一个小数点, 而且小数点后面只能有0到2位小数
if
(
type
===
1
)
{
this
.
goods
.
distributionPrice
=
price
}
else
if
(
type
===
2
)
{
this
.
goods
.
supplyPrice
=
price
}
else
if
(
type
===
3
)
{
this
.
goods
.
rebate
=
price
}
},
},
uploadOverrun
:
function
()
{
uploadOverrun
:
function
()
{
this
.
$message
({
this
.
$message
({
...
...
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