diff --git a/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js b/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js deleted file mode 100644 index 93bc41af80732eadade8c04b153295e2e3780c1a..0000000000000000000000000000000000000000 --- a/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js +++ /dev/null @@ -1,226 +0,0 @@ - - -// 表格的序号 -var rowNum = 1; - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'textool'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$, - textool = layui.textool; - var selOption = getFileContent('tpl/template/select-option.tpl'); - - var usetableTemplate = $("#usetableTemplate").html(); - - var storeList = []; - // 加载我所在的门店 - shopUtil.queryStaffBelongStoreList(function (json){ - storeList = [].concat(json.rows); - $("#storeId").html(getDataUseHandlebars($("#selectTemplate").html(), json)); - }); - form.on('select(storeId)', function(data) { - calcMealChoose(); - }); - - // 用户类型变化 - form.on('radio(userType)', function(data) { - var val = data.value; - if(val == 1){ - $(".memberMation").hide(); - $(".anonymousUserMation").show(); - } else { - $(".memberMation").show(); - $(".anonymousUserMation").hide(); - } - }); - - var carHasMealList = []; - // 车辆信息变化 - form.on('select(memberCar)', function(data) { - var val = data.value; - if(isNull(val)){ - $("#mealId").html(""); - } else { - // 获取车辆用于的套餐信息 - AjaxPostUtil.request({url: shopBasePath + "queryMealMationByCarId", params: {carId: val}, type: 'json', method: "GET", callback: function (json) { - carHasMealList = [].concat(json.rows); - calcMealChoose(); - }, async: false}); - } - }); - - // 套餐变化 - form.on('select(mealId)', function(data) { - var val = data.value; - if(isNull(val)){ - $("#mealExplain").html(""); - $("#mealConsume").html(""); - } else { - var item = getInPoingArr(carHasMealList, "id", val, null); - $("#mealExplain").html(item.mealExplain); - $("#mealConsume").html(item.mealConsume); - } - }); - - function calcMealChoose(){ - // 获取选中门店所属的区域id - var storeId = $("#storeId").val(); - var chooseStoreAreaId = getInPoingArr(storeList, "id", storeId, "areaId"); - - var tempList = [].concat(carHasMealList); - $.each(tempList, function (i, item) { - if(item.areaId != chooseStoreAreaId){ - item.choose = "disabled"; - } else { - item.choose = ""; - } - }); - $("#mealId").html(getDataUseHandlebars($("#mealTemplate").html(), {rows: tempList})); - form.render('select'); - } - - textool.init({eleId: 'remark', maxlength: 400}); - - matchingLanguage(); - form.render(); - form.on('submit(formAddBean)', function (data) { - if (winui.verifyForm(data.elem)) { - var tableData = new Array(); - // $.each($("#useTable tr"), function(i, item) { - // // 获取行编号 - // var rowNum = $(item).attr("trcusid").replace("tr", ""); - // var row = { - // consumeExplain: $("#consumeExplain" + rowNum.toString()).val(), - // price: $("#price" + rowNum.toString()).val() - // }; - // tableData.push(row); - // }); - - var userType = $("input[name='userType']:checked").val(); - - var params = { - storeId: $("#storeId").val(), - userType: userType, - memberId: userType == 1 ? "" : sysMemberUtil.memberMation.id, - memberCarId: userType == 1 ? "" : $("#memberCar").val(), - memberCarPlate: userType == 1 ? $("#memberCarPlate").val() : $("#memberCar").find("option:selected").text(), - mealOrderChildId: userType == 1 ? "" : $("#mealId").val(), - // servicePrice: $("#servicePrice").val(), - servicePrice: 0, - remark: $("#remark").val(), - type: 2, - consumeMationList: JSON.stringify(tableData) - }; - - if(userType == 1){ - // 匿名客户 - if(isNull(params.memberCarPlate)){ - winui.window.msg('请输入车牌号.', {icon: 2, time: 2000}); - return false; - } - } else { - // 会员 - if(isNull(params.memberId)){ - winui.window.msg('请选择会员.', {icon: 2, time: 2000}); - return false; - } - if(isNull(params.memberCarId)){ - winui.window.msg('请选择车辆信息.', {icon: 2, time: 2000}); - return false; - } - } - - AjaxPostUtil.request({url: shopBasePath + "insertKeepFitOrder", params: params, type: 'json', method: "POST", callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}, function() { - location.reload(); - }); - }, async: true}); - } - return false; - }); - - // 新增行 - $("body").on("click", "#addRow", function() { - addRow(); - }); - - // 删除行 - $("body").on("click", "#deleteRow", function() { - deleteRow(); - }); - - // 新增行 - function addRow() { - var par = { - id: "row" + rowNum.toString(), //checkbox的id - trId: "tr" + rowNum.toString(), //行的id - consumeExplain: "consumeExplain" + rowNum.toString(), - price: "price" + rowNum.toString() - }; - $("#useTable").append(getDataUseHandlebars(usetableTemplate, par)); - form.render(); - rowNum++; - } - - // 删除行 - function deleteRow() { - var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']:checked"); - if(checkRow.length > 0) { - $.each(checkRow, function(i, item) { - // 移除界面上的信息 - $(item).parent().parent().remove(); - }); - calcAllPrice(); - } else { - winui.window.msg('请选择要删除的行', {icon: 2, time: 2000}); - } - } - - // 会员选择 - $("body").on("click", ".chooseMemberBtn", function (e) { - sysMemberUtil.openSysMemberChoosePage(function (memberMation){ - $("#memberId").val(memberMation.contacts); - var params = { - memberId: memberMation.id, - enabled: 1 - }; - // 获取会员拥有的车辆信息(已启用) - AjaxPostUtil.request({url: shopBasePath + "memberCar001", params: params, type: 'json', method: "POST", callback: function (json) { - $.each(json.rows, function (i, item) { - item.name = item.modelType + "(" + item.plate + ")"; - }); - $("#memberCar").html(getDataUseHandlebars(selOption, json)); - form.render('select'); - }, async: false}); - }); - }); - - $("body").on("input", ".calcPrice", function() { - calcAllPrice(); - }); - $("body").on("change", ".calcPrice", function() { - calcAllPrice(); - }); - - function calcAllPrice(){ - var allPrice = "0.00"; - $.each($("#useTable tr"), function(i, item) { - // 获取行编号 - var rowNum = $(item).attr("trcusid").replace("tr", ""); - allPrice = sum(allPrice, $("#price" + rowNum.toString()).val()); - }); - allPrice = sum(allPrice, $("#servicePrice").val()); - $("#allPrice").html(allPrice + "元"); - } - - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); - }); -}); \ No newline at end of file diff --git a/shop/src/main/resources/template/js/storeMembers/storeMembersList.js b/shop/src/main/resources/template/js/storeMembers/storeMembersList.js new file mode 100644 index 0000000000000000000000000000000000000000..37d4046d16f49725f2b5142d68eaf7fd06be42f1 --- /dev/null +++ b/shop/src/main/resources/template/js/storeMembers/storeMembersList.js @@ -0,0 +1,85 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'form', 'soulTable'], function (exports) { + winui.renderColor(); + var $ = layui.$, + form = layui.form, + table = layui.table, + soulTable = layui.soulTable; + var selTemplate = getFileContent('tpl/template/select-option.tpl'); + //门店会员 + // 加载当前用户所属门店 + AjaxPostUtil.request({url: sysMainMation.shopBasePath + "storeStaff005", params: {}, type: 'json', method: "GET", callback: function(json) { + $("#storeId").html(getDataUseHandlebars(selTemplate, json)); + form.render('select'); + initTable(); + }, async: false}); + + + + var storeId = ""; + form.on('select(storeId)', function(data) { + var thisRowValue = data.value; + storeId = isNull(thisRowValue) ? "" : thisRowValue; + loadTable(); + }); + + function initTable(){ + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: sysMainMation.shopBasePath + 'member001', + where: getTableParams(), + even: true, + 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 }, + ]], + done: function(json) { + matchingLanguage(); + soulTable.render(this); + + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入会员姓名", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }, `
+
`); + } + }); + } + + form.render(); + $("body").on("click", "#reloadTable", function() { + loadTable(); + }); + + function loadTable() { + table.reloadData("messageTable", {where: getTableParams()}); + } + + function getTableParams() { + let params = { + holderId: storeId, + }; + return $.extend(true, params, initTableSearchUtil.getSearchValue("messageTable")); + } + + exports('storeMembersList', {}); +}); diff --git a/shop/src/main/resources/template/tpl/keepFitOrder/keepFitOrderAdd.html b/shop/src/main/resources/template/tpl/keepFitOrder/keepFitOrderAdd.html deleted file mode 100644 index fd48b86c8a8f6c5ff364036510246345d480c511..0000000000000000000000000000000000000000 --- a/shop/src/main/resources/template/tpl/keepFitOrder/keepFitOrderAdd.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - -
-
-
- 保养订单信息
-
-
- -
- -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- - -
- -
- -
-
-
-
- - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/shop/src/main/resources/template/tpl/storeMembers/storeMembersList.html b/shop/src/main/resources/template/tpl/storeMembers/storeMembersList.html new file mode 100644 index 0000000000000000000000000000000000000000..42a52b77a671be0d61aff7882a3c6d13d8ec3ac6 --- /dev/null +++ b/shop/src/main/resources/template/tpl/storeMembers/storeMembersList.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file