Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
0946c9ca
Commit
0946c9ca
authored
Sep 16, 2019
by
chenjundi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cjd' into dev
parents
393b7f69
12e7d0a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
+31
-16
dialog.vue
src/components/gitConfig/dialog.vue
+6
-13
index.vue
src/components/gitConfig/index.vue
+25
-3
No files found.
src/components/gitConfig/dialog.vue
View file @
0946c9ca
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<el-input
v-model=
"form.cost_price"
></el-input>
<el-input
v-model=
"form.cost_price"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"赠品总数"
prop=
"gift_num"
>
<el-form-item
label=
"赠品总数"
prop=
"gift_num"
>
<el-input
v-model=
"form.gift_num"
@
change=
"giftNumChange"
></el-input>
<el-input
v-model=
"form.gift_num"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"库存数量"
prop=
"stock_num"
>
<el-form-item
label=
"库存数量"
prop=
"stock_num"
>
<div>
{{
form
.
stock_num
}}
</div>
<div>
{{
form
.
stock_num
}}
</div>
...
@@ -43,8 +43,8 @@
...
@@ -43,8 +43,8 @@
],
],
data
()
{
data
()
{
const
validGiftNum
=
(
rule
,
value
,
callback
)
=>
{
const
validGiftNum
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
/^
[
\d\/
]
+$/
.
test
(
value
))
{
if
(
!
/^
[
0-9
]
+$/
.
test
(
value
))
{
callback
(
new
Error
(
'只能填
阿拉伯
数字'
));
callback
(
new
Error
(
'只能填数字'
));
}
else
{
}
else
{
callback
();
callback
();
}
}
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
form
:
{
form
:
{
name
:
''
,
name
:
''
,
cost_price
:
''
,
cost_price
:
''
,
gift_num
:
'
/
'
,
gift_num
:
''
,
stock_num
:
0
,
stock_num
:
0
,
type
:
''
type
:
''
},
},
...
@@ -86,22 +86,15 @@
...
@@ -86,22 +86,15 @@
}
}
},
},
methods
:
{
methods
:
{
giftNumChange
()
{
if
(
!
this
.
form
.
gift_num
)
{
this
.
form
.
gift_num
=
'/'
;
}
},
sub
()
{
sub
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
let
json
=
{
let
json
=
{
name
:
this
.
form
.
name
,
name
:
this
.
form
.
name
,
cost_price
:
this
.
form
.
cost_price
,
cost_price
:
this
.
form
.
cost_price
,
type
:
this
.
form
.
type
type
:
this
.
form
.
type
,
gift_num
:
this
.
form
.
gift_num
};
};
if
(
this
.
form
.
gift_num
!=
'/'
)
{
json
.
gift_num
=
this
.
form
.
gift_num
;
}
switch
(
this
.
dialogObj
.
type
)
{
switch
(
this
.
dialogObj
.
type
)
{
case
0
:
case
0
:
giftConfigAddApi
(
json
).
then
(
res
=>
{
giftConfigAddApi
(
json
).
then
(
res
=>
{
...
...
src/components/gitConfig/index.vue
View file @
0946c9ca
...
@@ -22,7 +22,11 @@
...
@@ -22,7 +22,11 @@
</div>
</div>
<div
class=
"table-form"
>
<div
class=
"table-form"
>
<el-table
:data=
"dataList"
size=
"mini"
style=
"width: 100%"
>
<el-table
:data=
"dataList"
size=
"mini"
style=
"width: 100%"
>
<el-table-column
prop=
"id"
label=
"ID"
></el-table-column>
<el-table-column
prop=
"id"
label=
"ID"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
id
|
idFilter
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"赠品名称"
></el-table-column>
<el-table-column
prop=
"name"
label=
"赠品名称"
></el-table-column>
<el-table-column
prop=
"gift_type"
label=
"赠品类型"
>
<el-table-column
prop=
"gift_type"
label=
"赠品类型"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
...
@@ -32,7 +36,8 @@
...
@@ -32,7 +36,8 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"cost_price"
label=
"成本价"
></el-table-column>
<el-table-column
prop=
"cost_price"
label=
"成本价"
></el-table-column>
<el-table-column
prop=
"gift_num"
label=
"赠品总数"
></el-table-column>
<el-table-column
prop=
"gift_num"
label=
"赠品总数"
>
</el-table-column>
<el-table-column
prop=
"stock_num"
label=
"库存数量"
></el-table-column>
<el-table-column
prop=
"stock_num"
label=
"库存数量"
></el-table-column>
<el-table-column
prop=
"get_num"
label=
"领取数量"
></el-table-column>
<el-table-column
prop=
"get_num"
label=
"领取数量"
></el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
>
<el-table-column
prop=
"status"
label=
"状态"
>
...
@@ -44,7 +49,10 @@
...
@@ -44,7 +49,10 @@
<el-table-column
width=
"150"
label=
"操作"
>
<el-table-column
width=
"150"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
plain
@
click=
"edit(scope.row)"
>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
plain
@
click=
"edit(scope.row)"
>
编辑
</el-button>
<el-button
type=
"warning"
size=
"mini"
plain
@
click=
"onDown(scope.row)"
>
下架
</el-button>
<el-button
v-if=
"scope.row.status == 1"
type=
"warning"
size=
"mini"
plain
@
click=
"onDown(scope.row)"
>
下架
</el-button>
<el-button
v-if=
"scope.row.status == 2"
type=
"success"
size=
"mini"
plain
@
click=
"onDown(scope.row)"
>
上架
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -67,6 +75,20 @@
...
@@ -67,6 +75,20 @@
page
,
page
,
dialogCom
dialogCom
},
},
filters
:
{
idFilter
(
val
)
{
val
=
val
.
toString
();
if
(
val
.
length
==
1
)
{
return
`000
${
val
}
`
}
else
if
(
val
.
length
==
2
)
{
return
`00
${
val
}
`
}
else
if
(
val
.
length
==
3
)
{
return
`0
${
val
}
`
}
else
{
return
val
}
}
},
data
()
{
data
()
{
return
{
return
{
searchFrom
:
{
searchFrom
:
{
...
...
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