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 c08ed7d7
authored
Oct 09, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改新增商户样式和 修改账户有效期
1 parent
3abfa470
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
157 additions
and
121 deletions
html/merchant/add.html
html/merchant/edit.html
html/merchant/index.html
html/merchant/validPeriodForm.html
html/merchant/add.html
View file @
c08ed7d
...
...
@@ -9,6 +9,16 @@
<meta
name=
"keywords"
itemprop=
"keywords"
content=
"广联,帐户管理,员工管理"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/main.css"
/>
<style>
.clearfix
{
zoom
:
1
;
}
.clearfix
::after
{
content
:
""
;
display
:
block
;
height
:
0
;
clear
:
both
;
visibility
:
hidden
;
}
.edit-box
{
/* width: 1046px; */
padding
:
20px
20px
;
...
...
@@ -101,7 +111,7 @@
background-color
:
#1989fa
;
color
:
#fff
;
height
:
16px
;
line-height
:
16px
;
line-height
:
16px
text-align
:
center
;
width
:
16px
;
border-radius
:
50%
;
...
...
@@ -112,6 +122,7 @@
font-size
:
14px
;
color
:
#999
;
margin-left
:
160px
;
margin-top
:
8px
;
}
.form-right
{
...
...
@@ -163,6 +174,17 @@
.layui-no-data
.no-data
div
{
margin-top
:
12px
;
}
.layuui-radio
{
display
:
inline-flex
;
align-items
:
center
;
margin-right
:
20px
;
}
.layuui-radio
.layui-form-radio
{
margin
:
0
;
}
.layuui-radio
span
{
line-height
:
28px
;
}
</style>
<title>
商户编辑
</title>
</head>
...
...
@@ -174,10 +196,11 @@
<div
class=
"pageTitle"
>
<span
id=
"addUpdateTitle"
>
创建商户
</span>
</div>
<
div
class=
"edit-box"
>
<
!-- <div class="edit-box"> --
>
<!-- 基本信息 -->
<div
id=
"basicForm"
>
<form
class=
"layui-form"
lay-filter=
"merchantForm"
>
<form
class=
"layui-form layui-row"
lay-filter=
"merchantForm"
>
<div
class=
"edit-box clearfix"
>
<div
class=
"grayLine"
></div>
<div
class=
"layui-form-item edit-title"
style=
"position: relative"
>
<div
class=
"layui-input-inline"
>
企业基本信息
</div>
...
...
@@ -190,15 +213,20 @@
</div>
</div>
</div>
<div
id=
"merchantModel"
class=
"hide"
>
<div
id=
"merchantModel"
class=
"hide
layui-col-md9
"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
选择开通模式:
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"radio"
name=
"sex"
value=
"男"
title=
"单店企微版"
/>
<span>
(一个门店一个企微账户授权)
</span>
<input
type=
"radio"
name=
"sex"
value=
"女"
title=
"集团企微版"
/>
<span>
(集团多个企微共用一个企微账户授权)
</span>
</div>
<!-- <div class="layui-input-inline"> -->
<div
class=
"layuui-radio"
>
<input
type=
"radio"
name=
"merchantModel"
value=
"男"
title=
"单店企微版"
/>
<span>
(一个门店一个企微账户授权)
</span>
</div>
<div
class=
"layuui-radio"
>
<input
type=
"radio"
name=
"merchantModel"
value=
"女"
title=
"集团企微版"
/>
<span>
(集团多个企微共用一个企微账户授权)
</span>
</div>
<!-- </div> -->
</div>
</div>
<div
class=
"layui-col-md6"
>
...
...
@@ -312,6 +340,7 @@
</div>
</div>
</div>
<div
class=
"layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
主营品牌:
</label>
<div
class=
"layui-input-inline"
>
...
...
@@ -319,6 +348,8 @@
<div
id=
"carBrandTree"
style=
"width: 300px; height: 200px; overflow-y: scroll"
></div>
</div>
</div>
</div>
<div
class=
"layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
门店照片:
</label>
<div
class=
"layui-input-inline upload-img-wh"
>
...
...
@@ -369,11 +400,13 @@
/>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<span
class=
"tips"
>
图片格式仅支持JPG,PNG格式,大小1M以内
</span>
</div>
</div>
</div>
<div
class=
"edit-box"
>
<p
class=
"edit-title"
>
账户基本信息
</p>
<div
class=
"grayLine"
></div>
<div
id=
"subMerchantEl"
class=
"layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label required"
>
上级商户:
</label>
...
...
@@ -461,10 +494,13 @@
<button
id=
"firstBtn"
class=
"layui-btn"
lay-submit
lay-filter=
"handleFirstSubmit"
>
下一步
</button>
<button
type=
"reset"
class=
"layui-btn"
data-type=
"handleCancel"
>
取消
</button>
</div>
</div>
</form>
</div>
</div>
<!-- 权限树 -->
<div
id=
"authorityTree"
>
<div
class=
"edit-box"
>
<!-- 树 -->
<!-- <div class="layui-form-item">
<label class="layui-form-label required">角色权限:</label>
...
...
html/merchant/edit.html
View file @
c08ed7d
This diff is collapsed.
Click to expand it.
html/merchant/index.html
View file @
c08ed7d
...
...
@@ -51,7 +51,8 @@
<i
class=
"layui-icon layui-icon-addition"
></i>
创建商户
</button>
<div
class=
"layui-inline channel"
pane
>
</div>
<div
class=
"layui-inline channel"
>
<label
class=
"layui-form-label"
>
渠道:
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"channelId"
id=
"channelIdEl"
>
...
...
@@ -59,7 +60,7 @@
</select>
</div>
</div>
<div
class=
"layui-inline accountLevel"
pane
>
<div
class=
"layui-inline accountLevel"
>
<label
class=
"layui-form-label"
>
账户等级:
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"merchantAccountLevel"
id=
"accountLevelEl"
>
...
...
@@ -67,7 +68,7 @@
</select>
</div>
</div>
<div
class=
"layui-inline accountType"
pane
>
<div
class=
"layui-inline accountType"
>
<label
class=
"layui-form-label"
>
账户类型:
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"accounttypeId"
id=
"accountTypeIdEl"
>
...
...
@@ -75,8 +76,7 @@
</select>
</div>
</div>
</div>
<div
class=
"layui-inline loginName"
pane
>
<div
class=
"layui-inline loginName"
>
<div
class=
"layui-input-inline"
style=
"width: 120px"
>
<select
name=
"accountOrPhone"
lay-filter=
"nameFilter"
>
<option
value=
"0"
>
登录账号名
</option>
...
...
@@ -87,7 +87,7 @@
<input
class=
"layui-input"
placeholder=
"请输入"
name=
"merchantLoginAccount"
/>
</div>
</div>
<div
class=
"layui-inline customerStatus"
pane
>
<div
class=
"layui-inline customerStatus"
>
<label
class=
"layui-form-label"
>
账户状态:
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"status"
id=
"searchStatusEl"
>
...
...
@@ -95,7 +95,7 @@
</select>
</div>
</div>
<div
class=
"layui-inline customerStatus"
pane
>
<div
class=
"layui-inline customerStatus"
>
<label
class=
"layui-form-label"
>
模式:
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"status"
id=
"searchModelEl"
>
...
...
@@ -103,10 +103,9 @@
</select>
</div>
</div>
<div
class=
"layui-inline customerStatus"
pane
>
<label
class=
"layui-form-label"
></label>
<div
class=
"layui-inline customerStatus"
>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"merchantName"
placeholder=
"请输入商户名称
"
/>
<input
class=
"layui-input"
style=
"width: 380px;"
name=
"merchantName"
placeholder=
"请输入商户名称/关联的企业微信名
"
/>
</div>
</div>
<div
class=
"layui-inline searchInputBtn"
>
...
...
@@ -173,7 +172,6 @@
var
helper
=
layui
.
helper
var
user
=
helper
.
store
.
get
(
'user'
)
var
isDxternal
=
isAppend
()
var
baseData
=
{
statusList
:
[],
channelList
:
[],
...
...
@@ -309,10 +307,15 @@
align
:
'center'
},
{
field
:
'entmicroName'
,
title
:
'关联的企业微信'
,
align
:
'center'
},
{
field
:
'accountTypeNames'
,
title
:
'账户类型'
,
align
:
'left'
,
width
:
1
0
0
,
width
:
1
5
0
,
templet
:
'#accountTypeTpl'
},
{
...
...
@@ -357,19 +360,12 @@
align
:
'left'
,
title
:
'操作'
,
toolbar
:
'#merchantBtns'
,
width
:
220
// fixed: 'right'
// },
// {
// align: 'left',
// title: '账户开关',
// toolbar: '#vaildPeriod',
// width: 150
// // fixed: 'right'
width
:
220
,
fixed
:
'right'
}
]
var
gl
=
tru
e
var
gl
=
fals
e
var
merchantTable
=
table
.
render
({
elem
:
'#merchantTable'
,
page
:
false
,
...
...
@@ -462,15 +458,19 @@
// 修改账户有效期
case
'handleVaildPeriod'
:
// console.log(row)
var
area
=
[
'500px'
,
'180px'
]
if
(
row
.
merchantAccountLevel
!=
4
)
{
area
=
[
'900px'
,
'480px'
]
}
layer
.
open
({
type
:
2
,
title
:
''
,
closeBtn
:
0
,
area
:
[
'900px'
,
'230px'
]
,
area
:
area
,
fixed
:
false
,
//不固定
// maxmin: true,
btn
:
[
'确定'
,
'取消'
],
content
:
'validPeriodForm.html?id='
+
row
.
id
+
'&effectiveTime='
+
row
.
effectiveTime
+
'&
merchantAccountLevel='
+
row
.
merchantAccountLevel
+
'&status='
+
row
.
status
,
content
:
'validPeriodForm.html?id='
+
row
.
id
+
'&effectiveTime='
+
row
.
effectiveTime
+
'&
status='
+
row
.
status
+
'&merchantAccountLevel='
+
row
.
merchantAccountLevel
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
)
helper
.
store
.
set
(
'isRefresh'
,
false
)
...
...
html/merchant/validPeriodForm.html
View file @
c08ed7d
...
...
@@ -15,6 +15,12 @@
padding
:
20px
20px
;
background-color
:
#ffffff
;
}
.layui-form-label
{
width
:
120px
;
}
.hide
{
display
:
none
;
}
</style>
<title>
修改有效期
</title>
</head>
...
...
@@ -23,25 +29,20 @@
<div
id=
"app"
>
<main
class=
"valid-period"
>
<form
class=
"layui-form"
lay-filter=
"periodFilter"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户有效期:
</label>
<div
class=
"layui-input-block"
>
<input
type=
"radio"
name=
"effectiveTime"
value=
"1"
title=
"启用"
>
<input
type=
"radio"
name=
"effectiveTime"
value=
"2"
title=
"禁用"
checked
>
<div
id=
"merchantEl"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户有效期:
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"radio"
name=
"effectiveTime"
lay-filter=
"radio"
value=
"2"
title=
"启用"
>
<input
type=
"radio"
name=
"effectiveTime"
lay-filter=
"radio"
value=
"4"
title=
"禁用"
>
</div>
<button
id=
"periodVerifyBtn"
lay-submit
lay-filter=
"periodSubmit"
style=
"display: none;"
></button>
</div>
<button
id=
"periodVerifyBtn"
lay-submit
lay-filter=
"periodSubmit"
style=
"display: none;"
></button>
</div>
<!-- <div class="layui-form-item">
<div class="layui-form-label required" style="width: 120px;"></div>
<div class="layui-input-inline" style="width: auto;">
<select name="effectiveTime" id="periodSelect" required lay-verify="required">
<option value="">请选择</option>
</select>
<p class="input-downtips">(注:永久有效不超过所属工厂商户的有效期)</p>
<div
class=
"layui-form-item"
>
<p
class=
"input-downtips"
id=
"tips"
></p>
</div>
</div> -->
<div
class=
"layui-form-item"
>
</div>
<div
id=
"storeEl"
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
账户有效期:
</label>
<div
class=
"layui-inline"
>
<div
class=
"layui-input-inline"
>
...
...
@@ -70,15 +71,23 @@
var
helper
=
layui
.
helper
var
currLayerIdx
=
parent
.
layer
.
getFrameIndex
(
window
.
name
)
var
baseData
=
{}
var
merchantAccountLevel
=
getQueryString
(
'merchantAccountLevel'
)
var
vaildData
=
{
id
:
getQueryString
(
'id'
),
effectiveTime
:
getQueryString
(
'effectiveTime'
)
id
:
getQueryString
(
'id'
)
}
// 1-工厂;2-省代;3-市代;4-门店
var
merchantAccountLevel
=
getQueryString
(
'merchantAccountLevel'
)
// 1-草稿;2-正常;3-注销;4-过期
var
status
=
getQueryString
(
'status'
)
if
(
merchantAccountLevel
!=
4
)
{
$
(
'#storeEl'
).
show
()
$
(
'#merchantEl'
).
hide
()
}
else
{
$
(
'#merchantEl'
).
show
()
$
(
'#storeEl'
).
hide
()
setText
(
2
)
vaildData
.
effectiveTime
=
getQueryString
(
'effectiveTime'
)
}
form
.
val
(
'periodFilter'
,
{
effectiveTime
:
vaildData
.
effectiveTime
})
var
effectiveStarttime
=
laydate
.
render
({
elem
:
'#effectiveStarttime'
,
...
...
@@ -120,31 +129,66 @@
$
(
'#expireDate'
).
val
(
helper
.
dateFormat
(
endTime
))
})
getVaildPeriod
()
// 1-草稿;2-正常;3-注销;4-过期
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
console
.
log
(
data
)
if
(
data
.
field
.
effectiveTime
)
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
id
:
vaildData
.
id
,
effectiveTime
:
data
.
field
.
effectiveTime
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
if
(
merchantAccountLevel
!=
4
)
{
if
(
data
.
field
.
effectiveTime
)
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateMerchant'
,
id
:
vaildData
.
id
,
effectiveTime
:
data
.
field
.
effectiveTime
}
})
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
})
}
else
{
layer
.
msg
(
'请选择账户有效期'
,
{
icon
:
5
,
anim
:
6
})
}
}
else
{
layer
.
msg
(
'请选择账户有效期'
,
{
icon
:
5
,
anim
:
6
})
if
(
data
.
field
.
effectiveStarttime
&&
data
.
field
.
expireDate
)
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateMerchant'
,
id
:
vaildData
.
id
,
effectiveStarttime
:
data
.
field
.
effectiveStarttime
,
expireDate
:
data
.
field
.
expireDate
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
})
}
else
{
layer
.
msg
(
'请选择账户有效期'
,
{
icon
:
5
,
anim
:
6
})
}
}
return
false
})
// 触发单选框
form
.
on
(
'radio(radio)'
,
function
(
data
){
setText
(
data
.
value
)
});
function
setText
(
value
)
{
if
(
value
==
2
)
{
$
(
'#tips'
).
text
(
'启用商户,其下级商户也会启用,但门店账户由门店本身的有效期控制。'
)
}
else
if
(
value
==
4
)
{
$
(
'#tips'
).
text
(
'禁用商户,其下级商户及门店全部禁止登录,登录时,提示“您的账户无效,请联系管理员”。'
)
}
}
// 获取参数
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
)
...
...
@@ -154,50 +198,6 @@
}
return
null
}
// 获取有效期
function
getVaildPeriod
()
{
request
({
method
:
'cn.com.glsx.merchants.menu.findAllDictData'
,
dictType
:
'account_validity_period'
},
function
(
res
)
{
if
(
res
.
code
===
'0'
)
{
baseData
.
effectiveTimeList
=
res
.
data
var
periodSelect
=
$
(
'#periodSelect'
)
$
.
each
(
baseData
.
effectiveTimeList
,
function
(
index
,
item
)
{
// 工厂
if
(
merchantAccountLevel
==
1
)
{
// 状态 - 正常
if
(
status
==
2
)
{
// 永久有效
if
(
vaildData
.
effectiveTime
==
0
)
{
if
(
item
.
dictValue
==
-
1
)
{
periodSelect
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
}
}
else
if
((
item
.
dictValue
==
0
)
||
(
item
.
dictValue
==
-
1
)
||
(
vaildData
.
effectiveTime
<
item
.
dictValue
))
{
periodSelect
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
}
}
else
{
// 状态 - 过期/注销
if
(
vaildData
.
effectiveTime
!=
item
.
dictValue
)
{
periodSelect
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
}
}
}
else
{
if
((
item
.
dictValue
==
0
)
||
(
item
.
dictValue
==
-
1
))
{
periodSelect
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
}
}
})
form
.
val
(
'periodFilter'
,
{
effectiveTime
:
vaildData
.
effectiveTime
})
form
.
render
(
'select'
)
}
})
}
})
</script>
</body>
...
...
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