From 82e43f7eafd6a60c7f3b6d503c4c2e80406cf2af Mon Sep 17 00:00:00 2001 From: "LAPTOP-UV1MNL38\\18023" <1802330370@qq.com> Date: Sun, 28 Jul 2024 20:19:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=97=A8=E5=BA=97=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=B7=B2=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/storeMembers/storeMembersList.js | 71 +++++++++++++++---- .../tpl/storeMembers/storeMembersList.html | 61 ++++++++++------ 2 files changed, 97 insertions(+), 35 deletions(-) diff --git a/shop/src/main/resources/template/js/storeMembers/storeMembersList.js b/shop/src/main/resources/template/js/storeMembers/storeMembersList.js index 37d4046d1..70d144135 100644 --- a/shop/src/main/resources/template/js/storeMembers/storeMembersList.js +++ b/shop/src/main/resources/template/js/storeMembers/storeMembersList.js @@ -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()}); }, `
`); } }); } + 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(); diff --git a/shop/src/main/resources/template/tpl/storeMembers/storeMembersList.html b/shop/src/main/resources/template/tpl/storeMembers/storeMembersList.html index 42a52b77a..32529196a 100644 --- a/shop/src/main/resources/template/tpl/storeMembers/storeMembersList.html +++ b/shop/src/main/resources/template/tpl/storeMembers/storeMembersList.html @@ -1,37 +1,56 @@ - - - - - + + + + +
-
- -
+
+ + +
-
-
-
+
+
+
+ +
-
\ No newline at end of file -- GitLab