Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-merchant-data
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3948c963
authored
Mar 27, 2019
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改商户分组添加商户的验证
1 parent
47c5ec24
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
src/views/customer/businessManagement/addBusiness.vue
src/views/customer/businessManagement/addBusiness.vue
View file @
3948c96
...
@@ -31,8 +31,11 @@
...
@@ -31,8 +31,11 @@
<span
v-show=
"errorBags.has('merchant')"
class=
"error"
>
{{
errorBags
.
first
(
'merchant'
)
}}
</span>
<span
v-show=
"errorBags.has('merchant')"
class=
"error"
>
{{
errorBags
.
first
(
'merchant'
)
}}
</span>
</gl-form-item>
</gl-form-item>
<gl-form-item
label=
"商户类型:"
prop=
"merchantType"
>
<gl-form-item
label=
"商户类型:"
prop=
"merchantType"
>
<gl-select
v-model=
"addForm.merchantType"
name=
"merchantType"
<gl-select
v-model=
"addForm.merchantType"
data-vv-as=
"商户类型"
v-validate=
"'required'"
placeholder=
"请搜索"
>
name=
"merchantType"
data-vv-as=
"商户类型"
v-validate=
"'required'"
placeholder=
"请搜索"
>
<gl-option
<gl-option
v-for=
"item in merchantTypeList"
v-for=
"item in merchantTypeList"
:key=
"item.merchantId"
:key=
"item.merchantId"
...
@@ -48,6 +51,9 @@
...
@@ -48,6 +51,9 @@
v-model=
"item.merchant"
v-model=
"item.merchant"
filterable
filterable
remote
remote
:name=
"`item.merchant$
{idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户${idx+1}`"
clearable
clearable
placeholder="请输入商户名称/商户号"
placeholder="请输入商户名称/商户号"
:remote-method="remoteMethod"
:remote-method="remoteMethod"
...
@@ -60,10 +66,16 @@
...
@@ -60,10 +66,16 @@
</gl-option>
</gl-option>
</gl-select>
</gl-select>
<i
v-show=
"item.show"
class=
"el-icon-delete delete"
@
click=
"deleteBusiness(idx)"
></i>
<i
v-show=
"item.show"
class=
"el-icon-delete delete"
@
click=
"deleteBusiness(idx)"
></i>
<span
v-show=
"errorBags.has('merchantType')"
class=
"error"
>
{{
errorBags
.
first
(
'merchantType'
)
}}
</span>
<span
v-show=
"errorBags.has(`item.merchant$
{idx+1}`)" class="error">
{{
errorBags
.
first
(
`item.merchant${idx+1
}
`
)
}}
<
/span
>
<!--
<
span
v
-
show
=
"item.merchant? !item.merchant : !!item.merchantType"
class
=
"error"
>
{{
`请填写子商户${idx+1
}
的商户名称/商户号`
}}
<
/span> --
>
<
/gl-form-item
>
<
/gl-form-item
>
<
gl
-
form
-
item
label
=
"商户类型:"
>
<
gl
-
form
-
item
label
=
"商户类型:"
>
<gl-select
v-model=
"item.merchantType"
clearable
placeholder=
"请选择"
>
<
gl
-
select
v
-
model
=
"item.merchantType"
:
name
=
"
`item.merchantType${idx+1
}
`"
v-validate="
item
.
merchant
||
item
.
merchantType
?
'required'
:
''
"
:data-vv-as="`子商户${idx+1
}
类型`"
clearable
placeholder="
请选择
">
<gl-option
<gl-option
v-for="
item
in
merchantTypeList
"
v-for="
item
in
merchantTypeList
"
:key="
item
.
merchantId
"
:key="
item
.
merchantId
"
...
@@ -71,8 +83,11 @@
...
@@ -71,8 +83,11 @@
:value="
item
.
merchantId
">
:value="
item
.
merchantId
">
</gl-option>
</gl-option>
</gl-select>
</gl-select>
<span v-show="
errorBags
.
has
(
`item.merchantType${idx+1
}
`
)
" class="
error
"
>
{{
errorBags
.
first
(
`item.merchantType${idx+1
}
`
)
}}
<
/span
>
<!--
<
span
v
-
show
=
"item.merchantType? !item.merchantType : !!item.merchant"
class
=
"error"
>
{{
`请填写子商户${idx+1
}
的商户类型`
}}
<
/span> --
>
<
/gl-form-item
>
<
/gl-form-item
>
<
/div
>
<
/div
>
<
span
v
-
show
=
"tip"
class
=
"error"
style
=
"float:right; margin-right: 43px;"
>
{{
'请填写上一条子商户数据'
}}
<
/span
>
<
gl
-
button
@
click
=
"addMore"
>
添加更多
<
/gl-button
>
<
gl
-
button
@
click
=
"addMore"
>
添加更多
<
/gl-button
>
<
/gl-form
>
<
/gl-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
...
@@ -91,6 +106,7 @@ export default {
...
@@ -91,6 +106,7 @@ export default {
}
,
}
,
data
()
{
data
()
{
return
{
return
{
tip
:
false
,
addForm
:
{
addForm
:
{
merchant
:
''
,
merchant
:
''
,
merchantType
:
''
merchantType
:
''
...
@@ -153,7 +169,10 @@ export default {
...
@@ -153,7 +169,10 @@ export default {
methods
:
{
methods
:
{
// 确定按钮
// 确定按钮
ok
()
{
ok
()
{
this
.
tip
=
false
console
.
log
(
this
.
$validator
)
this
.
$validator
.
validateAll
().
then
((
result
)
=>
{
this
.
$validator
.
validateAll
().
then
((
result
)
=>
{
if
(
this
.
addList
)
if
(
result
)
{
if
(
result
)
{
this
.
addList
.
forEach
(
item
=>
{
this
.
addList
.
forEach
(
item
=>
{
delete
item
.
label
delete
item
.
label
...
@@ -173,10 +192,13 @@ export default {
...
@@ -173,10 +192,13 @@ export default {
}
,
}
,
// 添加更多按钮
// 添加更多按钮
addMore
()
{
addMore
()
{
console
.
log
(
this
.
addList
)
const
len
=
this
.
addList
.
length
-
1
const
len
=
this
.
addList
.
length
-
1
if
(
this
.
addList
[
len
].
merchant
==
''
||
this
.
addList
[
len
].
merchantType
==
''
)
{
if
(
this
.
addList
[
len
].
merchant
==
''
||
this
.
addList
[
len
].
merchantType
==
''
)
{
console
.
log
(
'请填写完上一条数据'
)
console
.
log
(
'请填写完上一条数据'
)
this
.
tip
=
true
}
else
{
}
else
{
this
.
tip
=
false
this
.
addList
.
push
({
this
.
addList
.
push
({
label
:
'子商户'
+
(
this
.
addList
.
length
+
1
),
label
:
'子商户'
+
(
this
.
addList
.
length
+
1
),
merchant
:
''
,
merchant
:
''
,
...
...
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