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 6a82c6b5
authored
Nov 13, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
批量新增商户
1 parent
e574d992
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
2 deletions
html/merchant/index.html
html/merchant/index.html
View file @
6a82c6b
...
@@ -107,11 +107,15 @@
...
@@ -107,11 +107,15 @@
<div
class=
"search-block"
>
<div
class=
"search-block"
>
<div
class=
"h20"
></div>
<div
class=
"h20"
></div>
<form
class=
"layui-form"
lay-filter=
"searchFilter"
id=
"searchForm"
>
<form
class=
"layui-form"
lay-filter=
"searchFilter"
id=
"searchForm"
>
<div
class=
"layui-inline hide"
id=
"operateEl"
>
<div
class=
"layui-inline hide"
id=
"operateEl"
style=
"display: flex;"
>
<button
class=
"layui-btn mb5 createBtn"
id=
"addBtn"
>
<button
class=
"layui-btn mb5 createBtn"
id=
"addBtn"
>
<i
class=
"layui-icon layui-icon-addition"
></i>
<i
class=
"layui-icon layui-icon-addition"
></i>
<span>
创建商户
</span>
<span>
创建商户
</span>
</button>
</button>
<button
class=
"layui-btn mb5 createBtn"
id=
"batchCreate"
>
<i
class=
"layui-icon layui-icon-addition"
></i>
<span>
批量创建商户
</span>
</button>
</div>
</div>
<!-- <div class="hide"> -->
<!-- <div class="hide"> -->
<div
id=
"relevancyEl"
class=
"layui-inline hide"
>
<div
id=
"relevancyEl"
class=
"layui-inline hide"
>
...
@@ -248,7 +252,6 @@
...
@@ -248,7 +252,6 @@
<script
src=
"https://img02.glsx.com.cn/layui/layui.js"
></script>
<script
src=
"https://img02.glsx.com.cn/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/load.js"
></script>
<script
type=
"text/html"
id=
"accountTypeTpl"
>
<script
type=
"text/html"
id=
"accountTypeTpl"
>
<
ul
>
<
ul
>
{{
#
var
accountTypes
=
d
.
accountTypeNames
.
split
(
","
)}}
{{
#
}}
{{
#
if
((
d
.
accountTypeNames
)){
}}
{{
#
layui
.
each
(
accountTypes
,
function
(
index
,
item
){
}}
{{
#
var
accountTypes
=
d
.
accountTypeNames
.
split
(
","
)}}
{{
#
}}
{{
#
if
((
d
.
accountTypeNames
)){
}}
{{
#
layui
.
each
(
accountTypes
,
function
(
index
,
item
){
}}
...
@@ -719,6 +722,84 @@
...
@@ -719,6 +722,84 @@
return
false
return
false
})
})
//批量创建商户
$
(
'#batchCreate'
).
on
(
'click'
,
function
(
e
){
e
.
preventDefault
();
// 阻止按钮默认行为
var
contentHtml
=
'<div style="padding:20px;">'
+
'上传文件:<input type="text" id="fileName" class="layui-input" readonly style="display:inline-block; width: calc(100% - 130px);">'
+
'<button id="selectFileBtn" class="layui-btn layui-btn-normal" style="margin-left:70px;margin-top:10px;">选择文件</button>'
+
'<input type="file" id="fileInput" style="display: none;" accept=".xlsx,.xls">'
+
'<a id="templateLink" href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/批量创建商户导入模版.xlsx" style="margin-left:10px">下载模板</a>'
+
'</div>'
+
'<p id="loadingText" style="display:none;padding:20px">因数据量过大,系统正在加急处理,预计需等待1分钟;预计处理过程中,请不要退出当前操作,否则将导致本次批量创建商户无效。</p>'
;
layer
.
open
({
type
:
1
,
area
:
[
'500px'
,
'300px'
],
title
:
'批量创建商户'
,
content
:
contentHtml
,
btn
:
[
'确定'
,
'关闭'
],
success
:
function
(
layero
,
index
){
$
(
layero
).
find
(
'#selectFileBtn'
).
on
(
'click'
,
function
(){
$
(
layero
).
find
(
'#fileInput'
).
click
();
});
$
(
layero
).
find
(
'#fileInput'
).
on
(
'change'
,
function
(){
var
file
=
this
.
files
[
0
];
if
(
file
){
var
fileName
=
file
.
name
;
var
fileExt
=
fileName
.
split
(
'.'
).
pop
().
toLowerCase
();
if
(
fileExt
===
'xlsx'
||
fileExt
===
'xls'
){
$
(
layero
).
find
(
'#fileName'
).
val
(
fileName
);
}
else
{
layer
.
msg
(
'请选择Excel格式的文件'
);
$
(
this
).
val
(
''
);
// 清除不正确的文件
$
(
layero
).
find
(
'#fileName'
).
val
(
''
);
}
}
});
},
yes
:
function
(
index
,
layero
){
var
fileInput
=
$
(
layero
).
find
(
'#fileInput'
)[
0
];
if
(
fileInput
.
files
.
length
===
0
)
{
layer
.
msg
(
'请选择文件'
);
return
;
}
// 显示loading文案
$
(
layero
).
find
(
'#loadingText'
).
show
();
// 显示loading效果
var
loadingIndex
=
layer
.
load
(
1
,
{
shade
:
0.5
});
// TODO: 添加您的文件上传逻辑
// 模拟文件上传和处理请求
setTimeout
(
function
()
{
layer
.
close
(
loadingIndex
);
$
(
layero
).
find
(
'#loadingText'
).
hide
();
var
isSuccess
=
true
;
// 假设成功,您需要根据实际上传结果替换
if
(
isSuccess
)
{
layer
.
msg
(
'处理成功,系统已自动创建商户,可返回列表查看'
);
layer
.
close
(
index
);
}
else
{
$
(
layero
).
find
(
'#templateLink'
).
show
().
text
(
'下载失败模板'
).
attr
(
'href'
,
'失败模板下载URL'
);
layer
.
msg
(
'处理失败,可点击 下载失败模板 查看失败原因'
);
}
},
60000
);
// 假设上传和处理需要60秒
// TODO: 添加您的文件上传逻辑
},
btn2
:
function
(
index
,
layero
){
layer
.
close
(
index
);
},
cancel
:
function
(){
// 右上角关闭回调
}
});
});
$
(
'#relevancyBtn'
).
on
(
'click'
,
function
()
{
$
(
'#relevancyBtn'
).
on
(
'click'
,
function
()
{
$messenger
.
emit
(
'route-to'
,
{
path
:
'/settings/baseInfo/relevance'
})
$messenger
.
emit
(
'route-to'
,
{
path
:
'/settings/baseInfo/relevance'
})
})
})
...
...
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