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 e9fd7dac
authored
Mar 28, 2019
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加公共方法 resetSearch
1 parent
57978827
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
279 deletions
src/common/common.js
src/views/customer/businessGroupDetail/index.vue
src/views/customer/businessManagement/addBusiness.vue
src/views/customer/businessManagement/index.vue
src/common/common.js
View file @
e9fd7da
...
@@ -23,6 +23,13 @@ function jumpLink(url, params, _this) {
...
@@ -23,6 +23,13 @@ function jumpLink(url, params, _this) {
// document.getElementById('child_iframe_1192').src=url + urlEncode(params)
// document.getElementById('child_iframe_1192').src=url + urlEncode(params)
}
}
function
resetSearch
(
obj
)
{
for
(
var
item
in
obj
)
{
obj
[
item
]
=
''
}
}
export
{
export
{
jumpLink
jumpLink
,
resetSearch
}
}
src/views/customer/businessGroupDetail/index.vue
View file @
e9fd7da
...
@@ -108,6 +108,7 @@
...
@@ -108,6 +108,7 @@
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
groupDetailMethods
,
request
}
from
'@/api'
import
{
groupDetailMethods
,
request
}
from
'@/api'
import
AddBusiness
from
'./addBusiness'
import
AddBusiness
from
'./addBusiness'
import
{
resetSearch
}
from
'@/common/common'
import
{
CityArea
}
from
'../components'
import
{
CityArea
}
from
'../components'
export
default
{
export
default
{
name
:
'detail'
,
name
:
'detail'
,
...
@@ -128,10 +129,10 @@ export default {
...
@@ -128,10 +129,10 @@ export default {
searchParams
:
{
searchParams
:
{
groupId
:
null
,
groupId
:
null
,
merchantName
:
''
,
merchantName
:
''
,
merchantId
:
null
,
merchantId
:
''
,
merchantType
:
null
,
merchantType
:
''
,
provinceId
:
null
,
provinceId
:
''
,
cityId
:
null
,
cityId
:
''
,
startTime
:
''
,
startTime
:
''
,
endTime
:
''
endTime
:
''
},
},
...
@@ -217,8 +218,8 @@ export default {
...
@@ -217,8 +218,8 @@ export default {
getParams
()
{
getParams
()
{
return
Object
.
assign
(
return
Object
.
assign
(
{
{
pageCount
:
this
.
page
Num
,
pageCount
:
this
.
page
Size
,
pageSize
:
this
.
page
Size
pageSize
:
this
.
page
Num
},
},
this
.
searchParams
this
.
searchParams
)
)
...
@@ -284,9 +285,11 @@ export default {
...
@@ -284,9 +285,11 @@ export default {
},
},
// 重置搜索
// 重置搜索
searchReset
()
{
searchReset
()
{
this
.
$refs
[
'searchParams'
].
resetFields
()
//
this.$refs['searchParams'].resetFields()
this
.
eventBus
.
$emit
(
'reset'
)
this
.
eventBus
.
$emit
(
'reset'
)
this
.
times
=
[]
// this.times = []
resetSearch
(
this
.
searchParams
)
console
.
log
(
this
.
getParams
())
},
},
addDialog
()
{
addDialog
()
{
this
.
addDialogVisible
=
!
this
.
addDialogVisible
this
.
addDialogVisible
=
!
this
.
addDialogVisible
...
...
src/views/customer/businessManagement/addBusiness.vue
deleted
100644 → 0
View file @
5797882
<
template
>
<div>
<gl-dialog
title=
"添加商户"
:visible
.
sync=
"addDialogVisible"
width=
"400px"
:before-close=
"showAddDialog"
>
<gl-form
ref=
"addForm"
:model=
"addForm"
label-width=
"100px"
:rules=
"rules"
>
<gl-form-item
label=
"商户:"
prop=
"merchant"
>
<gl-select
v-model=
"addForm.merchant"
filterable
remote
clearable
name=
"merchant"
placeholder=
"请输入商户名称/商户号"
data-vv-as=
"商户名称/商户号"
v-validate=
"'required'"
:remote-method=
"remoteList"
:loading=
"loading"
>
<gl-option
v-for=
"item in businessList"
:key=
"item.merchantId"
:label=
"item.merchantName"
:value=
"item.merchantId"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('merchant')"
class=
"error"
>
{{
errorBags
.
first
(
'merchant'
)
}}
</span>
</gl-form-item>
<gl-form-item
label=
"商户类型:"
prop=
"merchantType"
>
<gl-select
v-model=
"addForm.merchantType"
name=
"merchantType"
data-vv-as=
"商户类型"
v-validate=
"'required'"
placeholder=
"请搜索"
>
<gl-option
v-for=
"item in merchantTypeList"
:key=
"item.confId"
:label=
"item.confKey"
:value=
"item.confId"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('merchantType')"
class=
"error"
>
{{
errorBags
.
first
(
'merchantType'
)
}}
</span>
</gl-form-item>
<div
v-for=
"(item, idx) in addList"
:key=
"idx"
>
<gl-form-item
:label=
"item.label + ':'"
>
<gl-select
v-model=
"item.merchant"
filterable
remote
:name=
"`item.merchant$
{idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户${idx+1}`"
clearable
placeholder="请输入商户名称/商户号"
:remote-method="remoteChildList"
:loading="childLoading">
<gl-option
v-for=
"item in businessChildList"
:key=
"item.merchantId"
:label=
"item.merchantName"
:value=
"item.merchantId"
>
</gl-option>
</gl-select>
<i
v-show=
"item.show"
class=
"el-icon-delete delete"
@
click=
"deleteBusiness(idx)"
></i>
<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
label
=
"商户类型:"
>
<
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
v-for="
item
in
merchantTypeList
"
:key="
item
.
confId
"
:label="
item
.
confKey
"
:value="
item
.
confId
">
</gl-option>
</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
>
<
/div
>
<
span
v
-
show
=
"tip"
class
=
"error"
style
=
"float:right; margin-right: 43px;"
>
{{
'请填写上一条子商户数据'
}}
<
/span
>
<
gl
-
button
@
click
=
"addMore"
>
添加更多
<
/gl-button
>
<
/gl-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
gl
-
button
@
click
=
"showAddDialog"
>
取
消
<
/gl-button
>
<
gl
-
button
type
=
"primary"
@
click
=
"ok"
>
确
定
<
/gl-button
>
<
/div
>
<
/gl-dialog
>
<
/div
>
<
/template
>
<
script
>
import
notice
from
'@/common/notice'
import
{
businessManagenMethods
,
groupDetailMethods
,
request
}
from
'@/api'
export
default
{
name
:
'AddBusiness'
,
props
:
{
addDialogVisible
:
Boolean
}
,
data
()
{
return
{
tip
:
false
,
addForm
:
{
merchant
:
''
,
merchantType
:
''
}
,
merchantTypeList
:
[],
rules
:
{
merchant
:
[{
required
:
true
}
],
merchantType
:
[{
required
:
true
}
]
}
,
// 远程搜索
loading
:
false
,
childLoading
:
false
,
businessList
:
[],
businessChildList
:
[],
addList
:
[
{
label
:
'子商户1'
,
merchant
:
''
,
merchantType
:
''
}
]
}
}
,
watch
:
{
addDialogVisible
(
val
)
{
this
.
$validator
.
errors
.
clear
()
}
}
,
mounted
()
{
this
.
getBusinessType
()
}
,
methods
:
{
// 确定按钮
ok
()
{
this
.
tip
=
false
this
.
$validator
.
validateAll
().
then
((
result
)
=>
{
if
(
result
)
{
this
.
addList
.
forEach
(
item
=>
{
delete
item
.
label
}
)
if
(
this
.
addList
[
0
].
merchantId
)
{
this
.
addForm
.
merchantRelationAdds
=
this
.
addList
}
console
.
log
(
this
.
addForm
)
const
params
=
this
.
$deep_clone
(
this
.
addForm
)
params
.
method
=
groupDetailMethods
.
Create
request
.
req
(
params
).
then
(
res
=>
{
notice
.
okTips
()
this
.
showAddDialog
()
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
}
)
}
,
// 显示隐藏添加商户按钮
showAddDialog
()
{
this
.
$emit
(
'addData'
)
setTimeout
(()
=>
{
this
.
addList
=
[{
label
:
'子商户1'
,
merchant
:
''
,
merchantType
:
''
}
]
this
.
addForm
=
{
merchant
:
''
,
merchantType
:
''
}
}
,
400
)
}
,
// 添加更多按钮
addMore
()
{
console
.
log
(
this
.
addList
)
const
len
=
this
.
addList
.
length
-
1
if
(
this
.
addList
[
len
].
merchant
==
''
||
this
.
addList
[
len
].
merchantType
==
''
)
{
console
.
log
(
'请填写完上一条数据'
)
this
.
tip
=
true
}
else
{
this
.
tip
=
false
this
.
addList
.
push
({
label
:
'子商户'
+
(
this
.
addList
.
length
+
1
),
merchant
:
''
,
merchantType
:
''
,
show
:
true
}
)
}
}
,
deleteBusiness
(
idx
)
{
this
.
addList
.
splice
(
idx
,
1
)
}
,
// 父商户搜索
remoteList
(
query
)
{
if
(
query
!==
''
)
{
this
.
loading
=
true
const
params
=
{
}
params
.
groupId
=
1
params
.
searchWrod
=
query
params
.
method
=
groupDetailMethods
.
SearchList
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
.
merchantParams
)
this
.
loading
=
false
this
.
businessList
=
res
.
merchantParams
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
else
{
this
.
businessList
=
[]
}
}
,
// 子商户远程搜索
remoteChildList
(
query
)
{
if
(
query
!==
''
)
{
this
.
childLoading
=
true
const
params
=
{
}
params
.
groupId
=
1
params
.
searchWrod
=
query
params
.
method
=
groupDetailMethods
.
SearchChildList
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
.
merchantParams
)
this
.
childLoading
=
false
this
.
businessChildList
=
res
.
merchantParams
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
else
{
this
.
businessChildList
=
[]
}
}
,
// 获取商户类型列表
getBusinessType
()
{
const
params
=
{
}
params
.
method
=
businessManagenMethods
.
Type
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
merchantTypeList
=
res
.
merchantDictList
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
}
}
<
/script
>
<
style
>
.
delete
{
color
:
red
;
margin
-
left
:
20
px
;
font
-
size
:
18
px
;
}
<
/style
>
src/views/customer/businessManagement/index.vue
View file @
e9fd7da
...
@@ -66,22 +66,14 @@
...
@@ -66,22 +66,14 @@
>
确 定
</gl-button>
>
确 定
</gl-button>
</div>
</div>
</gl-dialog>
</gl-dialog>
<!--
<add-business
:addDialogVisible=
"addDialogVisible"
@
addData=
"add"
></add-business>
-->
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Vue
from
'vue'
import
Vue
from
'vue'
import
addBusiness
from
'./addBusiness'
import
notice
from
'@/common/notice'
import
notice
from
'@/common/notice'
import
{
businessManagenMethods
,
request
}
from
'@/api'
import
{
businessManagenMethods
,
request
}
from
'@/api'
export
default
{
export
default
{
name
:
'BusinessManagement'
,
name
:
'BusinessManagement'
,
components
:
{
addBusiness
},
data
()
{
data
()
{
return
{
return
{
tableData
:
{
tableData
:
{
...
@@ -115,9 +107,7 @@ export default {
...
@@ -115,9 +107,7 @@ export default {
rules
:
{
rules
:
{
confKey
:
[{
required
:
true
}],
confKey
:
[{
required
:
true
}],
memo
:
[{
required
:
true
}]
memo
:
[{
required
:
true
}]
},
}
// 商户分组组件数据
// addDialogVisible: false,
}
}
},
},
watch
:
{
watch
:
{
...
@@ -145,12 +135,6 @@ export default {
...
@@ -145,12 +135,6 @@ export default {
}
}
})
})
},
},
// add() {
// this.addDialogVisible = !this.addDialogVisible
// },
// handleAddData() {
// this.addDialogVisible = !this.addDialogVisible
// },
// 接口请求
// 接口请求
getList
()
{
getList
()
{
const
params
=
{}
const
params
=
{}
...
...
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