提交 82e43f7e 编写于 作者: L LAPTOP-UV1MNL38\18023

feat:门店会员功能已完成

上级 15085de5
......@@ -13,10 +13,10 @@ layui.config({
var selTemplate = getFileContent('tpl/template/select-option.tpl');
//门店会员
// 加载当前用户所属门店
let storeHtml = '';
AjaxPostUtil.request({url: sysMainMation.shopBasePath + "storeStaff005", params: {}, type: 'json', method: "GET", callback: function(json) {
$("#storeId").html(getDataUseHandlebars(selTemplate, json));
form.render('select');
initTable();
storeHtml = getDataUseHandlebars(selTemplate, json);
initTable(storeHtml);
}, async: false});
......@@ -39,32 +39,75 @@ layui.config({
page: true,
limits: getLimits(),
limit: getLimit(),
overflow: {
type: 'tips',
hoverTime: 300, // 悬停时间,单位ms, 悬停 hoverTime 后才会显示,默认为 0
minWidth: 150, // 最小宽度
maxWidth: 500 // 最大宽度
},
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'name', title: '会员姓名', align: 'left', width: 250 },
{ field: 'phone', title: '联系电话', align: 'left', width: 250 },
{ field: 'email', title: '邮箱', align: 'left', width: 250 },
{ field: 'remark', title: '备注', align: 'left', width: 450 },
{ field: 'name', title: '会员姓名', align: 'left', width: 200 },
{ field: 'phone', title: '联系电话', align: 'left', width: 200 },
{ field: 'email', title: '邮箱', align: 'left', width: 200 },
{ field: 'remark', title: '备注', align: 'left', width: 400 },
{ title: systemLanguage["com.skyeye.operation"][languageType], rowspan: '2', fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'}
]],
done: function(json) {
matchingLanguage();
soulTable.render(this);
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入会员姓名", function () {
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入会员姓名、联系电话", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
}, `<label class="layui-form-label">门店</label><div class="layui-input-inline">
<select id="storeId" name="storeId" lay-filter="storeId" lay-search="">
${storeHtml}
</select></div>`);
}
});
}
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'delete') { //删除
del(data);
}else if (layEvent === 'edit') { //编辑
edit(data);
}
});
// 添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023042400005', null),
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "storeMembersAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
// 编辑
function edit(data) {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023042400006&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "storeMembersEdit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
// 删除
function del(data) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
AjaxPostUtil.request({url: sysMainMation.shopBasePath + "member004", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta charset="utf-8"/>
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet"/>
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet"/>
<style>
.layui-table-cell {
height: auto;
......@@ -18,13 +18,32 @@
<body>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh"
aria-hidden="true"></i>
<language showName="com.skyeye.refreshDataBtn"></language>
</button>
<button id="addBean" class="winui-toolbtn search-table-btn-right" auth="1722130800533"><i class="fa fa-plus"
aria-hidden="true"></i>
<language showName="com.skyeye.addBtn"></language>
</button>
</div>
</div>
<div style="margin: auto 10px; height: calc(100% - 50px);">
<div style="width: calc(100% - 10px); float: left;">
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(auth('1722130800533')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">
<language showName="com.skyeye.editBtn"></language>
</a>
{{# } }}
{{# if(auth('1722130830483')){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">
<language showName="com.skyeye.deleteBtn"></language>
</a>
{{# } }}
</script>
</div>
</div>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册