Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
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 83fe8c6a
authored
Mar 17, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改主营品牌
1 parent
075b4c28
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
144 additions
and
26 deletions
html/merchant/add.html
html/merchant/addSubMerchant.html
html/merchant/edit.html
js/load.js
html/merchant/add.html
View file @
83fe8c6
...
@@ -213,6 +213,12 @@
...
@@ -213,6 +213,12 @@
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
}
}
.check-carbrand
{
position
:
absolute
;
left
:
340px
;
top
:
0
;
}
</style>
</style>
<title>
商户编辑
</title>
<title>
商户编辑
</title>
</head>
</head>
...
@@ -387,8 +393,9 @@
...
@@ -387,8 +393,9 @@
<div
class=
"layui-col-md6"
>
<div
class=
"layui-col-md6"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
style=
"position: relative;"
>
<input
class=
"layui-input"
placeholder=
"车型品牌"
id=
"brand"
/>
<input
class=
"layui-input"
placeholder=
"车型品牌"
id=
"brand"
/>
<button
id=
"checkCarBrand"
type=
"button"
class=
"layui-btn btn-no-border check-carbrand"
>
全选
</button>
<div
id=
"carBrandTree"
class=
"wrapper-tree hide"
style=
"height: 200px; overflow-y: scroll"
></div>
<div
id=
"carBrandTree"
class=
"wrapper-tree hide"
style=
"height: 200px; overflow-y: scroll"
></div>
<div
id=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
<div
id=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
</div>
</div>
...
@@ -849,8 +856,28 @@
...
@@ -849,8 +856,28 @@
})
})
// merchantForm.businessScopeCustomize = tempList.join(',')
// merchantForm.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
if
(
treeObj
)
merchantForm
.
merchantBrandMain
=
treeObj
.
getCheckedNodes
(
true
)
// if (treeObj) merchantForm.merchantBrandMain = treeObj.getCheckedNodes(true)
params
.
merchantBrandMain
=
findId
(
merchantForm
.
merchantBrandMain
).
join
(
','
)
// params.merchantBrandMain = findId(merchantForm.merchantBrandMain).join(',')
if
(
treeObj
)
{
let
getCheckedNodes
=
treeObj
.
getCheckedNodes
(
true
)
const
getCheckedKeys
=
treeObj
.
getCheckedNodes
(
true
).
map
(
item
=>
item
.
id
)
console
.
log
(
getCheckedKeys
)
getCheckedNodes
=
getCheckedNodes
.
filter
(
item
=>
item
.
children
)
merchantForm
.
merchantBrandList
=
getCheckedNodes
.
map
(
car
=>
{
let
merchantBrandId
=
[]
car
.
children
.
forEach
(
item
=>
{
if
(
getCheckedKeys
.
includes
(
item
.
id
))
{
merchantBrandId
.
push
(
item
.
id
)
}
})
return
{
cars
:
car
.
id
,
merchantBrandId
}
})
console
.
log
(
merchantForm
.
merchantBrandList
)
params
.
merchantBrandListJson
=
JSON
.
stringify
(
merchantForm
.
merchantBrandList
)
}
if
(
merchantForm
.
merchantFiles
.
length
)
{
if
(
merchantForm
.
merchantFiles
.
length
)
{
params
.
merchantFiles
=
JSON
.
stringify
(
merchantForm
.
merchantFiles
)
params
.
merchantFiles
=
JSON
.
stringify
(
merchantForm
.
merchantFiles
)
}
}
...
@@ -988,6 +1015,18 @@
...
@@ -988,6 +1015,18 @@
return
false
return
false
}
}
}
}
var
checkAll
=
false
var
checkCarBrand
=
$
(
'#checkCarBrand'
)
// 主营品牌全选
checkCarBrand
.
on
(
'click'
,
function
()
{
checkAll
=
!
checkAll
treeObj
.
checkAllNodes
(
checkAll
)
if
(
checkAll
)
{
checkCarBrand
.
html
(
'全不选'
)
}
else
{
checkCarBrand
.
html
(
'全选'
)
}
})
$
(
'.layui-btn'
).
on
(
'click'
,
function
()
{
$
(
'.layui-btn'
).
on
(
'click'
,
function
()
{
var
type
=
$
(
this
).
data
(
'type'
)
var
type
=
$
(
this
).
data
(
'type'
)
...
@@ -1275,9 +1314,7 @@
...
@@ -1275,9 +1314,7 @@
// 品牌
// 品牌
function
getCarBrandTree
()
{
function
getCarBrandTree
()
{
var
params
=
{
var
params
=
{
method
:
'dj.api.get.car.brandList'
,
method
:
'merchants.api.merchantCommon.getCarbrandTree'
needCarSeries
:
true
// method: 'merchants.api.merchantCommon.getCarbrandTree'
}
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
baseData
.
carBrandTreeList
=
res
.
data
baseData
.
carBrandTreeList
=
res
.
data
...
@@ -1285,7 +1322,8 @@
...
@@ -1285,7 +1322,8 @@
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
checkedList
=
merchantForm
.
merchantBrandMain
.
split
(
','
)
// checkedList = merchantForm.merchantBrandMain.split(',')
checkedList
=
merchantForm
.
merchantBrandMain
.
replaceAll
(
';'
,
','
).
split
(
','
)
$
.
each
(
checkedList
,
function
(
index
,
item
)
{
$
.
each
(
checkedList
,
function
(
index
,
item
)
{
checkedList
[
index
]
=
parseInt
(
item
)
checkedList
[
index
]
=
parseInt
(
item
)
})
})
...
@@ -1301,7 +1339,7 @@
...
@@ -1301,7 +1339,7 @@
}
else
{
}
else
{
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
}
}
}
,
{
isDjUrl
:
true
}
)
})
}
}
// 获取字典数据
// 获取字典数据
function
getDictData
(
dictType
,
fn
)
{
function
getDictData
(
dictType
,
fn
)
{
...
...
html/merchant/addSubMerchant.html
View file @
83fe8c6
...
@@ -225,6 +225,12 @@
...
@@ -225,6 +225,12 @@
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
}
}
.check-carbrand
{
position
:
absolute
;
left
:
340px
;
top
:
0
;
}
</style>
</style>
<title>
商户编辑
</title>
<title>
商户编辑
</title>
</head>
</head>
...
@@ -372,8 +378,9 @@
...
@@ -372,8 +378,9 @@
<div
class=
"layui-col-md6"
>
<div
class=
"layui-col-md6"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
style=
"position: relative;"
>
<input
class=
"layui-input"
placeholder=
"车型品牌"
id=
"brand"
/>
<input
class=
"layui-input"
placeholder=
"车型品牌"
id=
"brand"
/>
<button
id=
"checkCarBrand"
type=
"button"
class=
"layui-btn btn-no-border check-carbrand"
>
全选
</button>
<div
id=
"carBrandTree"
class=
"hide"
style=
"height: 200px; overflow-y: scroll"
></div>
<div
id=
"carBrandTree"
class=
"hide"
style=
"height: 200px; overflow-y: scroll"
></div>
<div
id=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
<div
id=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
</div>
</div>
...
@@ -528,7 +535,7 @@
...
@@ -528,7 +535,7 @@
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/validator.js"
></script>
<script
src=
"/js/validator.js"
></script>
<script>
<script>
layui
.
use
([
'gtree'
,
'request'
,
'helper'
,
'layer'
,
'laydate'
,
'element'
,
'xmSelect'
,
'laytpl'
,
'validator'
],
function
()
{
layui
.
use
([
'gtree'
,
'request'
,
'helper'
,
'layer'
,
'laydate'
,
'element'
,
'xmSelect'
,
'laytpl'
,
'validator'
,
'util'
],
function
()
{
var
tree
=
layui
.
gtree
var
tree
=
layui
.
gtree
var
request
=
layui
.
request
var
request
=
layui
.
request
var
form
=
layui
.
form
var
form
=
layui
.
form
...
@@ -536,6 +543,7 @@
...
@@ -536,6 +543,7 @@
var
$
=
layui
.
$
var
$
=
layui
.
$
var
validator
=
layui
.
validator
var
validator
=
layui
.
validator
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
var
util
=
layui
.
util
var
element
=
layui
.
element
var
element
=
layui
.
element
var
editData
=
{}
var
editData
=
{}
var
treeObj
=
null
var
treeObj
=
null
...
@@ -855,8 +863,28 @@
...
@@ -855,8 +863,28 @@
})
})
// merchantForm.businessScopeCustomize = tempList.join(',')
// merchantForm.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
if
(
treeObj
)
merchantForm
.
merchantBrandMain
=
treeObj
.
getCheckedNodes
(
true
)
// if (treeObj) merchantForm.merchantBrandMain = treeObj.getCheckedNodes(true)
params
.
merchantBrandMain
=
findId
(
merchantForm
.
merchantBrandMain
).
join
(
','
)
// params.merchantBrandMain = findId(merchantForm.merchantBrandMain).join(',')
if
(
treeObj
)
{
let
getCheckedNodes
=
treeObj
.
getCheckedNodes
(
true
)
const
getCheckedKeys
=
treeObj
.
getCheckedNodes
(
true
).
map
(
item
=>
item
.
id
)
console
.
log
(
getCheckedKeys
)
getCheckedNodes
=
getCheckedNodes
.
filter
(
item
=>
item
.
children
)
merchantForm
.
merchantBrandList
=
getCheckedNodes
.
map
(
car
=>
{
let
merchantBrandId
=
[]
car
.
children
.
forEach
(
item
=>
{
if
(
getCheckedKeys
.
includes
(
item
.
id
))
{
merchantBrandId
.
push
(
item
.
id
)
}
})
return
{
cars
:
car
.
id
,
merchantBrandId
}
})
console
.
log
(
merchantForm
.
merchantBrandList
)
params
.
merchantBrandListJson
=
JSON
.
stringify
(
merchantForm
.
merchantBrandList
)
}
if
(
merchantForm
.
merchantFiles
.
length
)
{
if
(
merchantForm
.
merchantFiles
.
length
)
{
params
.
merchantFiles
=
JSON
.
stringify
(
merchantForm
.
merchantFiles
)
params
.
merchantFiles
=
JSON
.
stringify
(
merchantForm
.
merchantFiles
)
}
}
...
@@ -997,6 +1025,19 @@
...
@@ -997,6 +1025,19 @@
}
}
}
}
var
checkAll
=
false
var
checkCarBrand
=
$
(
'#checkCarBrand'
)
// 主营品牌全选
checkCarBrand
.
on
(
'click'
,
function
()
{
checkAll
=
!
checkAll
treeObj
.
checkAllNodes
(
checkAll
)
if
(
checkAll
)
{
checkCarBrand
.
html
(
'全不选'
)
}
else
{
checkCarBrand
.
html
(
'全选'
)
}
})
$
(
'.layui-btn'
).
on
(
'click'
,
function
()
{
$
(
'.layui-btn'
).
on
(
'click'
,
function
()
{
var
type
=
$
(
this
).
data
(
'type'
)
var
type
=
$
(
this
).
data
(
'type'
)
if
(
btnHandle
[
type
])
{
if
(
btnHandle
[
type
])
{
...
@@ -1284,9 +1325,7 @@
...
@@ -1284,9 +1325,7 @@
// 品牌
// 品牌
function
getCarBrandTree
()
{
function
getCarBrandTree
()
{
var
params
=
{
var
params
=
{
// method: 'merchants.api.merchantCommon.getCarbrandTree'
method
:
'merchants.api.merchantCommon.getCarbrandTree'
method
:
'dj.api.get.car.brandList'
,
needCarSeries
:
true
}
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
baseData
.
carBrandTreeList
=
res
.
data
baseData
.
carBrandTreeList
=
res
.
data
...
@@ -1294,7 +1333,8 @@
...
@@ -1294,7 +1333,8 @@
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
checkedList
=
merchantForm
.
merchantBrandMain
.
split
(
','
)
// checkedList = merchantForm.merchantBrandMain.split(',')
checkedList
=
merchantForm
.
merchantBrandMain
.
replaceAll
(
';'
,
','
).
split
(
','
)
$
.
each
(
checkedList
,
function
(
index
,
item
)
{
$
.
each
(
checkedList
,
function
(
index
,
item
)
{
checkedList
[
index
]
=
parseInt
(
item
)
checkedList
[
index
]
=
parseInt
(
item
)
})
})
...
@@ -1310,7 +1350,7 @@
...
@@ -1310,7 +1350,7 @@
}
else
{
}
else
{
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
}
}
}
,
{
isDjUrl
:
true
}
)
})
}
}
// 获取字典数据
// 获取字典数据
function
getDictData
(
dictType
,
fn
)
{
function
getDictData
(
dictType
,
fn
)
{
...
...
html/merchant/edit.html
View file @
83fe8c6
...
@@ -217,6 +217,12 @@
...
@@ -217,6 +217,12 @@
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
}
}
.check-carbrand
{
position
:
absolute
;
left
:
340px
;
top
:
0
;
}
</style>
</style>
<title>
商户编辑
</title>
<title>
商户编辑
</title>
</head>
</head>
...
@@ -456,8 +462,9 @@
...
@@ -456,8 +462,9 @@
<div
class=
"layui-col-md6"
>
<div
class=
"layui-col-md6"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
style=
"position: relative;"
>
<input
class=
"layui-input"
placeholder=
"车型品牌"
id=
"brand"
/>
<input
class=
"layui-input"
placeholder=
"车型品牌"
id=
"brand"
/>
<button
id=
"checkCarBrand"
type=
"button"
class=
"layui-btn btn-no-border check-carbrand"
>
全选
</button>
<div
id=
"carBrandTree"
class=
"hide"
style=
"height: 200px; overflow-y: scroll"
></div>
<div
id=
"carBrandTree"
class=
"hide"
style=
"height: 200px; overflow-y: scroll"
></div>
<div
id=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
<div
id=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
</div>
</div>
...
@@ -840,8 +847,28 @@
...
@@ -840,8 +847,28 @@
})
})
// merchantForm.businessScopeCustomize = tempList.join(',')
// merchantForm.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
if
(
treeObj
)
merchantForm
.
merchantBrandMain
=
treeObj
.
getCheckedNodes
(
true
)
// if (treeObj) merchantForm.merchantBrandMain = treeObj.getCheckedNodes(true)
params
.
merchantBrandMain
=
findId
(
merchantForm
.
merchantBrandMain
).
join
(
','
)
// params.merchantBrandMain = findId(merchantForm.merchantBrandMain).join(',')
if
(
treeObj
)
{
let
getCheckedNodes
=
treeObj
.
getCheckedNodes
(
true
)
const
getCheckedKeys
=
treeObj
.
getCheckedNodes
(
true
).
map
(
item
=>
item
.
id
)
console
.
log
(
getCheckedKeys
)
getCheckedNodes
=
getCheckedNodes
.
filter
(
item
=>
item
.
children
)
merchantForm
.
merchantBrandList
=
getCheckedNodes
.
map
(
car
=>
{
let
merchantBrandId
=
[]
car
.
children
.
forEach
(
item
=>
{
if
(
getCheckedKeys
.
includes
(
item
.
id
))
{
merchantBrandId
.
push
(
item
.
id
)
}
})
return
{
cars
:
car
.
id
,
merchantBrandId
}
})
console
.
log
(
merchantForm
.
merchantBrandList
)
params
.
merchantBrandListJson
=
JSON
.
stringify
(
merchantForm
.
merchantBrandList
)
}
if
(
merchantForm
.
merchantFiles
.
length
)
{
if
(
merchantForm
.
merchantFiles
.
length
)
{
params
.
merchantFiles
=
JSON
.
stringify
(
merchantForm
.
merchantFiles
)
params
.
merchantFiles
=
JSON
.
stringify
(
merchantForm
.
merchantFiles
)
}
}
...
@@ -956,6 +983,19 @@
...
@@ -956,6 +983,19 @@
}
}
}
}
var
checkAll
=
false
var
checkCarBrand
=
$
(
'#checkCarBrand'
)
// 主营品牌全选
checkCarBrand
.
on
(
'click'
,
function
()
{
checkAll
=
!
checkAll
treeObj
.
checkAllNodes
(
checkAll
)
if
(
checkAll
)
{
checkCarBrand
.
html
(
'全不选'
)
}
else
{
checkCarBrand
.
html
(
'全选'
)
}
})
// tab 点击事件
// tab 点击事件
$
(
'#functional'
).
on
(
'click'
,
function
()
{
$
(
'#functional'
).
on
(
'click'
,
function
()
{
$
(
'#basic'
).
attr
(
'lay-id'
)
$
(
'#basic'
).
attr
(
'lay-id'
)
...
@@ -1285,9 +1325,9 @@
...
@@ -1285,9 +1325,9 @@
// 品牌
// 品牌
function
getCarBrandTree
()
{
function
getCarBrandTree
()
{
var
params
=
{
var
params
=
{
//
method: 'merchants.api.merchantCommon.getCarbrandTree'
method
:
'merchants.api.merchantCommon.getCarbrandTree'
method
:
'dj.api.get.car.brandList'
,
//
method: 'dj.api.get.car.brandList',
needCarSeries
:
true
//
needCarSeries: true
}
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
baseData
.
carBrandTreeList
=
res
.
data
baseData
.
carBrandTreeList
=
res
.
data
...
@@ -1295,7 +1335,8 @@
...
@@ -1295,7 +1335,8 @@
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
checkedList
=
merchantForm
.
merchantBrandMain
.
split
(
','
)
// checkedList = merchantForm.merchantBrandMain.split(',')
checkedList
=
merchantForm
.
merchantBrandMain
.
replaceAll
(
';'
,
','
).
split
(
','
)
$
.
each
(
checkedList
,
function
(
index
,
item
)
{
$
.
each
(
checkedList
,
function
(
index
,
item
)
{
checkedList
[
index
]
=
parseInt
(
item
)
checkedList
[
index
]
=
parseInt
(
item
)
})
})
...
@@ -1311,7 +1352,7 @@
...
@@ -1311,7 +1352,7 @@
}
else
{
}
else
{
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
}
}
}
,
{
isDjUrl
:
true
}
)
})
}
}
// 获取字典数据
// 获取字典数据
function
getDictData
(
dictType
,
fn
)
{
function
getDictData
(
dictType
,
fn
)
{
...
...
js/load.js
View file @
83fe8c6
...
@@ -38,7 +38,6 @@ function loadHeaderFooter() {
...
@@ -38,7 +38,6 @@ function loadHeaderFooter() {
layui
.
use
([
'store'
],
function
()
{
layui
.
use
([
'store'
],
function
()
{
var
isExternal
=
isAppend
()
var
isExternal
=
isAppend
()
var
store
=
layui
.
store
var
store
=
layui
.
store
console
.
log
(
qs
(
'sessionId'
))
if
(
isExternal
)
{
//运营平台外部系统
if
(
isExternal
)
{
//运营平台外部系统
append
()
append
()
}
else
{
//嵌入运营平台 或者是登录页面
}
else
{
//嵌入运营平台 或者是登录页面
...
...
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