Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6782024e
authored
Aug 05, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改有效期-弹窗
1 parent
5515030a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
51 deletions
html/merchant/index.html
html/merchant/validPeriodForm.html
html/merchant/index.html
View file @
6782024
...
...
@@ -207,7 +207,7 @@
})
table
.
on
(
'tool(merchant-table-filter)'
,
function
(
obj
)
{
console
.
log
(
obj
)
//
console.log(obj)
var
eventName
=
obj
.
event
var
row
=
obj
.
data
console
.
log
(
row
)
...
...
@@ -240,35 +240,27 @@
// 修改账户有效期
case
'handleVaildPeriod'
:
// console.log(row)
var
layerIdx
=
layer
.
open
({
layer
.
open
({
type
:
2
,
title
:
'修改账户的有效期'
,
area
:
[
'700px'
,
'420px'
],
fixed
:
false
,
//不固定
// maxmin: true,
btn
:
[
'确定'
,
'取消'
],
content
:
'validPeriodForm.html?id='
+
row
.
id
+
'&
validPeriod='
+
'365'
,
content
:
'validPeriodForm.html?id='
+
row
.
id
+
'&
effectiveTime='
+
row
.
effectiveTime
,
yes
:
function
(
index
,
layero
)
{
// console.log(layero)
// var res = window["layui-layer-iframe" + index].callbackdata()
// console.log(res)
// 获取iframe层的body
var
body
=
layer
.
getChildFrame
(
'body'
,
index
)
body
.
contents
().
find
(
'#isValid'
).
attr
(
'value'
,
'no'
)
helper
.
store
.
set
(
'isRefresh'
,
false
)
body
.
find
(
'#periodVerifyBtn'
).
click
()
if
(
body
.
contents
().
find
(
'#isValid'
).
val
()
===
'yes'
)
{
// console.log('+++++++++++')
layer
.
msg
(
'操作成功'
,
{
icon
:
1
})
layer
.
close
(
index
)
}
},
cancel
:
function
(
index
,
layero
)
{
// layer.close(index)
end
:
function
()
{
var
isRefresh
=
helper
.
store
.
get
(
'isRefresh'
)
if
(
isRefresh
)
{
getTabelList
()
}
helper
.
store
.
remove
(
'isRefresh'
)
}
})
console
.
log
(
layerIdx
)
break
}
})
...
...
@@ -354,7 +346,7 @@
item
.
btn
.
createSubMerchant
=
true
}
}
}
else
if
(
item
.
status
!=
3
)
{
}
else
if
(
item
.
status
!=
3
)
{
item
.
btn
.
edit
=
true
}
}
else
{
...
...
html/merchant/validPeriodForm.html
View file @
6782024
...
...
@@ -26,63 +26,49 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-label required"
style=
"width: 120px;"
>
账户有效期:
</div>
<div
class=
"layui-input-inline"
style=
"width: auto;"
>
<select
name=
"
validPeriod
"
id=
"periodSelect"
required
lay-verify=
"required"
>
<select
name=
"
effectiveTime
"
id=
"periodSelect"
required
lay-verify=
"required"
>
<option
value=
""
>
请选择
</option>
</select>
<p>
(注:永久有效不超过所属工厂商户的有效期)
</p>
</div>
<button
id=
"periodVerifyBtn"
lay-submit
lay-filter=
"periodSubmit"
style=
"display: none;"
></button>
<!-- <div class="layui-form-item" style="padding: 40px 20px;">
<div class="layui-input-inline">
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="validSubmit">立即提交</button>
<button type="reset" class="layui-btn layui-btn-sm layui-btn-primary">重置</button>
</div>
</div> -->
</div>
</form>
<input
type=
"text"
id=
"isValid"
name=
"isValid"
value=
"no"
style=
"display: none;"
class=
"layui-input"
>
</main>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
layui
.
use
([
'form'
,
'request'
],
function
()
{
layui
.
use
([
'form'
,
'
helper'
,
'
request'
],
function
()
{
var
form
=
layui
.
form
var
request
=
layui
.
request
var
$
=
layui
.
$
var
helper
=
layui
.
helper
var
currLayerIdx
=
parent
.
layer
.
getFrameIndex
(
window
.
name
)
var
baseData
=
{}
var
vaildData
=
{
id
:
getQueryString
(
'id'
),
validPeriod
:
getQueryString
(
'validPeriod
'
)
effectiveTime
:
getQueryString
(
'effectiveTime
'
)
}
getVaildPeriod
()
// form.on('submit(validSubmit)', function (data) {
// var params = {
// id: vaildData.id,
// validPeriod: data.field.validPeriod
// }
// console.log(params)
// // layer.msg('操作成功', { time: 2000 })
// parent.layer.close(currLayerIdx)
// return false
// })
form
.
on
(
'submit(periodSubmit)'
,
function
(
data
)
{
// console.log(data)
// console.log('点击啦---')
// 调接口
$
(
'#isValid'
).
attr
(
'value'
,
'yes'
)
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.updateValPerByMerId'
,
id
:
vaildData
.
id
,
effectiveTime
:
data
.
field
.
effectiveTime
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
helper
.
store
.
set
(
'isRefresh'
,
true
)
parent
.
layer
.
close
(
currLayerIdx
)
}
})
return
false
})
// function callbackdata() {
// return vaildData
// }
// 获取参数
function
getQueryString
(
name
)
{
var
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
)
...
...
@@ -100,13 +86,13 @@
dictType
:
'account_validity_period'
},
function
(
res
)
{
if
(
res
.
code
===
'0'
)
{
baseData
.
validPeriod
List
=
res
.
data
baseData
.
effectiveTime
List
=
res
.
data
var
periodSelect
=
$
(
'#periodSelect'
)
$
.
each
(
baseData
.
validPeriod
List
,
function
(
index
,
item
)
{
$
.
each
(
baseData
.
effectiveTime
List
,
function
(
index
,
item
)
{
periodSelect
.
append
(
new
Option
(
item
.
dictLabel
,
item
.
dictValue
))
})
form
.
val
(
'periodFilter'
,
{
validPeriod
:
vaildData
.
validPeriod
effectiveTime
:
vaildData
.
effectiveTime
})
form
.
render
(
'select'
)
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment