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 ee798305
authored
Apr 08, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v2.0.0' into 'develop'
V2.0.0合并到develop See merge request
!9
2 parents
5433b08e
3529097f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
259 additions
and
98 deletions
html/merchant/add.html
html/merchant/addSubMerchant.html
html/merchant/detail.html
html/merchant/edit.html
js/load.js
js/request.js
html/merchant/add.html
View file @
ee79830
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
}
}
.hide
{
.hide
{
display
:
none
;
display
:
none
!important
;
}
}
.option-btns
{
.option-btns
{
...
@@ -206,6 +206,19 @@
...
@@ -206,6 +206,19 @@
border-bottom-left-radius
:
0
;
border-bottom-left-radius
:
0
;
border-left
:
none
;
border-left
:
none
;
}
}
.no-car
{
display
:
flex
;
height
:
100px
;
align-items
:
center
;
justify-content
:
center
;
}
.check-carbrand
{
position
:
absolute
;
left
:
340px
;
top
:
0
;
}
</style>
</style>
<title>
商户编辑
</title>
<title>
商户编辑
</title>
</head>
</head>
...
@@ -354,6 +367,10 @@
...
@@ -354,6 +367,10 @@
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
经营业务类型:
</label>
<div
class=
"removeCheckBg"
id=
"busiScopeEl"
></div>
</div>
<!-- <div class="layui-form-item">
<label class="layui-form-label">营业范围:</label>
<label class="layui-form-label">营业范围:</label>
<div class="layui-input-inline removeCheckBg" id="busiScopeEl"></div>
<div class="layui-input-inline removeCheckBg" id="busiScopeEl"></div>
</div>
</div>
...
@@ -369,19 +386,18 @@
...
@@ -369,19 +386,18 @@
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
</button>
</button>
<!-- <div class="wrap-add-signal" data-type="handleAddScope">
<i class="layui-icon"></i>
</div> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> -->
<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"
/>
<div
id=
"carBrandTree"
class=
"wrapper-tree"
style=
"height: 200px; overflow-y: scroll"
></div>
<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=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -532,15 +548,18 @@
...
@@ -532,15 +548,18 @@
<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
var
laydate
=
layui
.
laydate
var
laydate
=
layui
.
laydate
var
util
=
layui
.
util
var
$
=
layui
.
$
var
$
=
layui
.
$
var
validator
=
layui
.
validator
var
validator
=
layui
.
validator
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
var
element
=
layui
.
element
var
element
=
layui
.
element
var
laytpl
=
layui
.
laytpl
var
xmSelect
=
layui
.
xmSelect
var
editData
=
{}
var
editData
=
{}
var
treeObj
=
null
var
treeObj
=
null
var
all_nodes
=
[]
var
all_nodes
=
[]
...
@@ -573,7 +592,7 @@
...
@@ -573,7 +592,7 @@
lat
:
''
,
lat
:
''
,
lng
:
''
,
lng
:
''
,
merchantAddress
:
''
,
merchantAddress
:
''
,
business
Sco
pe
:
''
,
business
Ty
pe
:
''
,
merchantFiles
:
[]
merchantFiles
:
[]
}
}
...
@@ -642,7 +661,6 @@
...
@@ -642,7 +661,6 @@
elem
:
'#expireDate'
,
elem
:
'#expireDate'
,
format
:
'yyyy-MM-dd'
format
:
'yyyy-MM-dd'
})
})
editLevel
=
qs
(
'editLevel'
)
editLevel
=
qs
(
'editLevel'
)
isFactory
=
qs
(
'isFactory'
)
==
'true'
isFactory
=
qs
(
'isFactory'
)
==
'true'
step
=
qs
(
'step'
)
step
=
qs
(
'step'
)
...
@@ -799,7 +817,7 @@
...
@@ -799,7 +817,7 @@
}
}
var
checkClassNameList
=
[
var
checkClassNameList
=
[
{
{
attr
:
'business
Sco
pe'
,
attr
:
'business
Ty
pe'
,
toString
:
','
toString
:
','
},
},
{
{
...
@@ -836,10 +854,30 @@
...
@@ -836,10 +854,30 @@
tempList
.
push
(
item
.
value
)
tempList
.
push
(
item
.
value
)
}
}
})
})
merchantForm
.
businessScopeCustomize
=
tempList
.
join
(
','
)
// merchantForm.businessScopeCustomize = tempList.join(',')
params
.
businessScopeCustomize
=
tempList
.
join
(
','
)
// params.businessScopeCustomize = tempList.join(',')
merchantForm
.
merchantBrand
=
treeObj
.
getCheckedNodes
(
true
)
// if (treeObj) merchantForm.merchantBrandMain = treeObj.getCheckedNodes(true)
params
.
merchantBrand
=
findId
(
merchantForm
.
merchantBrand
).
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
)
}
}
...
@@ -977,6 +1015,18 @@
...
@@ -977,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'
)
...
@@ -1268,9 +1318,12 @@
...
@@ -1268,9 +1318,12 @@
}
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
baseData
.
carBrandTreeList
=
res
.
data
baseData
.
carBrandTreeList
=
res
.
data
if
(
res
.
data
&&
res
.
data
.
length
)
{
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrand
)
{
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
checkedList
=
merchantForm
.
merchantBrand
.
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
)
})
})
...
@@ -1283,6 +1336,9 @@
...
@@ -1283,6 +1336,9 @@
}
}
all_nodes
=
treeObj
.
transformToArray
(
treeObj
.
getNodes
())
all_nodes
=
treeObj
.
transformToArray
(
treeObj
.
getNodes
())
bindEvent
()
bindEvent
()
}
else
{
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
}
})
})
}
}
// 获取字典数据
// 获取字典数据
...
@@ -1340,25 +1396,20 @@
...
@@ -1340,25 +1396,20 @@
// 营业范围
// 营业范围
function
getBusiScope
()
{
function
getBusiScope
()
{
getDictData
(
'business_
sco
pe'
,
function
(
res
)
{
getDictData
(
'business_
ty
pe'
,
function
(
res
)
{
baseData
.
busiScopeList
=
res
.
data
baseData
.
busiScopeList
=
res
.
data
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
business
Sco
pe
)
{
if
(
editLevel
==
3
&&
merchantForm
.
business
Ty
pe
)
{
checkedList
=
merchantForm
.
business
Sco
pe
.
split
(
','
)
checkedList
=
merchantForm
.
business
Ty
pe
.
split
(
','
)
}
}
var
el
=
$
(
'#busiScopeEl'
)
var
el
=
$
(
'#busiScopeEl'
)
$
.
each
(
baseData
.
busiScopeList
,
function
(
index
,
item
)
{
$
.
each
(
baseData
.
busiScopeList
,
function
(
index
,
item
)
{
var
optionEl
=
$
(
var
optionEl
=
$
(
'<input type="checkbox" class="business
Scope" name="businessSco
pe['
+
item
.
dictValue
+
']" title='
+
item
.
dictLabel
+
' value="'
+
item
.
dictValue
+
'" lay-skin="primary">'
'<input type="checkbox" class="business
Type" name="businessTy
pe['
+
item
.
dictValue
+
']" title='
+
item
.
dictLabel
+
' value="'
+
item
.
dictValue
+
'" lay-skin="primary">'
)
)
// 修改-回显
if
(
item
.
dictValue
<=
6
)
{
if
(
editLevel
==
3
)
{
for
(
var
i
=
0
;
i
<=
checkedList
.
length
;
i
++
)
{
if
(
checkedList
[
i
]
==
item
.
dictValue
)
{
optionEl
.
attr
(
'checked'
,
true
)
optionEl
.
attr
(
'checked'
,
true
)
break
optionEl
.
attr
(
'disabled'
,
true
)
}
}
}
}
el
.
append
(
optionEl
)
el
.
append
(
optionEl
)
form
.
render
(
'checkbox'
)
form
.
render
(
'checkbox'
)
...
@@ -1454,8 +1505,6 @@
...
@@ -1454,8 +1505,6 @@
}
}
// 数 - start
// 数 - start
var
laytpl
=
layui
.
laytpl
var
xmSelect
=
layui
.
xmSelect
var
check_arr
=
[]
var
check_arr
=
[]
var
requestList
=
[]
var
requestList
=
[]
var
templateData
=
{}
var
templateData
=
{}
...
...
html/merchant/addSubMerchant.html
View file @
ee79830
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
}
}
.hide
{
.hide
{
display
:
none
;
display
:
none
!important
;
}
}
.option-btns
{
.option-btns
{
...
@@ -218,6 +218,19 @@
...
@@ -218,6 +218,19 @@
#basicForm
{
#basicForm
{
margin-bottom
:
87px
;
margin-bottom
:
87px
;
}
}
.no-car
{
display
:
flex
;
height
:
100px
;
align-items
:
center
;
justify-content
:
center
;
}
.check-carbrand
{
position
:
absolute
;
left
:
340px
;
top
:
0
;
}
</style>
</style>
<title>
商户编辑
</title>
<title>
商户编辑
</title>
</head>
</head>
...
@@ -343,10 +356,10 @@
...
@@ -343,10 +356,10 @@
</div>
</div>
</div>
</div>
<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"
id=
"busiScopeEl"
></div>
<div
id=
"busiScopeEl"
></div>
</div>
</div>
<div
class=
"layui-form-item"
id=
"custom-scope"
>
<
!-- <
div class="layui-form-item" id="custom-scope">
<div class="layui-form-item">
<div class="layui-form-item">
<label class="layui-form-label"></label>
<label class="layui-form-label"></label>
<div>
<div>
...
@@ -358,19 +371,18 @@
...
@@ -358,19 +371,18 @@
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
</button>
</button>
<!-- <div class="wrap-add-signal" data-type="handleAddScope">
<i class="layui-icon"></i>
</div> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> -->
<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"
/>
<div
id=
"carBrandTree"
style=
"height: 200px; overflow-y: scroll"
></div>
<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=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -523,7 +535,7 @@
...
@@ -523,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
...
@@ -531,6 +543,7 @@
...
@@ -531,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
...
@@ -572,7 +585,7 @@
...
@@ -572,7 +585,7 @@
lat
:
''
,
lat
:
''
,
lng
:
''
,
lng
:
''
,
merchantAddress
:
''
,
merchantAddress
:
''
,
business
Sco
pe
:
''
,
business
Ty
pe
:
''
,
merchantFiles
:
[]
merchantFiles
:
[]
}
}
...
@@ -811,7 +824,7 @@
...
@@ -811,7 +824,7 @@
}
}
var
checkClassNameList
=
[
var
checkClassNameList
=
[
{
{
attr
:
'business
Sco
pe'
,
attr
:
'business
Ty
pe'
,
toString
:
','
toString
:
','
},
},
{
{
...
@@ -848,10 +861,30 @@
...
@@ -848,10 +861,30 @@
tempList
.
push
(
item
.
value
)
tempList
.
push
(
item
.
value
)
}
}
})
})
merchantForm
.
businessScopeCustomize
=
tempList
.
join
(
','
)
// merchantForm.businessScopeCustomize = tempList.join(',')
params
.
businessScopeCustomize
=
tempList
.
join
(
','
)
// params.businessScopeCustomize = tempList.join(',')
merchantForm
.
merchantBrand
=
treeObj
.
getCheckedNodes
(
true
)
// if (treeObj) merchantForm.merchantBrandMain = treeObj.getCheckedNodes(true)
params
.
merchantBrand
=
findId
(
merchantForm
.
merchantBrand
).
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
)
}
}
...
@@ -992,6 +1025,19 @@
...
@@ -992,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
])
{
...
@@ -1283,9 +1329,12 @@
...
@@ -1283,9 +1329,12 @@
}
}
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
baseData
.
carBrandTreeList
=
res
.
data
baseData
.
carBrandTreeList
=
res
.
data
if
(
res
.
data
&&
res
.
data
.
length
)
{
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrand
)
{
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
checkedList
=
merchantForm
.
merchantBrand
.
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
)
})
})
...
@@ -1298,6 +1347,9 @@
...
@@ -1298,6 +1347,9 @@
}
}
all_nodes
=
treeObj
.
transformToArray
(
treeObj
.
getNodes
())
all_nodes
=
treeObj
.
transformToArray
(
treeObj
.
getNodes
())
bindEvent
()
bindEvent
()
}
else
{
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
}
})
})
}
}
// 获取字典数据
// 获取字典数据
...
@@ -1355,25 +1407,20 @@
...
@@ -1355,25 +1407,20 @@
// 营业范围
// 营业范围
function
getBusiScope
()
{
function
getBusiScope
()
{
getDictData
(
'business_
sco
pe'
,
function
(
res
)
{
getDictData
(
'business_
ty
pe'
,
function
(
res
)
{
baseData
.
busiScopeList
=
res
.
data
baseData
.
busiScopeList
=
res
.
data
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
business
Sco
pe
)
{
if
(
editLevel
==
3
&&
merchantForm
.
business
Ty
pe
)
{
checkedList
=
merchantForm
.
business
Sco
pe
.
split
(
','
)
checkedList
=
merchantForm
.
business
Ty
pe
.
split
(
','
)
}
}
var
el
=
$
(
'#busiScopeEl'
)
var
el
=
$
(
'#busiScopeEl'
)
$
.
each
(
baseData
.
busiScopeList
,
function
(
index
,
item
)
{
$
.
each
(
baseData
.
busiScopeList
,
function
(
index
,
item
)
{
var
optionEl
=
$
(
var
optionEl
=
$
(
'<input type="checkbox" class="business
Scope" name="businessSco
pe['
+
item
.
dictValue
+
']" title='
+
item
.
dictLabel
+
' value="'
+
item
.
dictValue
+
'" lay-skin="primary">'
'<input type="checkbox" class="business
Type" name="businessTy
pe['
+
item
.
dictValue
+
']" title='
+
item
.
dictLabel
+
' value="'
+
item
.
dictValue
+
'" lay-skin="primary">'
)
)
// 修改-回显
if
(
item
.
dictValue
<=
6
)
{
if
(
editLevel
==
3
)
{
for
(
var
i
=
0
;
i
<=
checkedList
.
length
;
i
++
)
{
if
(
checkedList
[
i
]
==
item
.
dictValue
)
{
optionEl
.
attr
(
'checked'
,
true
)
optionEl
.
attr
(
'checked'
,
true
)
break
optionEl
.
attr
(
'disabled'
,
true
)
}
}
}
}
el
.
append
(
optionEl
)
el
.
append
(
optionEl
)
form
.
render
(
'checkbox'
)
form
.
render
(
'checkbox'
)
...
...
html/merchant/detail.html
View file @
ee79830
...
@@ -472,10 +472,10 @@
...
@@ -472,10 +472,10 @@
<div
class=
"layui-col-md5"
>
<div
class=
"layui-col-md5"
>
<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-block"
>
<div
class=
"layui-input-block"
>
<!-- layui-form-mid -->
<!-- layui-form-mid -->
<div
class=
"layui-word-aux"
id=
"business
Scop
Name"
></div>
<div
class=
"layui-word-aux"
id=
"business
Type
Name"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -582,7 +582,7 @@
...
@@ -582,7 +582,7 @@
'merchantAddress'
,
'merchantAddress'
,
'merchantLegalPerson'
,
'merchantLegalPerson'
,
'merchantLegalPersonPhone'
,
'merchantLegalPersonPhone'
,
'business
Scop
Name'
,
'business
Type
Name'
,
'merchantBrandName'
,
'merchantBrandName'
,
'merchantModelName'
,
'merchantModelName'
,
'statusName'
,
'statusName'
,
...
@@ -683,9 +683,9 @@
...
@@ -683,9 +683,9 @@
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
roleData
=
helper
.
clone
(
true
,
res
.
data
)
roleData
=
helper
.
clone
(
true
,
res
.
data
)
for
(
var
i
in
basicArr
)
{
for
(
var
i
in
basicArr
)
{
if
(
basicArr
[
i
]
==
'businessScop
Name'
&&
roleData
.
businessScopeCustomize
)
{
// if (basicArr[i] == 'businessType
Name' && roleData.businessScopeCustomize) {
roleData
.
businessScopName
=
roleData
.
businessScopName
?
roleData
.
businessScop
Name
+
','
+
roleData
.
businessScopeCustomize
:
roleData
.
businessScopeCustomize
// roleData.businessTypeName = roleData.businessTypeName ? roleData.businessType
Name + ',' + roleData.businessScopeCustomize : roleData.businessScopeCustomize
}
//
}
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
roleData
[
basicArr
[
i
]]
?
roleData
[
basicArr
[
i
]]
:
'-'
)
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
roleData
[
basicArr
[
i
]]
?
roleData
[
basicArr
[
i
]]
:
'-'
)
}
}
if
(
roleData
.
merchantType
==
2
)
{
if
(
roleData
.
merchantType
==
2
)
{
...
...
html/merchant/edit.html
View file @
ee79830
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
}
}
.hide
{
.hide
{
display
:
none
;
display
:
none
!important
;
}
}
.option-btns
{
.option-btns
{
...
@@ -210,6 +210,19 @@
...
@@ -210,6 +210,19 @@
color
:
#c0c4cc
;
color
:
#c0c4cc
;
cursor
:
not-allowed
;
cursor
:
not-allowed
;
}
}
.no-car
{
display
:
flex
;
height
:
100px
;
align-items
:
center
;
justify-content
:
center
;
}
.check-carbrand
{
position
:
absolute
;
left
:
340px
;
top
:
0
;
}
</style>
</style>
<title>
商户编辑
</title>
<title>
商户编辑
</title>
</head>
</head>
...
@@ -427,10 +440,10 @@
...
@@ -427,10 +440,10 @@
</div>
</div>
</div>
</div>
<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
removeCheckBg"
id=
"busiScopeEl"
></div>
<div
class=
"removeCheckBg"
id=
"busiScopeEl"
></div>
</div>
</div>
<div
class=
"layui-form-item"
id=
"custom-scope"
>
<
!-- <
div class="layui-form-item" id="custom-scope">
<div class="layui-form-item">
<div class="layui-form-item">
<label class="layui-form-label"></label>
<label class="layui-form-label"></label>
<div>
<div>
...
@@ -442,19 +455,18 @@
...
@@ -442,19 +455,18 @@
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
</button>
</button>
<!-- <div class="wrap-add-signal" data-type="handleAddScope">
<i class="layui-icon"></i>
</div> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> -->
<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"
/>
<div
id=
"carBrandTree"
style=
"height: 200px; overflow-y: scroll"
></div>
<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=
"noCarbrand"
class=
"no-car hide"
>
暂无数据
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -569,7 +581,7 @@
...
@@ -569,7 +581,7 @@
lat
:
''
,
lat
:
''
,
lng
:
''
,
lng
:
''
,
merchantAddress
:
''
,
merchantAddress
:
''
,
business
Sco
pe
:
''
,
business
Ty
pe
:
''
,
merchantFiles
:
[]
merchantFiles
:
[]
}
}
...
@@ -797,7 +809,7 @@
...
@@ -797,7 +809,7 @@
}
}
var
checkClassNameList
=
[
var
checkClassNameList
=
[
{
{
attr
:
'business
Sco
pe'
,
attr
:
'business
Ty
pe'
,
toString
:
','
toString
:
','
},
},
{
{
...
@@ -833,10 +845,30 @@
...
@@ -833,10 +845,30 @@
tempList
.
push
(
item
.
value
)
tempList
.
push
(
item
.
value
)
}
}
})
})
merchantForm
.
businessScopeCustomize
=
tempList
.
join
(
','
)
// merchantForm.businessScopeCustomize = tempList.join(',')
params
.
businessScopeCustomize
=
tempList
.
join
(
','
)
// params.businessScopeCustomize = tempList.join(',')
merchantForm
.
merchantBrand
=
treeObj
.
getCheckedNodes
(
true
)
// if (treeObj) merchantForm.merchantBrandMain = treeObj.getCheckedNodes(true)
params
.
merchantBrand
=
findId
(
merchantForm
.
merchantBrand
).
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
)
}
}
...
@@ -860,6 +892,7 @@
...
@@ -860,6 +892,7 @@
}
else
{
}
else
{
params
.
status
=
1
params
.
status
=
1
}
}
console
.
log
(
params
)
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
layer
.
msg
(
'操作成功'
,
{
layer
.
msg
(
'操作成功'
,
{
...
@@ -950,6 +983,19 @@
...
@@ -950,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'
)
...
@@ -1280,12 +1326,17 @@
...
@@ -1280,12 +1326,17 @@
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
if
(
res
.
data
&&
res
.
data
.
length
)
{
$
(
'#carBrandTree'
).
removeClass
(
'hide'
)
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrand
)
{
if
(
editLevel
==
3
&&
merchantForm
.
merchantBrandMain
)
{
checkedList
=
merchantForm
.
merchantBrand
.
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
)
})
})
...
@@ -1298,6 +1349,9 @@
...
@@ -1298,6 +1349,9 @@
}
}
all_nodes
=
treeObj
.
transformToArray
(
treeObj
.
getNodes
())
all_nodes
=
treeObj
.
transformToArray
(
treeObj
.
getNodes
())
bindEvent
()
bindEvent
()
}
else
{
$
(
'#noCarbrand'
).
removeClass
(
'hide'
)
}
})
})
}
}
// 获取字典数据
// 获取字典数据
...
@@ -1355,16 +1409,16 @@
...
@@ -1355,16 +1409,16 @@
// 营业范围
// 营业范围
function
getBusiScope
()
{
function
getBusiScope
()
{
getDictData
(
'business_
sco
pe'
,
function
(
res
)
{
getDictData
(
'business_
ty
pe'
,
function
(
res
)
{
baseData
.
busiScopeList
=
res
.
data
baseData
.
busiScopeList
=
res
.
data
var
checkedList
=
[]
var
checkedList
=
[]
if
(
editLevel
==
3
&&
merchantForm
.
business
Sco
pe
)
{
if
(
editLevel
==
3
&&
merchantForm
.
business
Ty
pe
)
{
checkedList
=
merchantForm
.
business
Sco
pe
.
split
(
','
)
checkedList
=
merchantForm
.
business
Ty
pe
.
split
(
','
)
}
}
var
el
=
$
(
'#busiScopeEl'
)
var
el
=
$
(
'#busiScopeEl'
)
$
.
each
(
baseData
.
busiScopeList
,
function
(
index
,
item
)
{
$
.
each
(
baseData
.
busiScopeList
,
function
(
index
,
item
)
{
var
optionEl
=
$
(
var
optionEl
=
$
(
'<input type="checkbox" class="business
Scope" name="businessSco
pe['
+
item
.
dictValue
+
']" title='
+
item
.
dictLabel
+
' value="'
+
item
.
dictValue
+
'" lay-skin="primary">'
'<input type="checkbox" class="business
Type" name="businessTy
pe['
+
item
.
dictValue
+
']" title='
+
item
.
dictLabel
+
' value="'
+
item
.
dictValue
+
'" lay-skin="primary">'
)
)
// 修改-回显
// 修改-回显
if
(
editLevel
==
3
)
{
if
(
editLevel
==
3
)
{
...
@@ -1375,6 +1429,9 @@
...
@@ -1375,6 +1429,9 @@
}
}
}
}
}
}
if
(
item
.
dictValue
<=
6
)
{
optionEl
.
attr
(
'disabled'
,
true
)
}
el
.
append
(
optionEl
)
el
.
append
(
optionEl
)
form
.
render
(
'checkbox'
)
form
.
render
(
'checkbox'
)
})
})
...
...
js/load.js
View file @
ee79830
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
* @version: 1.0.0
* @version: 1.0.0
* @Author: limin
* @Author: limin
* @Date: 2021-07-15 15:46:53
* @Date: 2021-07-15 15:46:53
* @LastEditors:
limin
* @LastEditors:
Please set LastEditors
* @LastEditTime: 202
1-08-11 11:46:34
* @LastEditTime: 202
2-03-29 18:53:12
* @FilePath: \account\js\load.js
* @FilePath: \account\js\load.js
*/
*/
;(
function
load
()
{
;
(
function
load
()
{
loadLayConfig
()
loadLayConfig
()
loadConfig
()
loadConfig
()
loadHeaderFooter
()
loadHeaderFooter
()
...
@@ -38,8 +38,7 @@ function loadHeaderFooter() {
...
@@ -38,8 +38,7 @@ 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
{
//嵌入运营平台 或者是登录页面
if
(
qs
(
'sessionId'
))
{
if
(
qs
(
'sessionId'
))
{
...
@@ -52,11 +51,11 @@ function loadHeaderFooter() {
...
@@ -52,11 +51,11 @@ function loadHeaderFooter() {
store
.
set
(
'token'
,
qs
(
'sessionId'
))
store
.
set
(
'token'
,
qs
(
'sessionId'
))
}
else
{
}
else
{
// 运营平台
// 运营平台
if
(
isLoginPage
())
{
//如果是登陆页面 直接返回 登录成功会设置token
if
(
isLoginPage
())
{
//如果是登陆页面 直接返回 登录成功会设置token
return
return
}
}
var
t
=
qs
(
't'
)
//运营平台子系统从 父系统的iframe src获取 TGT.
var
t
=
qs
(
't'
)
//运营平台子系统从 父系统的iframe src获取 TGT.
if
(
t
)
{
if
(
t
)
{
store
.
set
(
'token'
,
t
)
store
.
set
(
'token'
,
t
)
}
}
}
}
...
@@ -77,7 +76,7 @@ function isAppend() {
...
@@ -77,7 +76,7 @@ function isAppend() {
return
!
isLoginPage
()
&&
self
==
top
return
!
isLoginPage
()
&&
self
==
top
}
}
function
isLoginPage
(){
function
isLoginPage
()
{
var
_href
=
location
.
href
.
split
(
'/'
)
var
_href
=
location
.
href
.
split
(
'/'
)
var
_path
=
_href
.
slice
(
_href
.
length
-
1
,
_href
.
length
).
toString
()
var
_path
=
_href
.
slice
(
_href
.
length
-
1
,
_href
.
length
).
toString
()
return
_path
.
split
(
'?'
)[
0
]
===
'login.html'
return
_path
.
split
(
'?'
)[
0
]
===
'login.html'
...
@@ -92,6 +91,7 @@ function loadConfig() {
...
@@ -92,6 +91,7 @@ function loadConfig() {
var
ajax
=
layui
.
$
.
ajax
var
ajax
=
layui
.
$
.
ajax
ajax
({
ajax
({
url
:
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/glsx-oss-account-config'
,
url
:
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/glsx-oss-account-config'
,
// url: 'http://oss-config.dev.glsx.com.cn/mock/5be17454f31545347559d499/config/glsx-oss-account-config',
async
:
false
,
async
:
false
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
store
.
setEx
(
'external'
,
res
.
external
,
10
*
60
*
1000
)
store
.
setEx
(
'external'
,
res
.
external
,
10
*
60
*
1000
)
...
...
js/request.js
View file @
ee79830
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
* @version: 1.0.0
* @version: 1.0.0
* @Author: limin
* @Author: limin
* @Date: 2021-07-19 10:15:48
* @Date: 2021-07-19 10:15:48
* @LastEditors:
limin
* @LastEditors:
Please set LastEditors
* @LastEditTime: 202
1-08-09 14:09:1
2
* @LastEditTime: 202
2-03-12 15:50:5
2
* @FilePath: \account\js\request.js
* @FilePath: \account\js\request.js
*/
*/
layui
.
define
([
'sha1'
,
'md5'
,
'helper'
],
function
(
exports
)
{
layui
.
define
([
'sha1'
,
'md5'
,
'helper'
],
function
(
exports
)
{
...
@@ -88,6 +88,14 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
...
@@ -88,6 +88,14 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
settings
.
processData
=
false
settings
.
processData
=
false
settings
.
contentType
=
false
settings
.
contentType
=
false
}
}
if
(
config
.
isDjUrl
)
{
console
.
log
(
common
)
settings
.
url
=
common
.
otherRequest
+
'?method='
+
params
.
method
settings
.
beforeSend
=
function
(
request
)
{
var
token
=
store
.
get
(
'token'
)
request
.
setRequestHeader
(
'token'
,
token
)
}
}
return
$
.
ajax
(
settings
)
return
$
.
ajax
(
settings
)
}
}
...
...
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