记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
d5501151
Commit
d5501151
authored
Sep 15, 2021
by
dongchun
Committed by
张国柄
Sep 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt
parent
87f70c2e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2301 additions
and
1036 deletions
+2301
-1036
add.html
...in/resources/templates/zhengzai/candy/coupon/mgt/add.html
+538
-21
add1.html
...n/resources/templates/zhengzai/candy/coupon/mgt/add1.html
+535
-252
add2.html
...n/resources/templates/zhengzai/candy/coupon/mgt/add2.html
+539
-252
add3.html
...n/resources/templates/zhengzai/candy/coupon/mgt/add3.html
+332
-256
add4.html
...n/resources/templates/zhengzai/candy/coupon/mgt/add4.html
+357
-255
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add.html
View file @
d5501151
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<head>
<th:block
th:include=
"include :: header('添加代金券')"
/>
<th:block
th:include=
"include :: header('新增代金券')"
/>
<th:block
th:include=
"include :: select2-css"
/>
<th:block
th:include=
"include :: select2-css"
/>
<link
rel=
"stylesheet"
href=
""
>
<style>
.layui-form
{
padding
:
20px
;
}
.main_title
,
.main_type
,
.money
,
.scope_application
,
.sendType
,
.phoneNumber
,
.playMethod
{
margin-bottom
:
20px
;
}
.scope_application
,
.sendType
,
.phoneNumber
,
#test1
,
.playMethod
{
display
:
none
;
}
#test1
{
display
:
none
;
}
.labelName
{
display
:
inline-block
;
width
:
100px
;
text-align
:
right
;
}
input
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
padding-left
:
5px
;
height
:
30px
;
}
.main_title
input
{
width
:
200px
;
}
.prompt
{
margin-left
:
100px
!important
;
}
.main_type
input
,
.sendType
input
,
.playMethod
input
{
margin-top
:
-2px
;
margin-right
:
5px
;
}
.main_type
span
,
.sendType
span
,
.playMethod
span
{
margin-right
:
12px
;
line-height
:
28px
;
}
.layui-form
.money
input
{
width
:
60px
;
}
.changeData
.dataOne
{
margin-bottom
:
20px
;
}
.changeData
.dataOne
p
{
margin
:
12px
0
0
20px
;
color
:
#ccc
;
}
.changeData
.dataOne
input
{
width
:
60px
;
}
.main_bottom
.describe
,
.main_bottom
.sendTime
{
margin-bottom
:
20px
;
}
.describe
,
.main_type
{
display
:
flex
;
}
.describe
textarea
,
.phoneNumber
textarea
{
width
:
400px
;
}
.sendTime
{
display
:
flex
;
}
.sendTime
input
{
margin-top
:
-6px
;
margin-right
:
5px
;
}
.bottom_btn
{
width
:
25%
;
text-align
:
center
;
}
select
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
height
:
30px
;
width
:
200px
;
}
.search_ipt
ul
,
.search_ipt
li
{
padding
:
0
;
margin
:
0
;
font-style
:
normal
;
list-style
:
none
;
}
.search_ipt
ul
{
display
:
none
;
position
:
absolute
;
left
:
0
;
top
:
26px
;
padding
:
5px
0
;
z-index
:
899
;
min-width
:
200px
;
border
:
1px
solid
#eee
;
max-height
:
300px
;
overflow-y
:
auto
;
background-color
:
#fff
;
border-radius
:
2px
;
box-sizing
:
border-box
;
box-shadow
:
1px
1px
4px
rgb
(
0
0
0
/
8%
);
}
.search_ipt
li
{
background-color
:
#fff
;
cursor
:
pointer
;
padding-left
:
10px
!important
;
color
:
#999
;
padding
:
0
10px
;
line-height
:
36px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.search_ipt
li
:hover
{
background
:
#F6F6F6
;
}
.search_ipt
.layui-input
{
width
:
200px
;
}
#test1
{
display
:
none
;
}
.required
{
font-style
:
normal
;
color
:
red
;
}
#iptModal
{
display
:
none
;
}
</style>
</head>
</head>
<body>
<body>
<div
class=
"main-content"
>
<form
id=
"form-user-add"
class=
"layui-form"
>
<form
id=
"form-coupon-mgt-add"
class=
"form-horizontal"
>
<div
class=
"main_title"
>
<input
name=
"couType"
type=
"text"
th:value=
"${couType}"
readonly
/>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
名称:
</span><input
type=
"text"
id=
"title"
name=
"keyword"
placeholder=
"券名称"
required
/>
</form>
</div>
</div>
<div
class=
"main_type"
>
<span
class=
"labelName"
>
类别:
</span>
<div
class=
"row"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<div
class=
"col-sm-offset-5 col-sm-10"
>
<input
type=
"radio"
value=
"0"
class=
"typeOne"
name=
"typeOne"
checked
><span>
全场
</span>
<button
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"submitHandler()"
><i
class=
"fa fa-check"
></i>
保 存
</button>
<input
type=
"radio"
value=
"1"
class=
"typeOne"
name=
"typeOne"
><span>
演出
</span>
<button
type=
"button"
class=
"btn btn-sm btn-danger"
onclick=
"closeItem()"
><i
class=
"fa fa-reply-all"
></i>
关 闭
</button>
<input
type=
"radio"
value=
"2"
class=
"typeOne"
name=
"typeOne"
><span>
商品
</span>
</div>
<input
type=
"radio"
value=
"3"
class=
"typeOne"
name=
"typeOne"
><span>
优先购
</span>
</div>
</div>
<th:block
th:include=
"include :: footer"
/>
<th:block
th:include=
"include :: select2-js"
/>
<script>
var
couType
=
[[
$
{
couType
}]];
var
prefix
=
ctx
+
"candy/coupon/mgt"
;
</div>
<div
class=
"money"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
金额:
</span><input
type=
"text"
id=
"valFace"
required
/>
</div>
<div
class=
"main_type"
>
<span
class=
"labelName"
>
类型:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
value=
"0"
class=
"typeTwo"
name=
"typeTwo"
checked
><span>
用户输入兑换
</span>
<input
type=
"radio"
value=
"1"
class=
"typeTwo"
name=
"typeTwo"
><span>
发送至“我的券”
</span>
</div>
</script>
</div>
<div
class=
"scope_application"
id=
"scope_application"
>
<span
class=
"labelName"
>
适用范围:
</span>
<div
class=
"search_ipt"
style=
"position: relative;display: inline;"
>
<input
type=
"text"
id=
"searchIpt"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"全部"
>
<ul
id=
"dataList"
style=
"position: absolute;"
></ul>
</div>
<select
name=
"bindType"
id=
"selectTwo"
>
<option
value=
""
>
所有
</option>
</select>
<select
name=
"bindType"
id=
"selectThree"
>
<option
value=
""
>
所有
</option>
</select>
</div>
<div
class=
"changeData"
>
<div
id=
"modalOne"
>
<div
class=
"dataOne"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
数量:
</span>
<input
type=
"text"
id=
"num"
required
/>
张
</div>
<div
class=
"dataOne"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
券的有效期:
</span>
<input
type=
"text"
id=
"ticketTime"
required
/>
天
<p
class=
"prompt"
>
*可兑换的时间
</p>
</div>
<div
class=
"dataOne"
id=
"exchange"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
兑换有效期:
</span>
<input
type=
"text"
id=
"exchangeTime"
required
/>
天
<p
class=
"prompt"
>
*兑换后的有效时间
</p>
</div>
</div>
</div>
<div
class=
"sendType"
>
<div
style=
"display: flex;align-items: center;"
>
<span
class=
"labelName"
>
发送类型:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
value=
"10"
class=
"sendType"
name=
"sendType"
checked
><span>
全体用户
</span>
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
><span>
会员
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
</div>
</div>
</div>
<div
class=
"phoneNumber"
>
<span
style=
"display:inline-block;margin-bottom: 12px;"
><i
class=
"required"
>
*
</i>
请输入手机号
<span
style=
"color: #ccc"
>
(手机号可填多个,使用","隔开)
</span>
:
</span>
<textarea
id=
"phoneNum"
class=
"form-control"
rows=
"4"
style=
"margin-left: 100px"
></textarea>
</div>
<div
class=
"main_bottom"
>
<div
class=
"describe"
>
<span
class=
"labelName"
>
描述说明:
</span>
<textarea
id=
"describeTxt"
class=
"form-control"
rows=
"4"
></textarea>
</div>
<div
class=
"playMethod"
>
<div
style=
"display: flex;align-items: center;"
>
<span
class=
"labelName"
>
使用限制:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
value=
"1"
class=
"playMethod"
name=
"playMethod"
checked
><span>
叠加
</span>
<input
type=
"radio"
value=
"0"
class=
"playMethod"
name=
"playMethod"
><span>
限制
</span>
</div>
</div>
</div>
<div
class=
"sendTime"
>
<span
class=
"labelName"
>
发送时间:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
name=
"sex"
value=
"1"
title=
"立即"
checked
><span>
立即
</span>
<span
style=
"margin-right:12px;"
id=
"iptModal"
><p
style=
"display:flex"
><input
type=
"radio"
name=
"sex"
value=
"2"
title=
"预约"
style=
"margin-left: 12px;"
>
预约
</p></span>
</div>
<input
type=
"text"
class=
"layui-input"
id=
"test1"
placeholder=
"请选择时间"
>
</div>
<div
class=
"bottom_btn"
>
<!-- <button type="button" class="layui-btn btn btn-primary" lay-filter="formDemo" onclick="create()">创建代金券</button> -->
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
创建代金券
</button>
</div>
</div>
</form>
<th:block
th:include=
"include :: footer"
/>
<th:block
th:include=
"include :: select2-js"
/>
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
</body>
</body>
</html>
<script>
\ No newline at end of file
var
roadShowId
=
'[[${roadShowId}]]'
.
replaceAll
(
"
\"
"
,
""
);
let
prefix
=
ctx
;
let
typeOne
=
'0'
;
// 类别
let
typeTwo
=
'0'
;
// 类型
let
sendType
=
'10'
;
// 发送类型
let
searchVal
=
''
;
// 输入框内数据
let
searchData
=
[];
// 搜索总数据
let
showId
=
''
;
// 选中演出id
let
selectTwoId
=
''
;
// 选中演出下级的ID
let
selectTwoName
=
''
;
// 选中演出下级的名称
let
selectThreeId
=
''
;
// 选中演出三级的ID
let
selectThreeName
=
''
;
// 选中演出三级的名称
let
sendTimeType
=
''
;
let
playMethod
=
'1'
;
// 叠加/限制
function
search
()
{
let
data
=
{
status
:
'(3,6)'
,
title
:
searchVal
}
let
str
=
''
;
promiseMethods
(
ctx
+
'kylin/base/performance/status'
,
'get'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
if
(
res
.
value
.
length
>
0
)
{
searchData
=
res
.
value
;
searchData
.
forEach
((
item
,
index
)
=>
{
str
+=
`<li class="selectData" onclick="selectOne(
${
item
.
performancesId
}
,'
${
item
.
title
}
')">
${
item
.
title
}
</li>`
})
$
(
'#dataList'
).
html
(
str
);
}
else
{
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
}
})
};
function
getMallList
()
{
let
data
=
{
title
:
''
}
let
str
=
''
;
promiseMethods
(
'http://testmall.zhengzai.tv/admin/goodListForQuick'
,
'get'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
if
(
res
.
data
.
length
>
0
)
{
searchData
=
res
.
data
;
searchData
.
forEach
((
item
,
index
)
=>
{
str
+=
`<li class="selectData" onclick="selectOne(
${
item
.
id
}
,'
${
item
.
title
}
')">
${
item
.
title
}
</li>`
})
$
(
'#dataList'
).
html
(
str
);
}
else
{
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
}
})
// $.ajax({
// type:'get',
// url:'http://testmall.zhengzai.tv/admin/goodListForQuick',
// success:function(e){
// console.log(e)
// }
// });
};
function
selectOne
(
id
,
name
)
{
$
(
"#searchIpt"
).
val
(
name
);
showId
=
id
;
if
(
typeOne
==
2
)
{
return
}
let
str
=
`<option value="0" label="">所有</option>`
;
searchData
.
forEach
(
item
=>
{
if
(
item
.
performancesId
==
id
)
{
str
+=
`<option value=
${
item
.
timeId
}
label=
${
item
.
timeTitle
}
>
${
item
.
timeTitle
}
</option>`
}
})
selectTwoId
=
''
;
// 选中演出下级的ID
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#selectTwo'
).
empty
().
append
(
str
);
$
(
'#selectThree'
).
empty
();
};
$
(
"#searchIpt"
).
focus
(
function
(){
if
(
typeOne
==
2
)
{
getMallList
()
}
else
{
console
.
log
(
'search'
)
search
()
}
$
(
'#dataList'
).
show
()
});
$
(
"#searchIpt"
).
blur
(
function
(){
setTimeout
(()
=>
{
$
(
'#dataList'
).
hide
()
},
500
);
});
$
(
"#searchIpt"
).
keyup
(
function
(){
searchVal
=
$
(
"#searchIpt"
).
val
()
search
()
});
$
(
'#selectTwo'
).
change
(
function
(
e
){
selectTwoId
=
$
(
this
).
val
();
console
.
log
(
selectTwoId
,
'kankna'
)
selectTwoName
=
$
(
'#selectTwo'
).
find
(
'option:selected'
).
attr
(
'label'
);
let
str
=
`<option value="0" label="" >所有</option>`
;
searchData
.
forEach
(
item
=>
{
if
(
item
.
timeId
==
selectTwoId
)
{
str
+=
`<option value=
${
item
.
ticketId
}
label=
${
item
.
ticketTitle
}
>
${
item
.
ticketTitle
}
</option>`
}
})
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#selectThree'
).
empty
().
append
(
str
);
});
$
(
'#selectThree'
).
change
(
function
(
e
){
selectThreeId
=
$
(
this
).
val
();
selectThreeName
=
$
(
'#selectThree'
).
find
(
'option:selected'
).
attr
(
'label'
);
});
$
(
"input[name=typeOne]"
).
change
(
function
(
e
){
typeOne
=
e
.
target
.
value
;
if
(
typeOne
!=
0
)
{
showId
=
''
;
// 选中演出id
selectTwoId
=
''
;
// 选中演出下级的ID
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#scope_application'
).
show
();
}
else
{
$
(
'#searchIpt'
).
val
(
''
);
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
(
''
);
$
(
'#scope_application'
).
hide
();
}
if
(
typeOne
==
2
||
typeOne
==
3
)
{
showId
=
''
;
$
(
'#selectTwo'
).
val
(
''
);
$
(
'#selectThree'
).
val
(
''
);
$
(
'#selectTwo'
).
hide
();
$
(
'#selectThree'
).
hide
();
$
(
'#searchIpt'
).
val
(
''
);
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
();
$
(
'#dataList'
).
empty
();
}
else
{
$
(
'#selectTwo'
).
show
();
$
(
'#selectThree'
).
show
();
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
();
$
(
'#dataList'
).
empty
();
}
if
(
typeOne
==
3
)
{
$
(
'.playMethod'
).
show
()
}
else
{
$
(
'.playMethod'
).
hide
()
}
});
$
(
"input[name=typeTwo]"
).
change
(
function
(
e
){
typeTwo
=
e
.
target
.
value
;
if
(
typeTwo
==
1
)
{
$
(
'#iptModal'
).
show
();
$
(
'.sendType'
).
show
();
$
(
'#exchangeTime'
).
val
(
''
)
$
(
'#exchange'
).
hide
();
if
(
sendType
==
2
)
{
$
(
'.phoneNumber'
).
show
();
}
}
else
{
$
(
'#iptModal'
).
hide
();
$
(
'#exchange'
).
show
();
$
(
'.sendType'
).
hide
();
$
(
'.phoneNumber'
).
hide
();
$
(
'.test1'
).
val
(
''
);
$
(
'.phoneNum'
).
val
(
''
);
$
(
'.test1'
).
hide
();
}
});
$
(
"input[name=sendType]"
).
change
(
function
(
e
){
sendType
=
e
.
target
.
value
;
if
(
e
.
target
.
value
==
2
)
{
$
(
'.phoneNumber'
).
show
();
$
(
'.test1'
).
show
();
}
else
{
$
(
'.phoneNumber'
).
hide
();
$
(
'.test1'
).
val
(
''
);
$
(
'.test1'
).
hide
();
}
});
$
(
"input[name=sex]"
).
change
(
function
(
e
){
sendTimeType
=
e
.
target
.
value
;
if
(
sendTimeType
==
2
)
{
$
(
'#test1'
).
show
();
}
else
{
$
(
'#test1'
).
val
(
''
)
$
(
'#test1'
).
hide
();
}
});
$
(
"input[name=playMethod]"
).
change
(
function
(
e
){
playMethod
=
e
.
target
.
value
;
});
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
//执行一个laydate实例
laydate
.
render
({
elem
:
'#test1'
,
//指定元素
type
:
'datetime'
});
});
function
create
()
{
if
(
!
$
(
'#valFace'
).
val
()
||
!
$
(
'#title'
).
val
()
||
!
$
(
'#num'
).
val
()
||
!
$
(
'#ticketTime'
).
val
())
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
if
(
typeTwo
!=
1
)
{
if
(
!
$
(
'#exchangeTime'
).
val
())
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
}
}
}
let
useScope
=
100
;
let
busiName
=
''
;
let
busiId
=
''
;
if
(
!
$
(
'#searchIpt'
).
val
())
{
showId
=
''
;
}
if
(
showId
)
{
useScope
=
90
;
}
if
(
selectTwoId
)
{
useScope
=
91
;
busiId
=
selectTwoId
;
busiName
=
selectTwoName
;
}
if
(
selectThreeId
)
{
useScope
=
92
;
busiId
=
selectThreeId
;
busiName
=
selectThreeName
;
}
if
(
typeOne
==
2
)
{
if
(
showId
)
{
useScope
=
80
;
busiId
=
showId
;
}
busiName
=
$
(
"#searchIpt"
).
val
();
}
if
(
typeOne
==
3
)
{
if
(
showId
)
{
useScope
=
90
;
busiId
=
showId
;
}
busiName
=
$
(
"#searchIpt"
).
val
();
}
let
data
=
{
"bindType"
:
Number
(
typeTwo
),
// 兑换券/发放
"busiType"
:
Number
(
typeOne
),
// 业务类别
"couType"
:
1
,
// 券类型
"couponRuleList"
:
[
// 适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式]
{
"useScope"
:
useScope
,
"busiName"
:
busiName
,
"busiId"
:
busiId
}
],
"discount"
:
''
,
// 折扣券需传
"eventAmt"
:
Number
(
$
(
'#num'
).
val
()),
// 数量
"eventAt"
:
$
(
'#test1'
).
val
()
||
$
.
common
.
dateFormat
(
new
Date
(),
'yyyy-MM-dd HH:mm:ss'
),
"eventLimit"
:
$
(
'#phoneNum'
).
val
(),
// 手机号
"eventType"
:
Number
(
sendType
),
"label"
:
"标注"
,
// 不需管
"notice"
:
$
(
'#describeTxt'
).
val
(),
"overlay"
:
playMethod
,
// 优先购ticketTime
"redeemValidity"
:
Number
(
$
(
'#exchangeTime'
).
val
()),
// 兑换有效期
"title"
:
$
(
'#title'
).
val
(),
"valFace"
:
$
(
'#valFace'
).
val
(),
// 金额
"validity"
:
Number
(
$
(
'#ticketTime'
).
val
()),
}
if
(
typeTwo
==
1
)
{
delete
data
.
redeemValidity
}
else
{
delete
data
.
eventType
}
if
(
typeOne
==
0
||
typeOne
==
1
||
typeOne
==
2
)
{
delete
data
.
discount
;
delete
data
.
overlay
;
}
if
(
sendType
!=
2
)
{
delete
data
.
eventLimit
;
}
console
.
log
(
data
,
'data'
)
promiseMethods
(
'/candy/coupon/mgt/add'
,
'post'
,
JSON
.
stringify
(
data
),
'application/json'
).
then
(
res
=>
{
console
.
log
(
res
)
})
}
function
promiseMethods
(
url
,
type
,
data
,
contentType
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$
.
ajax
({
url
,
type
,
data
,
contentType
,
success
:
function
(
res
)
{
resolve
(
res
)
}
})
})
}
</script>
</html>
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add1.html
View file @
d5501151
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<head>
<th:block
th:include=
"include :: header('新增代金券')"
/>
<th:block
th:include=
"include :: header('新增代金券')"
/>
<th:block
th:include=
"include :: select2-css"
/>
<th:block
th:include=
"include :: select2-css"
/>
<link
rel=
"stylesheet"
href=
""
>
<style>
.layui-form
{
padding
:
20px
;
}
.main_title
,
.main_type
,
.money
,
.scope_application
,
.sendType
,
.phoneNumber
,
.playMethod
{
margin-bottom
:
20px
;
}
.scope_application
,
.sendType
,
.phoneNumber
,
#test1
,
.playMethod
{
display
:
none
;
}
#test1
{
display
:
none
;
}
.labelName
{
display
:
inline-block
;
width
:
100px
;
text-align
:
right
;
}
input
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
padding-left
:
5px
;
height
:
30px
;
}
.main_title
input
{
width
:
200px
;
}
.prompt
{
margin-left
:
100px
!important
;
}
.main_type
input
,
.sendType
input
,
.playMethod
input
{
margin-top
:
-2px
;
margin-right
:
5px
;
}
.main_type
span
,
.sendType
span
,
.playMethod
span
{
margin-right
:
12px
;
line-height
:
28px
;
}
.layui-form
.money
input
{
width
:
60px
;
}
.changeData
.dataOne
{
margin-bottom
:
20px
;
}
.changeData
.dataOne
p
{
margin
:
12px
0
0
20px
;
color
:
#ccc
;
}
.changeData
.dataOne
input
{
width
:
60px
;
}
.main_bottom
.describe
,
.main_bottom
.sendTime
{
margin-bottom
:
20px
;
}
.describe
,
.main_type
{
display
:
flex
;
}
.describe
textarea
,
.phoneNumber
textarea
{
width
:
400px
;
}
.sendTime
{
display
:
flex
;
}
.sendTime
input
{
margin-top
:
-6px
;
margin-right
:
5px
;
}
.bottom_btn
{
width
:
25%
;
text-align
:
center
;
}
select
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
height
:
30px
;
width
:
200px
;
}
.search_ipt
ul
,
.search_ipt
li
{
padding
:
0
;
margin
:
0
;
font-style
:
normal
;
list-style
:
none
;
}
.search_ipt
ul
{
display
:
none
;
position
:
absolute
;
left
:
0
;
top
:
26px
;
padding
:
5px
0
;
z-index
:
899
;
min-width
:
200px
;
border
:
1px
solid
#eee
;
max-height
:
300px
;
overflow-y
:
auto
;
background-color
:
#fff
;
border-radius
:
2px
;
box-sizing
:
border-box
;
box-shadow
:
1px
1px
4px
rgb
(
0
0
0
/
8%
);
}
.search_ipt
li
{
background-color
:
#fff
;
cursor
:
pointer
;
padding-left
:
10px
!important
;
color
:
#999
;
padding
:
0
10px
;
line-height
:
36px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.search_ipt
li
:hover
{
background
:
#F6F6F6
;
}
.search_ipt
.layui-input
{
width
:
200px
;
}
#test1
{
display
:
none
;
}
.required
{
font-style
:
normal
;
color
:
red
;
}
#iptModal
{
display
:
none
;
}
</style>
</head>
</head>
<body>
<body>
<div
class=
"main-content"
>
<form
id=
"form-user-add"
class=
"layui-form"
>
<form
id=
"form-user-add"
class=
"form-horizontal"
>
<div
class=
"main_title"
>
<input
name=
"deptId"
type=
"hidden"
id=
"treeId"
/>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
名称:
</span><input
type=
"text"
id=
"title"
name=
"keyword"
placeholder=
"券名称"
required
/>
<h4
class=
"form-header h4"
>
基本信息
</h4>
</div>
<div
class=
"row"
>
<div
class=
"main_type"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
>
类别:
</span>
<div
class=
"form-group"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<label
class=
"col-sm-4 control-label is-required"
>
用户名称:
</label>
<input
type=
"radio"
value=
"0"
class=
"typeOne"
name=
"typeOne"
checked
><span>
全场
</span>
<div
class=
"col-sm-8"
>
<input
type=
"radio"
value=
"1"
class=
"typeOne"
name=
"typeOne"
><span>
演出
</span>
<input
name=
"userName"
placeholder=
"请输入用户名称"
class=
"form-control"
type=
"text"
maxlength=
"30"
required
>
<input
type=
"radio"
value=
"2"
class=
"typeOne"
name=
"typeOne"
><span>
商品
</span>
</div>
<input
type=
"radio"
value=
"3"
class=
"typeOne"
name=
"typeOne"
><span>
优先购
</span>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
</div>
<div
class=
"form-group"
>
<div
class=
"money"
>
<label
class=
"col-sm-4 control-label"
>
归属部门:
</label>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
金额:
</span><input
type=
"text"
id=
"valFace"
required
/>
<div
class=
"col-sm-8"
>
</div>
<div
class=
"input-group"
>
<div
class=
"main_type"
>
<input
name=
"deptName"
onclick=
"selectDeptTree()"
id=
"treeName"
type=
"text"
placeholder=
"请选择归属部门"
class=
"form-control"
>
<span
class=
"labelName"
>
类型:
</span>
<span
class=
"input-group-addon"
><i
class=
"fa fa-search"
></i></span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
</div>
<input
type=
"radio"
value=
"0"
class=
"typeTwo"
name=
"typeTwo"
checked
><span>
用户输入兑换
</span>
</div>
<input
type=
"radio"
value=
"1"
class=
"typeTwo"
name=
"typeTwo"
><span>
发送至“我的券”
</span>
</div>
</div>
</div>
</div>
<div
class=
"scope_application"
id=
"scope_application"
>
<span
class=
"labelName"
>
适用范围:
</span>
<div
class=
"search_ipt"
style=
"position: relative;display: inline;"
>
<input
type=
"text"
id=
"searchIpt"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"全部"
>
<ul
id=
"dataList"
style=
"position: absolute;"
></ul>
</div>
<select
name=
"bindType"
id=
"selectTwo"
>
<option
value=
""
>
所有
</option>
</select>
<select
name=
"bindType"
id=
"selectThree"
>
<option
value=
""
>
所有
</option>
</select>
</div>
<div
class=
"changeData"
>
<div
id=
"modalOne"
>
<div
class=
"dataOne"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
数量:
</span>
<input
type=
"text"
id=
"num"
required
/>
张
</div>
</div>
<div
class=
"row"
>
<div
class=
"dataOne"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
券的有效期:
</span>
<div
class=
"form-group"
>
<input
type=
"text"
id=
"ticketTime"
required
/>
<label
class=
"col-sm-4 control-label"
>
手机号码:
</label>
天
<div
class=
"col-sm-8"
>
<p
class=
"prompt"
>
*可兑换的时间
</p>
<div
class=
"input-group"
>
<input
id=
"phonenumber"
name=
"phonenumber"
placeholder=
"请输入手机号码"
class=
"form-control"
type=
"text"
maxlength=
"11"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-mobile"
></i></span>
</div>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
邮箱:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"email"
name=
"email"
class=
"form-control email"
type=
"text"
maxlength=
"50"
placeholder=
"请输入邮箱"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-envelope"
></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"dataOne"
id=
"exchange"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
兑换有效期:
</span>
<div
class=
"form-group"
>
<input
type=
"text"
id=
"exchangeTime"
required
/>
<label
class=
"col-sm-4 control-label is-required"
>
登录账号:
</label>
天
<div
class=
"col-sm-8"
>
<p
class=
"prompt"
>
*兑换后的有效时间
</p>
<input
id=
"loginName"
name=
"loginName"
placeholder=
"请输入登录账号"
class=
"form-control"
type=
"text"
maxlength=
"30"
required
>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label is-required"
>
登录密码:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"password"
name=
"password"
placeholder=
"请输入登录密码"
class=
"form-control"
type=
"password"
th:value=
"${@config.getKey('sys.user.initPassword')}"
required
>
<span
class=
"input-group-addon"
title=
"登录密码,鼠标按下显示密码"
onmousedown=
"$('#password').attr('type','text')"
onmouseup=
"$('#password').attr('type','password')"
><i
class=
"fa fa-key"
></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
</div>
<div
class=
"col-sm-6"
>
</div>
<div
class=
"form-group"
>
<div
class=
"sendType"
>
<label
class=
"col-sm-4 control-label"
>
用户性别:
</label>
<div
style=
"display: flex;align-items: center;"
>
<div
class=
"col-sm-8"
>
<span
class=
"labelName"
>
发送类型:
</span>
<select
name=
"sex"
class=
"form-control m-b"
th:with=
"type=${@dict.getType('sys_user_sex')}"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<option
th:each=
"dict : ${type}"
th:text=
"${dict.dictLabel}"
th:value=
"${dict.dictValue}"
></option>
<input
type=
"radio"
value=
"10"
class=
"sendType"
name=
"sendType"
checked
><span>
全体用户
</span>
</select>
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
><span>
会员
</span>
</div>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
用户状态:
</label>
<div
class=
"col-sm-8"
>
<label
class=
"toggle-switch switch-solid"
>
<input
type=
"checkbox"
id=
"status"
checked
>
<span></span>
</label>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"form-group"
>
<label
class=
"col-xs-2 control-label"
>
岗位:
</label>
<div
class=
"col-xs-4"
>
<select
id=
"post"
class=
"form-control select2-multiple"
multiple
>
<option
th:each=
"post:${posts}"
th:value=
"${post.postId}"
th:text=
"${post.postName}"
th:disabled=
"${post.status == '1'}"
></option>
</select>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
</div>
<div
class=
"col-sm-12"
>
</div>
<div
class=
"form-group"
>
<div
class=
"phoneNumber"
>
<label
class=
"col-xs-2 control-label"
>
角色:
</label>
<span
style=
"display:inline-block;margin-bottom: 12px;"
><i
class=
"required"
>
*
</i>
请输入手机号
<span
style=
"color: #ccc"
>
(手机号可填多个,使用","隔开)
</span>
:
</span>
<div
class=
"col-xs-10"
>
<textarea
id=
"phoneNum"
class=
"form-control"
rows=
"4"
style=
"margin-left: 100px"
></textarea>
<label
th:each=
"role:${roles}"
class=
"check-box"
>
</div>
<input
name=
"role"
type=
"checkbox"
th:value=
"${role.roleId}"
th:text=
"${role.roleName}"
th:disabled=
"${role.status == '1'}"
>
<div
class=
"main_bottom"
>
</label>
<div
class=
"describe"
>
</div>
<span
class=
"labelName"
>
</div>
描述说明:
</span>
<textarea
id=
"describeTxt"
class=
"form-control"
rows=
"4"
></textarea>
</div>
<div
class=
"playMethod"
>
<div
style=
"display: flex;align-items: center;"
>
<span
class=
"labelName"
>
使用限制:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
value=
"1"
class=
"playMethod"
name=
"playMethod"
checked
><span>
叠加
</span>
<input
type=
"radio"
value=
"0"
class=
"playMethod"
name=
"playMethod"
><span>
限制
</span>
</div>
</div>
</div>
</div>
<h4
class=
"form-header h4"
>
其他信息
</h4>
</div>
<div
class=
"row"
>
<div
class=
"sendTime"
>
<div
class=
"col-sm-12"
>
<span
class=
"labelName"
>
发送时间:
</span>
<div
class=
"form-group"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<label
class=
"col-xs-2 control-label"
>
备注:
</label>
<input
type=
"radio"
name=
"sex"
value=
"1"
title=
"立即"
checked
><span>
立即
</span>
<div
class=
"col-xs-10"
>
<span
style=
"margin-right:12px;"
id=
"iptModal"
><p
style=
"display:flex"
><input
type=
"radio"
name=
"sex"
value=
"2"
title=
"预约"
style=
"margin-left: 12px;"
>
预约
</p></span>
<textarea
name=
"remark"
maxlength=
"500"
class=
"form-control"
rows=
"3"
></textarea>
</div>
</div>
</div>
</div>
</div>
</form>
<input
type=
"text"
class=
"layui-input"
id=
"test1"
placeholder=
"请选择时间"
>
</div>
</div>
<div
class=
"bottom_btn"
>
<div
class=
"row"
>
<!-- <button type="button" class="layui-btn btn btn-primary" lay-filter="formDemo" onclick="create()">创建代金券</button> -->
<div
class=
"col-sm-offset-5 col-sm-10"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
创建代金券
</button>
<button
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"submitHandler()"
><i
class=
"fa fa-check"
></i>
保 存
</button>
<button
type=
"button"
class=
"btn btn-sm btn-danger"
onclick=
"closeItem()"
><i
class=
"fa fa-reply-all"
></i>
关 闭
</button>
</div>
</div>
</div>
</div>
<th:block
th:include=
"include :: footer"
/>
</form>
<th:block
th:include=
"include :: select2-js"
/>
<th:block
th:include=
"include :: footer"
/>
<script>
<th:block
th:include=
"include :: select2-js"
/>
var
prefix
=
ctx
+
"system/user"
;
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
</body>
$
(
"#form-user-add"
).
validate
({
<script>
onkeyup
:
false
,
var
roadShowId
=
'[[${roadShowId}]]'
.
replaceAll
(
"
\"
"
,
""
);
rules
:{
let
prefix
=
ctx
;
loginName
:{
let
typeOne
=
'0'
;
// 类别
minlength
:
2
,
let
typeTwo
=
'0'
;
// 类型
maxlength
:
20
,
let
sendType
=
'10'
;
// 发送类型
remote
:
{
let
searchVal
=
''
;
// 输入框内数据
url
:
prefix
+
"/checkLoginNameUnique"
,
let
searchData
=
[];
// 搜索总数据
type
:
"post"
,
let
showId
=
''
;
// 选中演出id
dataType
:
"json"
,
let
selectTwoId
=
''
;
// 选中演出下级的ID
data
:
{
let
selectTwoName
=
''
;
// 选中演出下级的名称
"loginName"
:
function
()
{
let
selectThreeId
=
''
;
// 选中演出三级的ID
return
$
.
common
.
trim
(
$
(
"#loginName"
).
val
());
let
selectThreeName
=
''
;
// 选中演出三级的名称
}
let
sendTimeType
=
''
;
},
let
playMethod
=
'1'
;
// 叠加/限制
dataFilter
:
function
(
data
,
type
)
{
function
search
()
{
return
$
.
validate
.
unique
(
data
);
let
data
=
{
}
status
:
'(3,6)'
,
}
title
:
searchVal
},
}
password
:{
let
str
=
''
;
minlength
:
5
,
promiseMethods
(
ctx
+
'kylin/base/performance/status'
,
'get'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
maxlength
:
20
if
(
res
.
value
.
length
>
0
)
{
},
searchData
=
res
.
value
;
email
:{
searchData
.
forEach
((
item
,
index
)
=>
{
email
:
true
,
str
+=
`<li class="selectData" onclick="selectOne('
${
item
.
performancesId
}
','
${
item
.
title
}
')">
${
item
.
title
}
</li>`
remote
:
{
})
url
:
prefix
+
"/checkEmailUnique"
,
$
(
'#dataList'
).
html
(
str
);
type
:
"post"
,
}
else
{
dataType
:
"json"
,
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
data
:
{
}
"email"
:
function
()
{
})
return
$
.
common
.
trim
(
$
(
"#email"
).
val
());
};
}
function
getMallList
()
{
},
let
data
=
{
dataFilter
:
function
(
data
,
type
)
{
title
:
''
return
$
.
validate
.
unique
(
data
);
}
}
let
str
=
''
;
}
promiseMethods
(
'http://testmall.zhengzai.tv/admin/goodListForQuick'
,
'get'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
},
if
(
res
.
data
.
length
>
0
)
{
phonenumber
:{
searchData
=
res
.
data
;
isPhone
:
true
,
searchData
.
forEach
((
item
,
index
)
=>
{
remote
:
{
str
+=
`<li class="selectData" onclick="selectOne('
${
item
.
id
}
','
${
item
.
title
}
')">
${
item
.
title
}
</li>`
url
:
prefix
+
"/checkPhoneUnique"
,
})
type
:
"post"
,
$
(
'#dataList'
).
html
(
str
);
dataType
:
"json"
,
}
else
{
data
:
{
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
"phonenumber"
:
function
()
{
}
return
$
.
common
.
trim
(
$
(
"#phonenumber"
).
val
());
})
}
// $.ajax({
},
// type:'get',
dataFilter
:
function
(
data
,
type
)
{
// url:'http://testmall.zhengzai.tv/admin/goodListForQuick',
return
$
.
validate
.
unique
(
data
);
// success:function(e){
}
// console.log(e)
}
// }
},
// });
},
};
messages
:
{
function
selectOne
(
id
,
name
)
{
"loginName"
:
{
console
.
log
(
id
,
showId
,
'showId'
)
remote
:
"用户已经存在"
$
(
"#searchIpt"
).
val
(
name
);
},
showId
=
id
;
"email"
:
{
if
(
typeOne
==
2
)
{
remote
:
"Email已经存在"
return
},
}
"phonenumber"
:{
let
str
=
`<option value="0" label="">所有</option>`
;
remote
:
"手机号码已经存在"
searchData
.
forEach
(
item
=>
{
}
if
(
item
.
performancesId
==
id
)
{
},
str
+=
`<option value='
${
item
.
timeId
}
' label=
${
item
.
timeTitle
}
>
${
item
.
timeTitle
}
</option>`
focusCleanup
:
true
}
})
selectTwoId
=
''
;
// 选中演出下级的ID
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#selectTwo'
).
empty
().
append
(
str
);
$
(
'#selectThree'
).
empty
();
};
$
(
"#searchIpt"
).
focus
(
function
(){
if
(
typeOne
==
2
)
{
getMallList
()
}
else
{
console
.
log
(
'search'
)
search
()
}
$
(
'#dataList'
).
show
()
});
$
(
"#searchIpt"
).
blur
(
function
(){
setTimeout
(()
=>
{
$
(
'#dataList'
).
hide
()
},
500
);
});
$
(
"#searchIpt"
).
keyup
(
function
(){
searchVal
=
$
(
"#searchIpt"
).
val
()
search
()
});
$
(
'#selectTwo'
).
change
(
function
(
e
){
selectTwoId
=
$
(
this
).
val
();
console
.
log
(
selectTwoId
,
'kankna'
)
selectTwoName
=
$
(
'#selectTwo'
).
find
(
'option:selected'
).
attr
(
'label'
);
let
str
=
`<option value="0" label="" >所有</option>`
;
searchData
.
forEach
(
item
=>
{
if
(
item
.
timeId
==
selectTwoId
)
{
str
+=
`<option value='
${
item
.
ticketId
}
' label=
${
item
.
ticketTitle
}
>
${
item
.
ticketTitle
}
</option>`
}
})
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#selectThree'
).
empty
().
append
(
str
);
});
$
(
'#selectThree'
).
change
(
function
(
e
){
selectThreeId
=
$
(
this
).
val
();
selectThreeName
=
$
(
'#selectThree'
).
find
(
'option:selected'
).
attr
(
'label'
);
});
$
(
"input[name=typeOne]"
).
change
(
function
(
e
){
typeOne
=
e
.
target
.
value
;
if
(
typeOne
!=
0
)
{
showId
=
''
;
// 选中演出id
selectTwoId
=
''
;
// 选中演出下级的ID
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#scope_application'
).
show
();
}
else
{
$
(
'#searchIpt'
).
val
(
''
);
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
(
''
);
$
(
'#scope_application'
).
hide
();
}
if
(
typeOne
==
2
||
typeOne
==
3
)
{
showId
=
''
;
$
(
'#selectTwo'
).
val
(
''
);
$
(
'#selectThree'
).
val
(
''
);
$
(
'#selectTwo'
).
hide
();
$
(
'#selectThree'
).
hide
();
$
(
'#searchIpt'
).
val
(
''
);
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
();
$
(
'#dataList'
).
empty
();
if
(
typeOne
==
2
)
{
$
(
"#searchIpt"
).
val
(
'全部商品'
);
}
}
else
{
$
(
'#selectTwo'
).
show
();
$
(
'#selectThree'
).
show
();
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
();
$
(
'#dataList'
).
empty
();
}
if
(
typeOne
==
3
)
{
$
(
'.playMethod'
).
show
()
}
else
{
$
(
'.playMethod'
).
hide
()
}
});
$
(
"input[name=typeTwo]"
).
change
(
function
(
e
){
typeTwo
=
e
.
target
.
value
;
if
(
typeTwo
==
1
)
{
$
(
'#iptModal'
).
show
();
$
(
'.sendType'
).
show
();
$
(
'#exchangeTime'
).
val
(
''
)
$
(
'#exchange'
).
hide
();
if
(
sendType
==
2
)
{
$
(
'.phoneNumber'
).
show
();
}
}
else
{
$
(
'#iptModal'
).
hide
();
$
(
'#exchange'
).
show
();
$
(
'.sendType'
).
hide
();
$
(
'.phoneNumber'
).
hide
();
$
(
'.test1'
).
val
(
''
);
$
(
'.phoneNum'
).
val
(
''
);
$
(
'.test1'
).
hide
();
}
});
$
(
"input[name=sendType]"
).
change
(
function
(
e
){
sendType
=
e
.
target
.
value
;
if
(
e
.
target
.
value
==
2
)
{
$
(
'.phoneNumber'
).
show
();
$
(
'.test1'
).
show
();
}
else
{
$
(
'.phoneNumber'
).
hide
();
$
(
'.test1'
).
val
(
''
);
$
(
'.test1'
).
hide
();
}
});
$
(
"input[name=sex]"
).
change
(
function
(
e
){
sendTimeType
=
e
.
target
.
value
;
if
(
sendTimeType
==
2
)
{
$
(
'#test1'
).
show
();
}
else
{
$
(
'#test1'
).
val
(
''
)
$
(
'#test1'
).
hide
();
}
});
$
(
"input[name=playMethod]"
).
change
(
function
(
e
){
playMethod
=
e
.
target
.
value
;
});
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
//执行一个laydate实例
laydate
.
render
({
elem
:
'#test1'
,
//指定元素
type
:
'datetime'
});
});
});
function
submitHandler
()
{
var
chrtype
=
[[
$
{
#
strings
.
defaultString
(@
config
.
getKey
(
'sys.account.chrtype'
),
0
)}]];
function
create
()
{
var
password
=
$
(
"#password"
).
val
();
if
(
!
$
(
'#valFace'
).
val
()
||
!
$
(
'#title'
).
val
()
||
!
$
(
'#num'
).
val
()
||
!
$
(
'#ticketTime'
).
val
())
{
if
(
$
.
validate
.
form
()
&&
checkpwd
(
chrtype
,
password
))
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
var
data
=
$
(
"#form-user-add"
).
serializeArray
();
if
(
typeTwo
!=
1
)
{
var
status
=
$
(
"input[id='status']"
).
is
(
':checked'
)
==
true
?
0
:
1
;
if
(
!
$
(
'#exchangeTime'
).
val
())
{
var
roleIds
=
$
.
form
.
selectCheckeds
(
"role"
);
return
layer
.
msg
(
'请将必填项输入完整~!'
);
var
postIds
=
$
.
form
.
selectSelects
(
"post"
);
}
data
.
push
({
"name"
:
"status"
,
"value"
:
status
});
}
data
.
push
({
"name"
:
"roleIds"
,
"value"
:
roleIds
});
}
data
.
push
({
"name"
:
"postIds"
,
"value"
:
postIds
});
let
useScope
=
100
;
$
.
operate
.
saveTab
(
prefix
+
"/add"
,
data
);
let
busiName
=
$
(
'#searchIpt'
).
val
();
}
let
busiId
=
''
;
}
if
(
!
$
(
'#searchIpt'
).
val
())
{
showId
=
''
;
/* 用户管理-新增-选择部门树 */
}
function
selectDeptTree
()
{
if
(
showId
)
{
var
treeId
=
$
(
"#treeId"
).
val
();
useScope
=
90
;
var
deptId
=
$
.
common
.
isEmpty
(
treeId
)
?
"100"
:
$
(
"#treeId"
).
val
();
busiId
=
showId
;
var
url
=
ctx
+
"system/dept/selectDeptTree/"
+
deptId
;
}
var
options
=
{
if
(
selectTwoId
)
{
title
:
'选择部门'
,
useScope
=
91
;
width
:
"380"
,
busiId
=
selectTwoId
;
url
:
url
,
// busiName = selectTwoName;
callBack
:
doSubmit
}
};
if
(
selectThreeId
)
{
$
.
modal
.
openOptions
(
options
);
useScope
=
92
;
}
busiId
=
selectThreeId
;
// busiName = selectThreeName;
function
doSubmit
(
index
,
layero
){
}
var
tree
=
layero
.
find
(
"iframe"
)[
0
].
contentWindow
.
$
.
_tree
;
if
(
typeOne
==
2
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
if
(
showId
)
{
$
(
"#treeId"
).
val
(
body
.
find
(
'#treeId'
).
val
());
useScope
=
80
;
$
(
"#treeName"
).
val
(
body
.
find
(
'#treeName'
).
val
());
busiId
=
showId
;
layer
.
close
(
index
);
}
}
busiName
=
$
(
"#searchIpt"
).
val
();
}
$
(
function
()
{
if
(
typeOne
==
3
)
{
$
(
'#post'
).
select2
({
if
(
showId
)
{
placeholder
:
"请选择岗位"
,
useScope
=
90
;
allowClear
:
true
busiId
=
showId
;
});
}
busiName
=
$
(
"#searchIpt"
).
val
();
}
console
.
log
(
showId
,
busiId
,
'showId'
)
let
data
=
{
"bindType"
:
Number
(
typeTwo
),
// 兑换券/发放
"busiType"
:
Number
(
typeOne
),
// 业务类别
"couType"
:
1
,
// 券类型
"couponRuleList"
:
[
// 适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式]
{
"useScope"
:
useScope
,
"busiName"
:
busiName
||
'全部演出'
,
"busiId"
:
busiId
}
],
"discount"
:
''
,
// 折扣券需传
"eventAmt"
:
Number
(
$
(
'#num'
).
val
()),
// 数量
"eventAt"
:
$
(
'#test1'
).
val
()
||
$
.
common
.
dateFormat
(
new
Date
(),
'yyyy-MM-dd HH:mm:ss'
),
"eventLimit"
:
$
(
'#phoneNum'
).
val
(),
// 手机号
"eventType"
:
Number
(
sendType
),
"label"
:
"标注"
,
// 不需管
"notice"
:
$
(
'#describeTxt'
).
val
(),
"overlay"
:
playMethod
,
// 优先购ticketTime
"redeemValidity"
:
Number
(
$
(
'#exchangeTime'
).
val
()),
// 兑换有效期
"title"
:
$
(
'#title'
).
val
(),
"valFace"
:
$
(
'#valFace'
).
val
(),
// 金额
"validity"
:
Number
(
$
(
'#ticketTime'
).
val
()),
}
if
(
typeTwo
==
1
)
{
delete
data
.
redeemValidity
}
else
{
delete
data
.
eventType
}
if
(
typeOne
==
0
||
typeOne
==
1
||
typeOne
==
2
)
{
delete
data
.
discount
;
delete
data
.
overlay
;
}
if
(
sendType
!=
2
)
{
delete
data
.
eventLimit
;
}
console
.
log
(
data
,
'data'
)
promiseMethods
(
'/candy/coupon/mgt/add'
,
'post'
,
JSON
.
stringify
(
data
),
'application/json'
).
then
(
res
=>
{
console
.
log
(
res
)
})
})
</script>
}
</body>
function
promiseMethods
(
url
,
type
,
data
,
contentType
)
{
</html>
return
new
Promise
((
resolve
,
reject
)
=>
{
\ No newline at end of file
$
.
ajax
({
url
,
type
,
data
,
contentType
,
success
:
function
(
res
)
{
resolve
(
res
)
}
})
})
}
</script>
</html>
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add2.html
View file @
d5501151
add1.html
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<head>
<th:block
th:include=
"include :: header('新增满减券')"
/>
<th:block
th:include=
"include :: header('新增满减券')"
/>
<th:block
th:include=
"include :: select2-css"
/>
<th:block
th:include=
"include :: select2-css"
/>
<link
rel=
"stylesheet"
href=
""
>
<style>
.layui-form
{
padding
:
20px
;
}
.main_title
,
.main_type
,
.money
,
.scope_application
,
.sendType
,
.phoneNumber
,
.playMethod
{
margin-bottom
:
20px
;
}
.scope_application
,
.sendType
,
.phoneNumber
,
#test1
,
.playMethod
{
display
:
none
;
}
#test1
{
display
:
none
;
}
.labelName
{
display
:
inline-block
;
width
:
100px
;
text-align
:
right
;
}
input
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
padding-left
:
5px
;
height
:
30px
;
}
.main_title
input
{
width
:
200px
;
}
.prompt
{
margin-left
:
100px
!important
;
}
.main_type
input
,
.sendType
input
,
.playMethod
input
{
margin-top
:
-2px
;
margin-right
:
5px
;
}
.main_type
span
,
.sendType
span
,
.playMethod
span
{
margin-right
:
12px
;
line-height
:
28px
;
}
.layui-form
.money
input
{
width
:
60px
;
}
.changeData
.dataOne
{
margin-bottom
:
20px
;
}
.changeData
.dataOne
p
{
margin
:
12px
0
0
20px
;
color
:
#ccc
;
}
.changeData
.dataOne
input
{
width
:
60px
;
}
.main_bottom
.describe
,
.main_bottom
.sendTime
{
margin-bottom
:
20px
;
}
.describe
,
.main_type
{
display
:
flex
;
}
.describe
textarea
,
.phoneNumber
textarea
{
width
:
400px
;
}
.sendTime
{
display
:
flex
;
}
.sendTime
input
{
margin-top
:
-6px
;
margin-right
:
5px
;
}
.bottom_btn
{
width
:
25%
;
text-align
:
center
;
}
select
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
height
:
30px
;
width
:
200px
;
}
.search_ipt
ul
,
.search_ipt
li
{
padding
:
0
;
margin
:
0
;
font-style
:
normal
;
list-style
:
none
;
}
.search_ipt
ul
{
display
:
none
;
position
:
absolute
;
left
:
0
;
top
:
26px
;
padding
:
5px
0
;
z-index
:
899
;
min-width
:
200px
;
border
:
1px
solid
#eee
;
max-height
:
300px
;
overflow-y
:
auto
;
background-color
:
#fff
;
border-radius
:
2px
;
box-sizing
:
border-box
;
box-shadow
:
1px
1px
4px
rgb
(
0
0
0
/
8%
);
}
.search_ipt
li
{
background-color
:
#fff
;
cursor
:
pointer
;
padding-left
:
10px
!important
;
color
:
#999
;
padding
:
0
10px
;
line-height
:
36px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.search_ipt
li
:hover
{
background
:
#F6F6F6
;
}
.search_ipt
.layui-input
{
width
:
200px
;
}
#test1
{
display
:
none
;
}
.required
{
font-style
:
normal
;
color
:
red
;
}
#iptModal
{
display
:
none
;
}
#valOver
,
#valMinus
{
margin
:
0
12px
;
}
</style>
</head>
</head>
<body>
<body>
<div
class=
"main-content"
>
<form
id=
"form-user-add"
class=
"layui-form"
>
<form
id=
"form-user-add"
class=
"form-horizontal"
>
<div
class=
"main_title"
>
<input
name=
"deptId"
type=
"hidden"
id=
"treeId"
/>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
名称:
</span><input
type=
"text"
id=
"title"
name=
"keyword"
placeholder=
"券名称"
/>
<h4
class=
"form-header h4"
>
基本信息
</h4>
</div>
<div
class=
"row"
>
<div
class=
"main_type"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
>
类别:
</span>
<div
class=
"form-group"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<label
class=
"col-sm-4 control-label is-required"
>
用户名称:
</label>
<input
type=
"radio"
value=
"0"
class=
"typeOne"
name=
"typeOne"
checked
><span>
全场
</span>
<div
class=
"col-sm-8"
>
<input
type=
"radio"
value=
"1"
class=
"typeOne"
name=
"typeOne"
><span>
演出
</span>
<input
name=
"userName"
placeholder=
"请输入用户名称"
class=
"form-control"
type=
"text"
maxlength=
"30"
required
>
<input
type=
"radio"
value=
"2"
class=
"typeOne"
name=
"typeOne"
><span>
商品
</span>
</div>
<input
type=
"radio"
value=
"3"
class=
"typeOne"
name=
"typeOne"
><span>
优先购
</span>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
</div>
<div
class=
"form-group"
>
<div
class=
"money"
>
<label
class=
"col-sm-4 control-label"
>
归属部门:
</label>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
金额:
</span>
满
<input
type=
"text"
id=
"valOver"
/>
减
<input
type=
"text"
id=
"valMinus"
/>
<div
class=
"col-sm-8"
>
</div>
<div
class=
"input-group"
>
<div
class=
"main_type"
>
<input
name=
"deptName"
onclick=
"selectDeptTree()"
id=
"treeName"
type=
"text"
placeholder=
"请选择归属部门"
class=
"form-control"
>
<span
class=
"labelName"
>
类型:
</span>
<span
class=
"input-group-addon"
><i
class=
"fa fa-search"
></i></span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
</div>
<input
type=
"radio"
value=
"0"
class=
"typeTwo"
name=
"typeTwo"
checked
><span>
用户输入兑换
</span>
</div>
<input
type=
"radio"
value=
"1"
class=
"typeTwo"
name=
"typeTwo"
><span>
发送至“我的券”
</span>
</div>
</div>
</div>
</div>
<div
class=
"scope_application"
id=
"scope_application"
>
<span
class=
"labelName"
>
适用范围:
</span>
<div
class=
"search_ipt"
style=
"position: relative;display: inline;"
>
<input
type=
"text"
id=
"searchIpt"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"全部"
>
<ul
id=
"dataList"
style=
"position: absolute;"
></ul>
</div>
<select
name=
"bindType"
id=
"selectTwo"
>
<option
value=
""
>
所有
</option>
</select>
<select
name=
"bindType"
id=
"selectThree"
>
<option
value=
""
>
所有
</option>
</select>
</div>
<div
class=
"changeData"
>
<div
id=
"modalOne"
>
<div
class=
"dataOne"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
数量:
</span>
<input
type=
"text"
id=
"num"
required
/>
张
</div>
</div>
<div
class=
"row"
>
<div
class=
"dataOne"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
券的有效期:
</span>
<div
class=
"form-group"
>
<input
type=
"text"
id=
"ticketTime"
required
/>
<label
class=
"col-sm-4 control-label"
>
手机号码:
</label>
天
<div
class=
"col-sm-8"
>
<p
class=
"prompt"
>
*可兑换的时间
</p>
<div
class=
"input-group"
>
<input
id=
"phonenumber"
name=
"phonenumber"
placeholder=
"请输入手机号码"
class=
"form-control"
type=
"text"
maxlength=
"11"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-mobile"
></i></span>
</div>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
邮箱:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"email"
name=
"email"
class=
"form-control email"
type=
"text"
maxlength=
"50"
placeholder=
"请输入邮箱"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-envelope"
></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"dataOne"
id=
"exchange"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
兑换有效期:
</span>
<div
class=
"form-group"
>
<input
type=
"text"
id=
"exchangeTime"
required
/>
<label
class=
"col-sm-4 control-label is-required"
>
登录账号:
</label>
天
<div
class=
"col-sm-8"
>
<p
class=
"prompt"
>
*兑换后的有效时间
</p>
<input
id=
"loginName"
name=
"loginName"
placeholder=
"请输入登录账号"
class=
"form-control"
type=
"text"
maxlength=
"30"
required
>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label is-required"
>
登录密码:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"password"
name=
"password"
placeholder=
"请输入登录密码"
class=
"form-control"
type=
"password"
th:value=
"${@config.getKey('sys.user.initPassword')}"
required
>
<span
class=
"input-group-addon"
title=
"登录密码,鼠标按下显示密码"
onmousedown=
"$('#password').attr('type','text')"
onmouseup=
"$('#password').attr('type','password')"
><i
class=
"fa fa-key"
></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
</div>
<div
class=
"col-sm-6"
>
</div>
<div
class=
"form-group"
>
<div
class=
"sendType"
>
<label
class=
"col-sm-4 control-label"
>
用户性别:
</label>
<div
style=
"display: flex;align-items: center;"
>
<div
class=
"col-sm-8"
>
<span
class=
"labelName"
>
发送类型:
</span>
<select
name=
"sex"
class=
"form-control m-b"
th:with=
"type=${@dict.getType('sys_user_sex')}"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<option
th:each=
"dict : ${type}"
th:text=
"${dict.dictLabel}"
th:value=
"${dict.dictValue}"
></option>
<input
type=
"radio"
value=
"10"
class=
"sendType"
name=
"sendType"
checked
><span>
全体用户
</span>
</select>
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
><span>
会员
</span>
</div>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
用户状态:
</label>
<div
class=
"col-sm-8"
>
<label
class=
"toggle-switch switch-solid"
>
<input
type=
"checkbox"
id=
"status"
checked
>
<span></span>
</label>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"form-group"
>
<label
class=
"col-xs-2 control-label"
>
岗位:
</label>
<div
class=
"col-xs-4"
>
<select
id=
"post"
class=
"form-control select2-multiple"
multiple
>
<option
th:each=
"post:${posts}"
th:value=
"${post.postId}"
th:text=
"${post.postName}"
th:disabled=
"${post.status == '1'}"
></option>
</select>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
</div>
<div
class=
"col-sm-12"
>
</div>
<div
class=
"form-group"
>
<div
class=
"phoneNumber"
>
<label
class=
"col-xs-2 control-label"
>
角色:
</label>
<span
style=
"display:inline-block;margin-bottom: 12px;"
><i
class=
"required"
>
*
</i>
请输入手机号
<span
style=
"color: #ccc"
>
(手机号可填多个,使用","隔开)
</span>
:
</span>
<div
class=
"col-xs-10"
>
<textarea
id=
"phoneNum"
class=
"form-control"
rows=
"4"
style=
"margin-left: 100px"
></textarea>
<label
th:each=
"role:${roles}"
class=
"check-box"
>
</div>
<input
name=
"role"
type=
"checkbox"
th:value=
"${role.roleId}"
th:text=
"${role.roleName}"
th:disabled=
"${role.status == '1'}"
>
<div
class=
"main_bottom"
>
</label>
<div
class=
"describe"
>
</div>
<span
class=
"labelName"
>
</div>
描述说明:
</span>
<textarea
id=
"describeTxt"
class=
"form-control"
rows=
"4"
></textarea>
</div>
<div
class=
"playMethod"
>
<div
style=
"display: flex;align-items: center;"
>
<span
class=
"labelName"
>
使用限制:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<input
type=
"radio"
value=
"1"
class=
"playMethod"
name=
"playMethod"
checked
><span>
叠加
</span>
<input
type=
"radio"
value=
"0"
class=
"playMethod"
name=
"playMethod"
><span>
限制
</span>
</div>
</div>
</div>
</div>
<h4
class=
"form-header h4"
>
其他信息
</h4>
</div>
<div
class=
"row"
>
<div
class=
"sendTime"
>
<div
class=
"col-sm-12"
>
<span
class=
"labelName"
>
发送时间:
</span>
<div
class=
"form-group"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<label
class=
"col-xs-2 control-label"
>
备注:
</label>
<input
type=
"radio"
name=
"sex"
value=
"1"
title=
"立即"
checked
><span>
立即
</span>
<div
class=
"col-xs-10"
>
<span
style=
"margin-right:12px;"
id=
"iptModal"
><p
style=
"display:flex"
><input
type=
"radio"
name=
"sex"
value=
"2"
title=
"预约"
style=
"margin-left: 12px;"
>
预约
</p></span>
<textarea
name=
"remark"
maxlength=
"500"
class=
"form-control"
rows=
"3"
></textarea>
</div>
</div>
</div>
</div>
</div>
</form>
<input
type=
"text"
class=
"layui-input"
id=
"test1"
placeholder=
"请选择时间"
>
</div>
</div>
<div
class=
"bottom_btn"
>
<div
class=
"row"
>
<!-- <button type="button" class="layui-btn btn btn-primary" lay-filter="formDemo" onclick="create()">创建代金券</button> -->
<div
class=
"col-sm-offset-5 col-sm-10"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
创建满减券
</button>
<button
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"submitHandler()"
><i
class=
"fa fa-check"
></i>
保 存
</button>
<button
type=
"button"
class=
"btn btn-sm btn-danger"
onclick=
"closeItem()"
><i
class=
"fa fa-reply-all"
></i>
关 闭
</button>
</div>
</div>
</div>
</div>
<th:block
th:include=
"include :: footer"
/>
</form>
<th:block
th:include=
"include :: select2-js"
/>
<th:block
th:include=
"include :: footer"
/>
<script>
<th:block
th:include=
"include :: select2-js"
/>
var
prefix
=
ctx
+
"system/user"
;
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
</body>
$
(
"#form-user-add"
).
validate
({
<script>
onkeyup
:
false
,
var
roadShowId
=
'[[${roadShowId}]]'
.
replaceAll
(
"
\"
"
,
""
);
rules
:{
let
prefix
=
ctx
;
loginName
:{
let
typeOne
=
'0'
;
// 类别
minlength
:
2
,
let
typeTwo
=
'0'
;
// 类型
maxlength
:
20
,
let
sendType
=
'10'
;
// 发送类型
remote
:
{
let
searchVal
=
''
;
// 输入框内数据
url
:
prefix
+
"/checkLoginNameUnique"
,
let
searchData
=
[];
// 搜索总数据
type
:
"post"
,
let
showId
=
''
;
// 选中演出id
dataType
:
"json"
,
let
selectTwoId
=
''
;
// 选中演出下级的ID
data
:
{
let
selectTwoName
=
''
;
// 选中演出下级的名称
"loginName"
:
function
()
{
let
selectThreeId
=
''
;
// 选中演出三级的ID
return
$
.
common
.
trim
(
$
(
"#loginName"
).
val
());
let
selectThreeName
=
''
;
// 选中演出三级的名称
}
let
sendTimeType
=
''
;
},
let
playMethod
=
'1'
;
// 叠加/限制
dataFilter
:
function
(
data
,
type
)
{
function
search
()
{
return
$
.
validate
.
unique
(
data
);
let
data
=
{
}
status
:
'(3,6)'
,
}
title
:
searchVal
},
}
password
:{
let
str
=
''
;
minlength
:
5
,
promiseMethods
(
ctx
+
'kylin/base/performance/status'
,
'get'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
maxlength
:
20
if
(
res
.
value
.
length
>
0
)
{
},
searchData
=
res
.
value
;
email
:{
searchData
.
forEach
((
item
,
index
)
=>
{
email
:
true
,
str
+=
`<li class="selectData" onclick="selectOne('
${
item
.
performancesId
}
','
${
item
.
title
}
')">
${
item
.
title
}
</li>`
remote
:
{
})
url
:
prefix
+
"/checkEmailUnique"
,
$
(
'#dataList'
).
html
(
str
);
type
:
"post"
,
}
else
{
dataType
:
"json"
,
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
data
:
{
}
"email"
:
function
()
{
})
return
$
.
common
.
trim
(
$
(
"#email"
).
val
());
};
}
function
getMallList
()
{
},
let
data
=
{
dataFilter
:
function
(
data
,
type
)
{
title
:
''
return
$
.
validate
.
unique
(
data
);
}
}
let
str
=
''
;
}
promiseMethods
(
'http://testmall.zhengzai.tv/admin/goodListForQuick'
,
'get'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
},
if
(
res
.
data
.
length
>
0
)
{
phonenumber
:{
searchData
=
res
.
data
;
isPhone
:
true
,
searchData
.
forEach
((
item
,
index
)
=>
{
remote
:
{
str
+=
`<li class="selectData" onclick="selectOne('
${
item
.
id
}
','
${
item
.
title
}
')">
${
item
.
title
}
</li>`
url
:
prefix
+
"/checkPhoneUnique"
,
})
type
:
"post"
,
$
(
'#dataList'
).
html
(
str
);
dataType
:
"json"
,
}
else
{
data
:
{
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
"phonenumber"
:
function
()
{
}
return
$
.
common
.
trim
(
$
(
"#phonenumber"
).
val
());
})
}
// $.ajax({
},
// type:'get',
dataFilter
:
function
(
data
,
type
)
{
// url:'http://testmall.zhengzai.tv/admin/goodListForQuick',
return
$
.
validate
.
unique
(
data
);
// success:function(e){
}
// console.log(e)
}
// }
},
// });
},
};
messages
:
{
function
selectOne
(
id
,
name
)
{
"loginName"
:
{
$
(
"#searchIpt"
).
val
(
name
);
remote
:
"用户已经存在"
showId
=
id
;
},
if
(
typeOne
==
2
)
{
"email"
:
{
return
remote
:
"Email已经存在"
}
},
let
str
=
`<option value="0" label="">所有</option>`
;
"phonenumber"
:{
searchData
.
forEach
(
item
=>
{
remote
:
"手机号码已经存在"
if
(
item
.
performancesId
==
id
)
{
}
str
+=
`<option value='
${
item
.
timeId
}
' label=
${
item
.
timeTitle
}
>
${
item
.
timeTitle
}
</option>`
},
}
focusCleanup
:
true
})
selectTwoId
=
''
;
// 选中演出下级的ID
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#selectTwo'
).
empty
().
append
(
str
);
$
(
'#selectThree'
).
empty
();
};
$
(
"#searchIpt"
).
focus
(
function
(){
if
(
typeOne
==
2
)
{
getMallList
()
}
else
{
console
.
log
(
'search'
)
search
()
}
$
(
'#dataList'
).
show
()
});
$
(
"#searchIpt"
).
blur
(
function
(){
setTimeout
(()
=>
{
$
(
'#dataList'
).
hide
()
},
500
);
});
$
(
"#searchIpt"
).
keyup
(
function
(){
searchVal
=
$
(
"#searchIpt"
).
val
()
search
()
});
$
(
'#selectTwo'
).
change
(
function
(
e
){
selectTwoId
=
$
(
this
).
val
();
console
.
log
(
selectTwoId
,
'kankna'
)
selectTwoName
=
$
(
'#selectTwo'
).
find
(
'option:selected'
).
attr
(
'label'
);
let
str
=
`<option value="0" label="" >所有</option>`
;
searchData
.
forEach
(
item
=>
{
if
(
item
.
timeId
==
selectTwoId
)
{
str
+=
`<option value='
${
item
.
ticketId
}
' label=
${
item
.
ticketTitle
}
>
${
item
.
ticketTitle
}
</option>`
}
})
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#selectThree'
).
empty
().
append
(
str
);
});
$
(
'#selectThree'
).
change
(
function
(
e
){
selectThreeId
=
$
(
this
).
val
();
selectThreeName
=
$
(
'#selectThree'
).
find
(
'option:selected'
).
attr
(
'label'
);
});
$
(
"input[name=typeOne]"
).
change
(
function
(
e
){
typeOne
=
e
.
target
.
value
;
if
(
typeOne
!=
0
)
{
showId
=
''
;
// 选中演出id
selectTwoId
=
''
;
// 选中演出下级的ID
selectThreeId
=
''
;
// 选中演出三级的ID
$
(
'#scope_application'
).
show
();
}
else
{
$
(
'#searchIpt'
).
val
(
''
);
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
(
''
);
$
(
'#scope_application'
).
hide
();
}
if
(
typeOne
==
2
||
typeOne
==
3
)
{
showId
=
''
;
$
(
'#selectTwo'
).
val
(
''
);
$
(
'#selectThree'
).
val
(
''
);
$
(
'#selectTwo'
).
hide
();
$
(
'#selectThree'
).
hide
();
$
(
'#searchIpt'
).
val
(
''
);
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
();
$
(
'#dataList'
).
empty
();
if
(
typeOne
==
2
)
{
$
(
"#searchIpt"
).
val
(
'全部商品'
);
}
}
else
{
$
(
'#selectTwo'
).
show
();
$
(
'#selectThree'
).
show
();
$
(
'#selectTwo'
).
empty
();
$
(
'#selectThree'
).
empty
();
$
(
'#dataList'
).
empty
();
}
if
(
typeOne
==
3
)
{
$
(
'.playMethod'
).
show
()
}
else
{
$
(
'.playMethod'
).
hide
()
}
});
$
(
"input[name=typeTwo]"
).
change
(
function
(
e
){
typeTwo
=
e
.
target
.
value
;
if
(
typeTwo
==
1
)
{
$
(
'#iptModal'
).
show
();
$
(
'.sendType'
).
show
();
$
(
'#exchangeTime'
).
val
(
''
)
$
(
'#exchange'
).
hide
();
if
(
sendType
==
2
)
{
$
(
'.phoneNumber'
).
show
();
}
}
else
{
$
(
'#iptModal'
).
hide
();
$
(
'#exchange'
).
show
();
$
(
'.sendType'
).
hide
();
$
(
'.phoneNumber'
).
hide
();
$
(
'.test1'
).
val
(
''
);
$
(
'.phoneNum'
).
val
(
''
);
$
(
'.test1'
).
hide
();
}
});
$
(
"input[name=sendType]"
).
change
(
function
(
e
){
sendType
=
e
.
target
.
value
;
if
(
e
.
target
.
value
==
2
)
{
$
(
'.phoneNumber'
).
show
();
$
(
'.test1'
).
show
();
}
else
{
$
(
'.phoneNumber'
).
hide
();
$
(
'.test1'
).
val
(
''
);
$
(
'.test1'
).
hide
();
}
});
$
(
"input[name=sex]"
).
change
(
function
(
e
){
sendTimeType
=
e
.
target
.
value
;
if
(
sendTimeType
==
2
)
{
$
(
'#test1'
).
show
();
}
else
{
$
(
'#test1'
).
val
(
''
)
$
(
'#test1'
).
hide
();
}
});
$
(
"input[name=playMethod]"
).
change
(
function
(
e
){
playMethod
=
e
.
target
.
value
;
});
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
//执行一个laydate实例
laydate
.
render
({
elem
:
'#test1'
,
//指定元素
type
:
'datetime'
});
});
});
function
create
()
{
if
(
!
$
(
'#title'
).
val
()
||
!
$
(
'#num'
).
val
()
||
!
$
(
'#ticketTime'
).
val
()
||
!
$
(
'#valOver'
).
val
()
||
!
$
(
'#valMinus'
).
val
())
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
if
(
typeTwo
!=
1
)
{
if
(
!
$
(
'#exchangeTime'
).
val
())
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
}
}
}
let
useScope
=
100
;
let
busiName
=
$
(
'#searchIpt'
).
val
();
let
busiId
=
''
;
if
(
!
$
(
'#searchIpt'
).
val
())
{
showId
=
''
;
}
if
(
showId
)
{
useScope
=
90
;
busiId
=
showId
;
}
if
(
selectTwoId
)
{
useScope
=
91
;
busiId
=
selectTwoId
;
// busiName = selectTwoName;
}
if
(
selectThreeId
)
{
useScope
=
92
;
busiId
=
selectThreeId
;
// busiName = selectThreeName;
}
if
(
typeOne
==
2
)
{
if
(
showId
)
{
useScope
=
80
;
busiId
=
showId
;
}
busiName
=
$
(
"#searchIpt"
).
val
();
}
if
(
typeOne
==
3
)
{
if
(
showId
)
{
useScope
=
90
;
busiId
=
showId
;
}
busiName
=
$
(
"#searchIpt"
).
val
();
}
function
submitHandler
()
{
let
data
=
{
var
chrtype
=
[[
$
{
#
strings
.
defaultString
(@
config
.
getKey
(
'sys.account.chrtype'
),
0
)}]];
"bindType"
:
Number
(
typeTwo
),
// 兑换券/发放
var
password
=
$
(
"#password"
).
val
();
"busiType"
:
Number
(
typeOne
),
// 业务类别
if
(
$
.
validate
.
form
()
&&
checkpwd
(
chrtype
,
password
))
{
"couType"
:
2
,
// 券类型
var
data
=
$
(
"#form-user-add"
).
serializeArray
();
"couponRuleList"
:
[
// 适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式]
var
status
=
$
(
"input[id='status']"
).
is
(
':checked'
)
==
true
?
0
:
1
;
{
var
roleIds
=
$
.
form
.
selectCheckeds
(
"role"
);
"useScope"
:
useScope
,
var
postIds
=
$
.
form
.
selectSelects
(
"post"
);
"busiName"
:
busiName
||
'全部演出'
,
data
.
push
({
"name"
:
"status"
,
"value"
:
status
});
"busiId"
:
busiId
data
.
push
({
"name"
:
"roleIds"
,
"value"
:
roleIds
});
}
data
.
push
({
"name"
:
"postIds"
,
"value"
:
postIds
});
],
$
.
operate
.
saveTab
(
prefix
+
"/add"
,
data
);
"discount"
:
''
,
// 折扣券需传
}
"eventAmt"
:
Number
(
$
(
'#num'
).
val
()),
// 数量
}
"eventAt"
:
$
(
'#test1'
).
val
()
||
$
.
common
.
dateFormat
(
new
Date
(),
'yyyy-MM-dd HH:mm:ss'
),
"eventLimit"
:
$
(
'#phoneNum'
).
val
(),
// 手机号
/* 用户管理-新增-选择部门树 */
"eventType"
:
Number
(
sendType
),
function
selectDeptTree
()
{
"label"
:
"标注"
,
// 不需管
var
treeId
=
$
(
"#treeId"
).
val
();
"notice"
:
$
(
'#describeTxt'
).
val
(),
var
deptId
=
$
.
common
.
isEmpty
(
treeId
)
?
"100"
:
$
(
"#treeId"
).
val
();
"overlay"
:
playMethod
,
// 优先购ticketTime
var
url
=
ctx
+
"system/dept/selectDeptTree/"
+
deptId
;
"redeemValidity"
:
Number
(
$
(
'#exchangeTime'
).
val
()),
// 兑换有效期
var
options
=
{
"title"
:
$
(
'#title'
).
val
(),
title
:
'选择部门'
,
"valOver"
:
$
(
'#valOver'
).
val
(),
width
:
"380"
,
"valMinus"
:
$
(
'#valMinus'
).
val
(),
url
:
url
,
// "valFace": $('#valFace').val(), // 金额
callBack
:
doSubmit
"validity"
:
Number
(
$
(
'#ticketTime'
).
val
()),
};
}
$
.
modal
.
openOptions
(
options
);
if
(
typeTwo
==
1
)
{
}
delete
data
.
redeemValidity
}
else
{
function
doSubmit
(
index
,
layero
){
delete
data
.
eventType
var
tree
=
layero
.
find
(
"iframe"
)[
0
].
contentWindow
.
$
.
_tree
;
}
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
if
(
typeOne
==
0
||
typeOne
==
1
||
typeOne
==
2
)
{
$
(
"#treeId"
).
val
(
body
.
find
(
'#treeId'
).
val
());
delete
data
.
discount
;
$
(
"#treeName"
).
val
(
body
.
find
(
'#treeName'
).
val
());
delete
data
.
overlay
;
layer
.
close
(
index
);
}
}
if
(
sendType
!=
2
)
{
delete
data
.
eventLimit
;
$
(
function
()
{
}
$
(
'#post'
).
select2
({
console
.
log
(
data
,
'data'
)
placeholder
:
"请选择岗位"
,
promiseMethods
(
'/candy/coupon/mgt/add'
,
'post'
,
JSON
.
stringify
(
data
),
'application/json'
).
then
(
res
=>
{
allowClear
:
true
console
.
log
(
res
)
});
})
})
</script>
}
</body>
function
promiseMethods
(
url
,
type
,
data
,
contentType
)
{
</html>
return
new
Promise
((
resolve
,
reject
)
=>
{
\ No newline at end of file
$
.
ajax
({
url
,
type
,
data
,
contentType
,
success
:
function
(
res
)
{
resolve
(
res
)
}
})
})
}
</script>
</html>
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add3.html
View file @
d5501151
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<head>
<th:block
th:include=
"include :: header('新增兑换券')"
/>
<th:block
th:include=
"include :: header('新增兑换券')"
/>
<th:block
th:include=
"include :: select2-css"
/>
<th:block
th:include=
"include :: select2-css"
/>
<link
rel=
"stylesheet"
href=
""
>
<style>
.layui-form
{
padding
:
20px
;
}
.main_title
,
.main_type
,
.money
,
.scope_application
,
.phoneNumber
,
.playMethod
{
margin-bottom
:
20px
;
}
.phoneNumber
,
#test1
,
.playMethod
{
display
:
none
;
}
#test1
{
display
:
none
;
}
.labelName
{
display
:
inline-block
;
width
:
100px
;
text-align
:
right
;
}
input
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
padding-left
:
5px
;
height
:
30px
;
}
.main_title
input
{
width
:
200px
;
}
.prompt
{
margin-left
:
100px
!important
;
}
.main_type
input
,
.playMethod
input
{
margin-top
:
-2px
;
margin-right
:
5px
;
}
.main_type
span
,
.playMethod
span
{
margin-right
:
12px
;
line-height
:
28px
;
}
.layui-form
.money
input
{
width
:
60px
;
}
.changeData
.dataOne
{
margin-bottom
:
20px
;
}
.changeData
.dataOne
p
{
margin
:
12px
0
0
20px
;
color
:
#ccc
;
}
.changeData
.dataOne
input
{
width
:
60px
;
}
.main_bottom
.describe
,
.main_bottom
.sendTime
{
margin-bottom
:
20px
;
}
.describe
,
.main_type
{
display
:
flex
;
}
.describe
textarea
,
.phoneNumber
textarea
{
width
:
400px
;
}
.sendTime
{
display
:
flex
;
}
.sendTime
input
{
margin-top
:
-6px
;
margin-right
:
5px
;
}
.bottom_btn
{
width
:
25%
;
text-align
:
center
;
}
select
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
height
:
30px
;
width
:
200px
;
}
.search_ipt
ul
,
.search_ipt
li
{
padding
:
0
;
margin
:
0
;
font-style
:
normal
;
list-style
:
none
;
}
.search_ipt
ul
{
display
:
none
;
position
:
absolute
;
left
:
0
;
top
:
26px
;
padding
:
5px
0
;
z-index
:
899
;
min-width
:
200px
;
border
:
1px
solid
#eee
;
max-height
:
300px
;
overflow-y
:
auto
;
background-color
:
#fff
;
border-radius
:
2px
;
box-sizing
:
border-box
;
box-shadow
:
1px
1px
4px
rgb
(
0
0
0
/
8%
);
}
.search_ipt
li
{
background-color
:
#fff
;
cursor
:
pointer
;
padding-left
:
10px
!important
;
color
:
#999
;
padding
:
0
10px
;
line-height
:
36px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.search_ipt
li
:hover
{
background
:
#F6F6F6
;
}
.search_ipt
.layui-input
{
width
:
200px
;
}
#test1
{
display
:
none
;
}
.required
{
font-style
:
normal
;
color
:
red
;
}
#iptModal
{
display
:
none
;
}
#valOver
,
#valMinus
{
margin
:
0
12px
;
}
#showNum
{
display
:
none
;
}
</style>
</head>
</head>
<body>
<body>
<div
class=
"main-content"
>
<form
id=
"form-user-add"
class=
"layui-form"
>
<form
id=
"form-user-add"
class=
"form-horizontal"
>
<div
class=
"main_title"
>
<input
name=
"deptId"
type=
"hidden"
id=
"treeId"
/>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
名称:
</span><input
type=
"text"
id=
"title"
name=
"keyword"
placeholder=
"券名称"
/>
<h4
class=
"form-header h4"
>
基本信息
</h4>
</div>
<div
class=
"row"
>
<div
class=
"scope_application"
id=
"scope_application"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
>
适用范围:
</span>
<div
class=
"form-group"
>
<div
class=
"search_ipt"
style=
"position: relative;display: inline;"
>
<label
class=
"col-sm-4 control-label is-required"
>
用户名称:
</label>
<input
type=
"text"
id=
"searchIpt"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"全部"
>
<div
class=
"col-sm-8"
>
<ul
id=
"dataList"
style=
"position: absolute;"
></ul>
<input
name=
"userName"
placeholder=
"请输入用户名称"
class=
"form-control"
type=
"text"
maxlength=
"30"
required
>
</div>
</div>
<select
name=
"bindType"
id=
"selectTwo"
>
</div>
<option
value=
""
>
所有
</option>
</div>
</select>
<div
class=
"col-sm-6"
>
<select
name=
"bindType"
id=
"selectThree"
>
<div
class=
"form-group"
>
<option
value=
""
>
所有
</option>
<label
class=
"col-sm-4 control-label"
>
归属部门:
</label>
</select>
<div
class=
"col-sm-8"
>
<span
style=
"margin-left: 12px;color: #ccc;"
id=
"showNum"
>
<div
class=
"input-group"
>
演出库存:
<span
id=
"totalGeneral"
></span>
<input
name=
"deptName"
onclick=
"selectDeptTree()"
id=
"treeName"
type=
"text"
placeholder=
"请选择归属部门"
class=
"form-control"
>
兑换库存:
<span
id=
"totalExchange"
></span>
<span
class=
"input-group-addon"
><i
class=
"fa fa-search"
></i></span>
</span>
</div>
</div>
</div>
<div
class=
"changeData"
>
</div>
<div
id=
"modalOne"
>
</div>
<div
class=
"dataOne"
>
</div>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
数量:
</span>
<div
class=
"row"
>
<input
type=
"text"
id=
"num"
required
/>
<div
class=
"col-sm-6"
>
张
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
手机号码:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"phonenumber"
name=
"phonenumber"
placeholder=
"请输入手机号码"
class=
"form-control"
type=
"text"
maxlength=
"11"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-mobile"
></i></span>
</div>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
邮箱:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"email"
name=
"email"
class=
"form-control email"
type=
"text"
maxlength=
"50"
placeholder=
"请输入邮箱"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-envelope"
></i></span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label is-required"
>
登录账号:
</label>
<div
class=
"col-sm-8"
>
<input
id=
"loginName"
name=
"loginName"
placeholder=
"请输入登录账号"
class=
"form-control"
type=
"text"
maxlength=
"30"
required
>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label is-required"
>
登录密码:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"password"
name=
"password"
placeholder=
"请输入登录密码"
class=
"form-control"
type=
"password"
th:value=
"${@config.getKey('sys.user.initPassword')}"
required
>
<span
class=
"input-group-addon"
title=
"登录密码,鼠标按下显示密码"
onmousedown=
"$('#password').attr('type','text')"
onmouseup=
"$('#password').attr('type','password')"
><i
class=
"fa fa-key"
></i></span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
用户性别:
</label>
<div
class=
"col-sm-8"
>
<select
name=
"sex"
class=
"form-control m-b"
th:with=
"type=${@dict.getType('sys_user_sex')}"
>
<option
th:each=
"dict : ${type}"
th:text=
"${dict.dictLabel}"
th:value=
"${dict.dictValue}"
></option>
</select>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
用户状态:
</label>
<div
class=
"col-sm-8"
>
<label
class=
"toggle-switch switch-solid"
>
<input
type=
"checkbox"
id=
"status"
checked
>
<span></span>
</label>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"form-group"
>
<label
class=
"col-xs-2 control-label"
>
岗位:
</label>
<div
class=
"col-xs-4"
>
<select
id=
"post"
class=
"form-control select2-multiple"
multiple
>
<option
th:each=
"post:${posts}"
th:value=
"${post.postId}"
th:text=
"${post.postName}"
th:disabled=
"${post.status == '1'}"
></option>
</select>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"form-group"
>
<label
class=
"col-xs-2 control-label"
>
角色:
</label>
<div
class=
"col-xs-10"
>
<label
th:each=
"role:${roles}"
class=
"check-box"
>
<input
name=
"role"
type=
"checkbox"
th:value=
"${role.roleId}"
th:text=
"${role.roleName}"
th:disabled=
"${role.status == '1'}"
>
</label>
</div>
</div>
</div>
</div>
</div>
<h4
class=
"form-header h4"
>
其他信息
</h4>
<div
class=
"dataOne"
>
<div
class=
"row"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
有效期:
</span>
<div
class=
"col-sm-12"
>
<input
type=
"text"
id=
"ticketTime"
required
/>
<div
class=
"form-group"
>
天
<label
class=
"col-xs-2 control-label"
>
备注:
</label>
<p
class=
"prompt"
>
*可兑换的时间
</p>
<div
class=
"col-xs-10"
>
<textarea
name=
"remark"
maxlength=
"500"
class=
"form-control"
rows=
"3"
></textarea>
</div>
</div>
</div>
</div>
</div>
</
form
>
</
div
>
</div>
</div>
<div
class=
"main_bottom"
>
<div
class=
"row"
>
<div
class=
"describe"
>
<div
class=
"col-sm-offset-5 col-sm-10"
>
<span
class=
"labelName"
>
<button
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"submitHandler()"
><i
class=
"fa fa-check"
></i>
保 存
</button>
描述说明:
<button
type=
"button"
class=
"btn btn-sm btn-danger"
onclick=
"closeItem()"
><i
class=
"fa fa-reply-all"
></i>
关 闭
</button>
</span>
<textarea
id=
"describeTxt"
class=
"form-control"
rows=
"4"
></textarea>
</div>
<div
class=
"bottom_btn"
>
<!-- <button type="button" class="layui-btn btn btn-primary" lay-filter="formDemo" onclick="create()">创建代金券</button> -->
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
创建兑换券
</button>
</div>
</div>
</div>
</div>
<th:block
th:include=
"include :: footer"
/>
</form>
<th:block
th:include=
"include :: select2-js"
/>
<th:block
th:include=
"include :: footer"
/>
<script>
<th:block
th:include=
"include :: select2-js"
/>
var
prefix
=
ctx
+
"system/user"
;
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
</body>
$
(
"#form-user-add"
).
validate
({
<script>
onkeyup
:
false
,
var
roadShowId
=
'[[${roadShowId}]]'
.
replaceAll
(
"
\"
"
,
""
);
rules
:{
let
prefix
=
ctx
;
loginName
:{
let
searchVal
=
''
;
// 输入框内数据
minlength
:
2
,
let
searchData
=
[];
// 搜索总数据
maxlength
:
20
,
let
showId
=
''
;
// 选中演出id
remote
:
{
let
selectTwoId
=
''
;
// 选中演出下级的ID
url
:
prefix
+
"/checkLoginNameUnique"
,
let
selectTwoName
=
''
;
// 选中演出下级的名称
type
:
"post"
,
let
selectThreeId
=
''
;
// 选中演出三级的ID
dataType
:
"json"
,
let
selectThreeName
=
''
;
// 选中演出三级的名称
data
:
{
function
search
()
{
"loginName"
:
function
()
{
let
data
=
{
return
$
.
common
.
trim
(
$
(
"#loginName"
).
val
());
status
:
'(3,6)'
,
}
title
:
searchVal
},
}
dataFilter
:
function
(
data
,
type
)
{
let
str
=
''
;
return
$
.
validate
.
unique
(
data
);
promiseMethods
(
ctx
+
'kylin/base/performance/status'
,
'get'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
}
if
(
res
.
value
.
length
>
0
)
{
}
searchData
=
res
.
value
;
},
searchData
.
forEach
((
item
,
index
)
=>
{
password
:{
str
+=
`<li class="selectData" onclick="selectOne('
${
item
.
performancesId
}
','
${
item
.
title
}
')">
${
item
.
title
}
</li>`
minlength
:
5
,
})
maxlength
:
20
$
(
'#dataList'
).
html
(
str
);
},
}
else
{
email
:{
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
email
:
true
,
}
remote
:
{
})
url
:
prefix
+
"/checkEmailUnique"
,
};
type
:
"post"
,
function
selectOne
(
id
,
name
)
{
dataType
:
"json"
,
$
(
"#searchIpt"
).
val
(
name
);
data
:
{
showId
=
id
;
"email"
:
function
()
{
let
str
=
`<option value="0" label="">所有</option>`
;
return
$
.
common
.
trim
(
$
(
"#email"
).
val
());
searchData
.
forEach
(
item
=>
{
}
if
(
item
.
performancesId
==
id
)
{
},
$
(
'#showNum'
).
show
();
dataFilter
:
function
(
data
,
type
)
{
$
(
'#totalExchange'
).
text
(
item
.
totalExchange
);
return
$
.
validate
.
unique
(
data
);
$
(
'#totalGeneral'
).
text
(
item
.
totalGeneral
);
}
str
+=
`<option value='
${
item
.
timeId
}
' label=
${
item
.
timeTitle
}
>
${
item
.
timeTitle
}
</option>`
;
}
}
},
})
phonenumber
:{
selectTwoId
=
''
;
// 选中演出下级的ID
isPhone
:
true
,
selectThreeId
=
''
;
// 选中演出三级的ID
remote
:
{
$
(
'#selectTwo'
).
empty
().
append
(
str
);
url
:
prefix
+
"/checkPhoneUnique"
,
$
(
'#selectThree'
).
empty
();
type
:
"post"
,
};
dataType
:
"json"
,
$
(
"#searchIpt"
).
focus
(
function
(){
data
:
{
search
()
"phonenumber"
:
function
()
{
$
(
'#dataList'
).
show
()
return
$
.
common
.
trim
(
$
(
"#phonenumber"
).
val
());
});
}
$
(
"#searchIpt"
).
blur
(
function
(){
},
setTimeout
(()
=>
{
dataFilter
:
function
(
data
,
type
)
{
$
(
'#dataList'
).
hide
()
return
$
.
validate
.
unique
(
data
);
},
500
);
}
if
(
!
$
(
"#searchIpt"
).
val
())
{
}
$
(
'#showNum'
).
hide
();
},
}
},
messages
:
{
"loginName"
:
{
remote
:
"用户已经存在"
},
"email"
:
{
remote
:
"Email已经存在"
},
"phonenumber"
:{
remote
:
"手机号码已经存在"
}
},
focusCleanup
:
true
});
function
submitHandler
()
{
});
var
chrtype
=
[[
$
{
#
strings
.
defaultString
(@
config
.
getKey
(
'sys.account.chrtype'
),
0
)}]];
$
(
"#searchIpt"
).
keyup
(
function
(){
var
password
=
$
(
"#password"
).
val
();
searchVal
=
$
(
"#searchIpt"
).
val
()
if
(
$
.
validate
.
form
()
&&
checkpwd
(
chrtype
,
password
))
{
search
()
var
data
=
$
(
"#form-user-add"
).
serializeArray
();
});
var
status
=
$
(
"input[id='status']"
).
is
(
':checked'
)
==
true
?
0
:
1
;
var
roleIds
=
$
.
form
.
selectCheckeds
(
"role"
);
$
(
'#selectTwo'
).
change
(
function
(
e
){
var
postIds
=
$
.
form
.
selectSelects
(
"post"
);
selectTwoId
=
$
(
this
).
val
();
data
.
push
({
"name"
:
"status"
,
"value"
:
status
});
console
.
log
(
selectTwoId
,
'kankna'
)
data
.
push
({
"name"
:
"roleIds"
,
"value"
:
roleIds
});
selectTwoName
=
$
(
'#selectTwo'
).
find
(
'option:selected'
).
attr
(
'label'
);
data
.
push
({
"name"
:
"postIds"
,
"value"
:
postIds
});
let
str
=
`<option value="0" label="" >所有</option>`
;
$
.
operate
.
saveTab
(
prefix
+
"/add"
,
data
);
searchData
.
forEach
(
item
=>
{
}
if
(
item
.
timeId
==
selectTwoId
)
{
}
str
+=
`<option value='
${
item
.
ticketId
}
' label=
${
item
.
ticketTitle
}
>
${
item
.
ticketTitle
}
</option>`
}
/* 用户管理-新增-选择部门树 */
function
selectDeptTree
()
{
var
treeId
=
$
(
"#treeId"
).
val
();
var
deptId
=
$
.
common
.
isEmpty
(
treeId
)
?
"100"
:
$
(
"#treeId"
).
val
();
var
url
=
ctx
+
"system/dept/selectDeptTree/"
+
deptId
;
var
options
=
{
title
:
'选择部门'
,
width
:
"380"
,
url
:
url
,
callBack
:
doSubmit
};
$
.
modal
.
openOptions
(
options
);
}
function
doSubmit
(
index
,
layero
){
var
tree
=
layero
.
find
(
"iframe"
)[
0
].
contentWindow
.
$
.
_tree
;
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
$
(
"#treeId"
).
val
(
body
.
find
(
'#treeId'
).
val
());
$
(
"#treeName"
).
val
(
body
.
find
(
'#treeName'
).
val
());
layer
.
close
(
index
);
}
$
(
function
()
{
$
(
'#post'
).
select2
({
placeholder
:
"请选择岗位"
,
allowClear
:
true
});
})
})
</script>
selectThreeId
=
''
;
// 选中演出三级的ID
</body>
$
(
'#selectThree'
).
empty
().
append
(
str
);
</html>
});
\ No newline at end of file
$
(
'#selectThree'
).
change
(
function
(
e
){
selectThreeId
=
$
(
this
).
val
();
selectThreeName
=
$
(
'#selectThree'
).
find
(
'option:selected'
).
attr
(
'label'
);
});
function
create
()
{
if
(
!
$
(
'#title'
).
val
()
||
!
$
(
'#num'
).
val
()
||
!
$
(
'#ticketTime'
).
val
())
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
}
let
useScope
=
100
;
let
busiName
=
$
(
"#searchIpt"
).
val
();
let
busiId
=
''
;
if
(
!
$
(
'#searchIpt'
).
val
())
{
showId
=
''
;
}
if
(
showId
)
{
useScope
=
90
;
busiId
=
showId
;
}
if
(
selectTwoId
)
{
useScope
=
91
;
busiId
=
selectTwoId
;
// busiName = selectTwoName;
}
if
(
selectThreeId
)
{
useScope
=
92
;
busiId
=
selectThreeId
;
// busiName = selectThreeName;
}
let
data
=
{
"couType"
:
3
,
// 券类型
"bindType"
:
0
,
// 输入兑换
"busiType"
:
1
,
"couponRuleList"
:
[
// 适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式]
{
"useScope"
:
useScope
,
"busiName"
:
busiName
||
'全部演出'
,
"busiId"
:
busiId
}
],
"eventAmt"
:
Number
(
$
(
'#num'
).
val
()),
// 数量
"label"
:
"标注"
,
// 不需管
"notice"
:
$
(
'#describeTxt'
).
val
(),
"title"
:
$
(
'#title'
).
val
(),
"eventAt"
:
$
.
common
.
dateFormat
(
new
Date
(),
'yyyy-MM-dd HH:mm:ss'
),
"validity"
:
Number
(
$
(
'#ticketTime'
).
val
()),
"redeemValidity"
:
Number
(
$
(
'#ticketTime'
).
val
())
// 兑换有效期
}
console
.
log
(
data
,
'data'
)
promiseMethods
(
'/candy/coupon/mgt/add'
,
'post'
,
JSON
.
stringify
(
data
),
'application/json'
).
then
(
res
=>
{
console
.
log
(
res
)
})
}
function
promiseMethods
(
url
,
type
,
data
,
contentType
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$
.
ajax
({
url
,
type
,
data
,
contentType
,
success
:
function
(
res
)
{
resolve
(
res
)
}
})
})
}
</script>
</html>
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add4.html
View file @
d5501151
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<head>
<th:block
th:include=
"include :: header('新增折扣券')"
/>
<th:block
th:include=
"include :: header('新增折扣券')"
/>
<th:block
th:include=
"include :: select2-css"
/>
<th:block
th:include=
"include :: select2-css"
/>
<link
rel=
"stylesheet"
href=
""
>
<style>
.layui-form
{
padding
:
20px
;
}
.main_title
,
.main_type
,
.money
,
.scope_application
,
.sendType
,
.phoneNumber
,
.discount
{
margin-bottom
:
20px
;
}
.discount
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
20px
;
}
.discount
input
{
width
:
60px
;
}
.sendType
,
.phoneNumber
{
display
:
none
;
}
.labelName
{
display
:
inline-block
;
width
:
100px
;
text-align
:
right
;
}
input
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
padding-left
:
5px
;
height
:
30px
;
}
.main_title
input
{
width
:
200px
;
}
.prompt
{
margin-left
:
100px
!important
;
}
.main_type
input
,
.sendType
input
{
margin-top
:
-2px
;
margin-right
:
5px
;
}
.main_type
span
,
.sendType
span
{
margin-right
:
12px
;
line-height
:
28px
;
}
.layui-form
.money
input
{
width
:
60px
;
}
.changeData
.dataOne
{
margin-bottom
:
20px
;
}
.changeData
.dataOne
p
{
margin
:
12px
0
0
20px
;
color
:
#ccc
;
}
.changeData
.dataOne
input
{
width
:
60px
;
}
.main_bottom
.describe
,
.main_bottom
.sendTime
{
margin-bottom
:
20px
;
}
.describe
,
.main_type
{
display
:
flex
;
}
.describe
textarea
,
.phoneNumber
textarea
{
width
:
400px
;
}
.sendTime
{
display
:
flex
;
}
.sendTime
input
{
margin-top
:
-6px
;
margin-right
:
5px
;
}
.bottom_btn
{
width
:
25%
;
text-align
:
center
;
}
select
{
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
background
:
transparent
;
outline
:
none
;
height
:
30px
;
width
:
200px
;
}
.search_ipt
ul
,
.search_ipt
li
{
padding
:
0
;
margin
:
0
;
font-style
:
normal
;
list-style
:
none
;
}
.search_ipt
ul
{
display
:
none
;
position
:
absolute
;
left
:
0
;
top
:
26px
;
padding
:
5px
0
;
z-index
:
899
;
min-width
:
200px
;
border
:
1px
solid
#eee
;
max-height
:
300px
;
overflow-y
:
auto
;
background-color
:
#fff
;
border-radius
:
2px
;
box-sizing
:
border-box
;
box-shadow
:
1px
1px
4px
rgb
(
0
0
0
/
8%
);
}
.search_ipt
li
{
background-color
:
#fff
;
cursor
:
pointer
;
padding-left
:
10px
!important
;
color
:
#999
;
padding
:
0
10px
;
line-height
:
36px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.search_ipt
li
:hover
{
background
:
#F6F6F6
;
}
.search_ipt
.layui-input
{
width
:
200px
;
}
.required
{
font-style
:
normal
;
color
:
red
;
}
#iptModal
{
display
:
none
;
}
</style>
</head>
</head>
<body>
<body>
<div
class=
"main-content"
>
<form
id=
"form-user-add"
class=
"layui-form"
>
<form
id=
"form-user-add"
class=
"form-horizontal"
>
<div
class=
"main_title"
>
<input
name=
"deptId"
type=
"hidden"
id=
"treeId"
/>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
名称:
</span><input
type=
"text"
id=
"title"
name=
"keyword"
placeholder=
"券名称"
required
/>
<h4
class=
"form-header h4"
>
基本信息
</h4>
</div>
<div
class=
"row"
>
<div
class=
"main_type"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
>
类别:
</span>
<div
class=
"form-group"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<label
class=
"col-sm-4 control-label is-required"
>
用户名称:
</label>
<input
type=
"radio"
value=
"2"
class=
"typeOne"
name=
"typeOne"
checked
><span>
商品
</span>
<div
class=
"col-sm-8"
>
</div>
<input
name=
"userName"
placeholder=
"请输入用户名称"
class=
"form-control"
type=
"text"
maxlength=
"30"
required
>
</div>
</div>
</div>
<div
class=
"main_type"
>
</div>
<span
class=
"labelName"
>
类型:
</span>
<div
class=
"col-sm-6"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<div
class=
"form-group"
>
<input
type=
"radio"
value=
"0"
class=
"typeTwo"
name=
"typeTwo"
checked
><span>
用户输入兑换
</span>
<label
class=
"col-sm-4 control-label"
>
归属部门:
</label>
<input
type=
"radio"
value=
"1"
class=
"typeTwo"
name=
"typeTwo"
><span>
发送至“我的券”
</span>
<div
class=
"col-sm-8"
>
</div>
<div
class=
"input-group"
>
</div>
<input
name=
"deptName"
onclick=
"selectDeptTree()"
id=
"treeName"
type=
"text"
placeholder=
"请选择归属部门"
class=
"form-control"
>
<div
class=
"scope_application"
id=
"scope_application"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-search"
></i></span>
<span
class=
"labelName"
>
适用范围:
</span>
</div>
<div
class=
"search_ipt"
style=
"position: relative;display: inline;"
>
</div>
<input
type=
"text"
id=
"searchIpt"
autocomplete=
"off"
class=
"layui-input"
placeholder=
"全部"
>
</div>
<ul
id=
"dataList"
style=
"position: absolute;"
></ul>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"discount"
>
<div
class=
"col-sm-6"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
折扣:
</span>
<div
class=
"form-group"
>
<div
class=
"discount_item"
>
<label
class=
"col-sm-4 control-label"
>
手机号码:
</label>
<input
type=
"text"
id=
"discount"
autocomplete=
"off"
class=
"layui-input"
placeholder=
""
>
折
<div
class=
"col-sm-8"
>
</div>
<div
class=
"input-group"
>
</div>
<input
id=
"phonenumber"
name=
"phonenumber"
placeholder=
"请输入手机号码"
class=
"form-control"
type=
"text"
maxlength=
"11"
>
<div
class=
"changeData"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-mobile"
></i></span>
<div
id=
"modalOne"
>
</div>
<div
class=
"dataOne"
>
</div>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
数量:
</span>
</div>
<input
type=
"text"
id=
"num"
/>
</div>
张
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
邮箱:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"email"
name=
"email"
class=
"form-control email"
type=
"text"
maxlength=
"50"
placeholder=
"请输入邮箱"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-envelope"
></i></span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label is-required"
>
登录账号:
</label>
<div
class=
"col-sm-8"
>
<input
id=
"loginName"
name=
"loginName"
placeholder=
"请输入登录账号"
class=
"form-control"
type=
"text"
maxlength=
"30"
required
>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label is-required"
>
登录密码:
</label>
<div
class=
"col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"password"
name=
"password"
placeholder=
"请输入登录密码"
class=
"form-control"
type=
"password"
th:value=
"${@config.getKey('sys.user.initPassword')}"
required
>
<span
class=
"input-group-addon"
title=
"登录密码,鼠标按下显示密码"
onmousedown=
"$('#password').attr('type','text')"
onmouseup=
"$('#password').attr('type','password')"
><i
class=
"fa fa-key"
></i></span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
用户性别:
</label>
<div
class=
"col-sm-8"
>
<select
name=
"sex"
class=
"form-control m-b"
th:with=
"type=${@dict.getType('sys_user_sex')}"
>
<option
th:each=
"dict : ${type}"
th:text=
"${dict.dictLabel}"
th:value=
"${dict.dictValue}"
></option>
</select>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-4 control-label"
>
用户状态:
</label>
<div
class=
"col-sm-8"
>
<label
class=
"toggle-switch switch-solid"
>
<input
type=
"checkbox"
id=
"status"
checked
>
<span></span>
</label>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"dataOne"
>
<div
class=
"col-sm-12"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
券的有效期:
</span>
<div
class=
"form-group"
>
<input
type=
"text"
id=
"ticketTime"
/>
<label
class=
"col-xs-2 control-label"
>
岗位:
</label>
天
<div
class=
"col-xs-4"
>
<p
class=
"prompt"
>
*可兑换的时间
</p>
<select
id=
"post"
class=
"form-control select2-multiple"
multiple
>
<option
th:each=
"post:${posts}"
th:value=
"${post.postId}"
th:text=
"${post.postName}"
th:disabled=
"${post.status == '1'}"
></option>
</select>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"dataOne"
id=
"exchange"
>
<div
class=
"col-sm-12"
>
<span
class=
"labelName"
><i
class=
"required"
>
*
</i>
兑换有效期:
</span>
<div
class=
"form-group"
>
<input
type=
"text"
id=
"exchangeTime"
/>
<label
class=
"col-xs-2 control-label"
>
角色:
</label>
天
<div
class=
"col-xs-10"
>
<p
class=
"prompt"
>
*兑换后的有效时间
</p>
<label
th:each=
"role:${roles}"
class=
"check-box"
>
<input
name=
"role"
type=
"checkbox"
th:value=
"${role.roleId}"
th:text=
"${role.roleName}"
th:disabled=
"${role.status == '1'}"
>
</label>
</div>
</div>
</div>
</div>
</div>
<h4
class=
"form-header h4"
>
其他信息
</h4>
</div>
<div
class=
"row"
>
</div>
<div
class=
"col-sm-12"
>
<div
class=
"sendType"
>
<div
class=
"form-group"
>
<div
style=
"display: flex;align-items: center;"
>
<label
class=
"col-xs-2 control-label"
>
备注:
</label>
<span
class=
"labelName"
>
发送类型:
</span>
<div
class=
"col-xs-10"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<textarea
name=
"remark"
maxlength=
"500"
class=
"form-control"
rows=
"3"
></textarea>
<input
type=
"radio"
value=
"10"
class=
"sendType"
name=
"sendType"
checked
><span>
全体用户
</span>
</div>
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
><span>
会员
</span>
</div>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
</div>
</div>
</div>
</form>
</div>
</div>
<div
class=
"phoneNumber"
>
<span
style=
"display:inline-block;margin-bottom: 12px;"
><i
class=
"required"
>
*
</i>
请输入手机号
<span
style=
"color: #ccc"
>
(手机号可填多个,使用","隔开)
</span>
:
</span>
<textarea
id=
"phoneNum"
class=
"form-control"
rows=
"4"
style=
"margin-left: 100px"
></textarea>
</div>
</div>
<div
class=
"main_bottom"
>
<div
class=
"row"
>
<div
class=
"describe"
>
<div
class=
"col-sm-offset-5 col-sm-10"
>
<span
class=
"labelName"
>
<button
type=
"button"
class=
"btn btn-sm btn-primary"
onclick=
"submitHandler()"
><i
class=
"fa fa-check"
></i>
保 存
</button>
描述说明:
<button
type=
"button"
class=
"btn btn-sm btn-danger"
onclick=
"closeItem()"
><i
class=
"fa fa-reply-all"
></i>
关 闭
</button>
</span>
<textarea
id=
"describeTxt"
class=
"form-control"
rows=
"4"
></textarea>
</div>
<div
class=
"bottom_btn"
>
<!-- <button type="button" class="layui-btn btn btn-primary" lay-filter="formDemo" onclick="create()">创建代金券</button> -->
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"create()"
>
创建折扣券
</button>
</div>
</div>
</div>
</div>
<th:block
th:include=
"include :: footer"
/>
</form>
<th:block
th:include=
"include :: select2-js"
/>
<th:block
th:include=
"include :: footer"
/>
<script>
<th:block
th:include=
"include :: select2-js"
/>
var
prefix
=
ctx
+
"system/user"
;
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
$
(
"#form-user-add"
).
validate
({
onkeyup
:
false
,
rules
:{
loginName
:{
minlength
:
2
,
maxlength
:
20
,
remote
:
{
url
:
prefix
+
"/checkLoginNameUnique"
,
type
:
"post"
,
dataType
:
"json"
,
data
:
{
"loginName"
:
function
()
{
return
$
.
common
.
trim
(
$
(
"#loginName"
).
val
());
}
},
dataFilter
:
function
(
data
,
type
)
{
return
$
.
validate
.
unique
(
data
);
}
}
},
password
:{
minlength
:
5
,
maxlength
:
20
},
email
:{
email
:
true
,
remote
:
{
url
:
prefix
+
"/checkEmailUnique"
,
type
:
"post"
,
dataType
:
"json"
,
data
:
{
"email"
:
function
()
{
return
$
.
common
.
trim
(
$
(
"#email"
).
val
());
}
},
dataFilter
:
function
(
data
,
type
)
{
return
$
.
validate
.
unique
(
data
);
}
}
},
phonenumber
:{
isPhone
:
true
,
remote
:
{
url
:
prefix
+
"/checkPhoneUnique"
,
type
:
"post"
,
dataType
:
"json"
,
data
:
{
"phonenumber"
:
function
()
{
return
$
.
common
.
trim
(
$
(
"#phonenumber"
).
val
());
}
},
dataFilter
:
function
(
data
,
type
)
{
return
$
.
validate
.
unique
(
data
);
}
}
},
},
messages
:
{
"loginName"
:
{
remote
:
"用户已经存在"
},
"email"
:
{
remote
:
"Email已经存在"
},
"phonenumber"
:{
remote
:
"手机号码已经存在"
}
},
focusCleanup
:
true
});
function
submitHandler
()
{
var
chrtype
=
[[
$
{
#
strings
.
defaultString
(@
config
.
getKey
(
'sys.account.chrtype'
),
0
)}]];
var
password
=
$
(
"#password"
).
val
();
if
(
$
.
validate
.
form
()
&&
checkpwd
(
chrtype
,
password
))
{
var
data
=
$
(
"#form-user-add"
).
serializeArray
();
var
status
=
$
(
"input[id='status']"
).
is
(
':checked'
)
==
true
?
0
:
1
;
var
roleIds
=
$
.
form
.
selectCheckeds
(
"role"
);
var
postIds
=
$
.
form
.
selectSelects
(
"post"
);
data
.
push
({
"name"
:
"status"
,
"value"
:
status
});
data
.
push
({
"name"
:
"roleIds"
,
"value"
:
roleIds
});
data
.
push
({
"name"
:
"postIds"
,
"value"
:
postIds
});
$
.
operate
.
saveTab
(
prefix
+
"/add"
,
data
);
}
}
/* 用户管理-新增-选择部门树 */
function
selectDeptTree
()
{
var
treeId
=
$
(
"#treeId"
).
val
();
var
deptId
=
$
.
common
.
isEmpty
(
treeId
)
?
"100"
:
$
(
"#treeId"
).
val
();
var
url
=
ctx
+
"system/dept/selectDeptTree/"
+
deptId
;
var
options
=
{
title
:
'选择部门'
,
width
:
"380"
,
url
:
url
,
callBack
:
doSubmit
};
$
.
modal
.
openOptions
(
options
);
}
function
doSubmit
(
index
,
layero
){
var
tree
=
layero
.
find
(
"iframe"
)[
0
].
contentWindow
.
$
.
_tree
;
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
$
(
"#treeId"
).
val
(
body
.
find
(
'#treeId'
).
val
());
$
(
"#treeName"
).
val
(
body
.
find
(
'#treeName'
).
val
());
layer
.
close
(
index
);
}
$
(
function
()
{
$
(
'#post'
).
select2
({
placeholder
:
"请选择岗位"
,
allowClear
:
true
});
})
</script>
</body>
</body>
</html>
<script>
\ No newline at end of file
var
roadShowId
=
'[[${roadShowId}]]'
.
replaceAll
(
"
\"
"
,
""
);
let
prefix
=
ctx
;
let
typeOne
=
'2'
;
// 类别
let
typeTwo
=
'0'
;
// 类型
let
sendType
=
'10'
;
// 发送类型
let
searchVal
=
''
;
// 输入框内数据
let
searchData
=
[];
// 搜索总数据
let
showId
=
''
;
// 选中演出id
let
sendTimeType
=
''
;
function
getMallList
()
{
let
data
=
{
title
:
''
}
let
str
=
''
;
promiseMethods
(
'http://testmall.zhengzai.tv/admin/goodListForQuick'
,
'get'
,
data
,
'application/x-www-form-urlencoded'
).
then
(
res
=>
{
if
(
res
.
data
.
length
>
0
)
{
searchData
=
res
.
data
;
searchData
.
forEach
((
item
,
index
)
=>
{
str
+=
`<li class="selectData" onclick="selectOne('
${
item
.
id
}
','
${
item
.
title
}
')">
${
item
.
title
}
</li>`
})
$
(
'#dataList'
).
html
(
str
);
}
else
{
$
(
'#dataList'
).
html
(
'<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'
);
}
})
};
function
selectOne
(
id
,
name
)
{
$
(
"#searchIpt"
).
val
(
name
);
showId
=
id
;
console
.
log
(
showId
,
'showId'
)
};
$
(
"input[name=typeTwo]"
).
change
(
function
(
e
){
typeTwo
=
e
.
target
.
value
;
if
(
typeTwo
==
1
)
{
$
(
'.sendType'
).
show
();
$
(
'#exchangeTime'
).
val
(
''
)
$
(
'#exchange'
).
hide
();
if
(
sendType
==
2
)
{
$
(
'.phoneNumber'
).
show
();
}
}
else
{
$
(
'#exchange'
).
show
();
$
(
'.sendType'
).
hide
();
$
(
'.phoneNumber'
).
hide
();
$
(
'.phoneNum'
).
val
(
''
);
}
});
$
(
"#searchIpt"
).
focus
(
function
(){
getMallList
()
$
(
'#dataList'
).
show
()
});
$
(
"#searchIpt"
).
blur
(
function
(){
setTimeout
(()
=>
{
$
(
'#dataList'
).
hide
()
},
500
);
});
$
(
"#searchIpt"
).
keyup
(
function
(){
searchVal
=
$
(
"#searchIpt"
).
val
()
search
()
});
$
(
"input[name=sendType]"
).
change
(
function
(
e
){
sendType
=
e
.
target
.
value
;
if
(
e
.
target
.
value
==
2
)
{
$
(
'.phoneNumber'
).
show
();
}
else
{
$
(
'.phoneNumber'
).
hide
();
}
});
function
create
()
{
if
(
!
$
(
'#title'
).
val
()
||
!
$
(
'#num'
).
val
()
||
!
$
(
'#ticketTime'
).
val
()
||
!
$
(
'#discount'
).
val
())
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
if
(
typeTwo
!=
1
)
{
if
(
!
$
(
'#exchangeTime'
).
val
())
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
}
}
if
(
sendType
==
2
)
{
if
(
!
$
(
'.phoneNumber'
).
val
())
{
return
layer
.
msg
(
'请将必填项输入完整~!'
);
};
}
}
let
useScope
=
100
;
let
busiName
=
''
;
let
busiId
=
''
;
if
(
!
$
(
'#searchIpt'
).
val
())
{
showId
=
''
;
}
if
(
showId
)
{
useScope
=
90
;
busiName
=
$
(
'#searchIpt'
).
val
();
busiId
=
showId
;
}
console
.
log
(
showId
,
busiId
,
'showId'
)
let
data
=
{
"bindType"
:
Number
(
typeTwo
),
// 兑换券/发放
"busiType"
:
2
,
// 业务类别
"couType"
:
4
,
// 券类型
"couponRuleList"
:
[
// 适用范围[100-全场|90-演出|91-场次|92-票|80-商品|81-款式]
{
"useScope"
:
useScope
,
"busiName"
:
busiName
||
'全部商品'
,
"busiId"
:
busiId
}
],
"discount"
:
$
(
'#discount'
).
val
()
/
10
,
// 折扣券需传
"eventAmt"
:
Number
(
$
(
'#num'
).
val
()),
// 数量
"eventLimit"
:
$
(
'#phoneNum'
).
val
(),
// 手机号
"eventType"
:
Number
(
sendType
),
"label"
:
"标注"
,
// 不需管
"notice"
:
$
(
'#describeTxt'
).
val
(),
"redeemValidity"
:
Number
(
$
(
'#exchangeTime'
).
val
()),
// 兑换有效期
"eventAt"
:
$
.
common
.
dateFormat
(
new
Date
(),
'yyyy-MM-dd HH:mm:ss'
),
"title"
:
$
(
'#title'
).
val
(),
"validity"
:
Number
(
$
(
'#ticketTime'
).
val
()),
}
if
(
typeTwo
==
1
)
{
delete
data
.
redeemValidity
}
else
{
delete
data
.
eventType
}
if
(
sendType
!=
2
)
{
delete
data
.
eventLimit
;
}
console
.
log
(
data
,
'data'
)
promiseMethods
(
'/candy/coupon/mgt/add'
,
'post'
,
JSON
.
stringify
(
data
),
'application/json'
).
then
(
res
=>
{
console
.
log
(
res
)
})
}
function
promiseMethods
(
url
,
type
,
data
,
contentType
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$
.
ajax
({
url
,
type
,
data
,
contentType
,
success
:
function
(
res
)
{
resolve
(
res
)
}
})
})
}
</script>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment