From c4dd28014bc131ef60ed4c382e18ebffc9707090 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Tue, 8 Feb 2022 00:19:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E8=AE=A2=E5=8D=95=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=E5=AE=8C=E6=88=9070%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/js/member/memberList.js | 21 ++- .../template/tpl/member/memberList.html | 3 + .../resources/template/js/meal/mealChoose.js | 120 ++++++++++++ .../js/mealOrder/complatePayMealOrder.js | 48 +++++ .../js/mealOrder/memberMealOrderList.js | 142 ++++++++++++++ .../js/mealOrder/storeMealOrderAdd.js | 178 ++++++++++++++++++ .../js/mealOrder/storeMealOrderList.js | 111 +++++------ .../resources/template/tpl/meal/mealAdd.html | 2 +- .../template/tpl/meal/mealChoose.html | 41 ++++ .../resources/template/tpl/meal/mealEdit.html | 2 +- .../tpl/mealOrder/complatePayMealOrder.html | 34 ++++ .../tpl/mealOrder/memberMealOrderList.html | 46 +++++ .../tpl/mealOrder/storeMealOrderAdd.html | 100 ++++++++++ .../tpl/mealOrder/storeMealOrderList.html | 27 ++- 14 files changed, 792 insertions(+), 83 deletions(-) create mode 100644 shop/src/main/resources/template/js/meal/mealChoose.js create mode 100644 shop/src/main/resources/template/js/mealOrder/complatePayMealOrder.js create mode 100644 shop/src/main/resources/template/js/mealOrder/memberMealOrderList.js create mode 100644 shop/src/main/resources/template/js/mealOrder/storeMealOrderAdd.js create mode 100644 shop/src/main/resources/template/tpl/meal/mealChoose.html create mode 100644 shop/src/main/resources/template/tpl/mealOrder/complatePayMealOrder.html create mode 100644 shop/src/main/resources/template/tpl/mealOrder/memberMealOrderList.html create mode 100644 shop/src/main/resources/template/tpl/mealOrder/storeMealOrderAdd.html diff --git a/member/src/main/resources/template/js/member/memberList.js b/member/src/main/resources/template/js/member/memberList.js index e015b9d8e..4b796917a 100644 --- a/member/src/main/resources/template/js/member/memberList.js +++ b/member/src/main/resources/template/js/member/memberList.js @@ -1,5 +1,7 @@ var rowId = ""; +var memberMation = {}; + layui.config({ base: basePath, version: skyeyeVersion @@ -39,8 +41,7 @@ layui.config({ return "参数错误"; } }}, - { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 140 }, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar'} + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 300, toolbar: '#tableBar'} ]], done: function(){ matchingLanguage(); @@ -62,6 +63,8 @@ layui.config({ selectMember(data) }else if(layEvent == 'memberCar'){ //车辆信息 memberCar(data) + }else if(layEvent == 'mealList'){ //套餐购买信息 + mealList(data) } }); @@ -152,6 +155,20 @@ layui.config({ }); } + // 套餐购买信息 + function mealList(data){ + rowId = data.id; + memberMation = data; + _openNewWindows({ + url: "../../tpl/mealOrder/memberMealOrderList.html", + title: '套餐购买信息', + pageId: "memberMealOrderList", + area: ['90vw', '90vh'], + callBack: function(refreshCode){ + } + }); + } + //添加会员 $("body").on("click", "#addBean", function(){ _openNewWindows({ diff --git a/member/src/main/resources/template/tpl/member/memberList.html b/member/src/main/resources/template/tpl/member/memberList.html index dca44db58..36a25ab16 100644 --- a/member/src/main/resources/template/tpl/member/memberList.html +++ b/member/src/main/resources/template/tpl/member/memberList.html @@ -62,6 +62,9 @@ {{# if(auth('1644234235243')){ }} 车辆信息 {{# } }} + {{# if(auth('1644239451422')){ }} + 套餐购买 + {{# } }} diff --git a/shop/src/main/resources/template/js/meal/mealChoose.js b/shop/src/main/resources/template/js/meal/mealChoose.js new file mode 100644 index 000000000..ff44f7692 --- /dev/null +++ b/shop/src/main/resources/template/js/meal/mealChoose.js @@ -0,0 +1,120 @@ +var rowId = ""; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'form', 'fsCommon'], function (exports) { + winui.renderColor(); + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$, + form = layui.form, + table = layui.table; + + // 设置提示信息 + var s = "套餐选择规则:1.单选,双击指定行数据即可选中"; + s += '如没有查到要选择的套餐,请检查套餐信息是否满足当前规则。'; + $("#showInfo").html(s); + + initTable(); + function initTable(){ + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: shopBasePath + 'meal001', + where: getTableParams(), + even: true, + page: true, + limits: [8, 16, 24, 32, 40, 48, 56], + limit: 8, + cols: [[ + { type: 'radio'}, + { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'}, + { field: 'title', title: '套餐名称', align: 'left', width: 200, templet: function(d){ + return '' + d.title + ''; + }}, + { field: 'logo', title: 'LOGO', align: 'center', width: 60, templet: function(d){ + return ''; + }}, + { field: 'mealNum', title: '可使用次数', width: 120 }, + { field: 'type', title: '套餐分类', width: 100, align: "center", templet: function(d){ + if(d.type == 1){ + return "保养套餐"; + } + return "-"; + }}, + { field: 'price', title: '价格', width: 100 } + ]], + done: function(res, curr, count){ + matchingLanguage(); + $('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('dblclick',function(){ + var dubClick = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover"); + dubClick.find("input[type='radio']").prop("checked", true); + form.render(); + var chooseIndex = JSON.stringify(dubClick.data('index')); + var obj = res.rows[chooseIndex]; + parent.mealMation = obj; + + parent.refreshCode = '0'; + parent.layer.close(index); + }); + + $('#messageTable').next().find('.layui-table-body').find("table" ).find("tbody").children("tr").on('click',function(){ + var click = $('#messageTable').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover"); + click.find("input[type='radio']").prop("checked", true); + form.render(); + }) + } + }); + + table.on('tool(messageTable)', function (obj) { + var data = obj.data; + var layEvent = obj.event; + if (layEvent === 'select') { //详情 + details(data); + } + }); + + form.render(); + } + + // 详情 + function details(data){ + rowId = data.id; + _openNewWindows({ + url: "../../tpl/meal/mealInfo.html", + title: systemLanguage["com.skyeye.detailsPageTitle"][languageType], + pageId: "mealInfo", + area: ['90vw', '90vh'], + callBack: function(refreshCode){ + } + }); + } + + form.render(); + form.on('submit(formSearch)', function (data) { + if (winui.verifyForm(data.elem)) { + table.reload("messageTable", {page: {curr: 1}, where: getTableParams()}); + } + return false; + }); + + $("body").on("click", "#reloadTable", function(){ + loadTable(); + }); + + function loadTable(){ + table.reload("messageTable", {where: getTableParams()}); + } + + function getTableParams(){ + return { + title: $("#title").val(), + state: 2 + }; + } + + exports('mealChoose', {}); +}); \ No newline at end of file diff --git a/shop/src/main/resources/template/js/mealOrder/complatePayMealOrder.js b/shop/src/main/resources/template/js/mealOrder/complatePayMealOrder.js new file mode 100644 index 000000000..77a4d0b2b --- /dev/null +++ b/shop/src/main/resources/template/js/mealOrder/complatePayMealOrder.js @@ -0,0 +1,48 @@ + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui'], function (exports) { + winui.renderColor(); + layui.use(['form'], function (form) { + var index = parent.layer.getFrameIndex(window.name); + var $ = layui.$; + var orderNum = ""; + + AjaxPostUtil.request({url: shopBasePath + "mealOrder002", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function(json){ + if(json.returnCode == 0){ + orderNum = json.bean.orderNum; + $("#payPrice").val(json.bean.payablePrice); + }else{ + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); + } + }, async: false}); + + matchingLanguage(); + form.render(); + form.on('submit(formAddBean)', function (data) { + if (winui.verifyForm(data.elem)) { + var params = { + out_trade_no: orderNum, + total_fee: parseFloat($("#payPrice").val()).toFixed(2) * 100, + }; + + AjaxPostUtil.request({url: shopBasePath + "mealOrderNotify", params: params, type: 'json', method: "POST", callback: function(json){ + if(json.returnCode == 0){ + parent.layer.close(index); + parent.refreshCode = '0'; + }else{ + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); + } + }, async: true}); + } + return false; + }); + + $("body").on("click", "#cancle", function(){ + parent.layer.close(index); + }); + }); +}); \ No newline at end of file diff --git a/shop/src/main/resources/template/js/mealOrder/memberMealOrderList.js b/shop/src/main/resources/template/js/mealOrder/memberMealOrderList.js new file mode 100644 index 000000000..3d5de27fb --- /dev/null +++ b/shop/src/main/resources/template/js/mealOrder/memberMealOrderList.js @@ -0,0 +1,142 @@ +var rowId = ""; + +var memberMation = {}; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).extend({ + window: 'js/winui.window' +}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { + winui.renderColor(); + var $ = layui.$, + form = layui.form, + table = layui.table; + authBtn('1644239500255'); + + memberMation = parent.memberMation; + + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: shopBasePath + 'mealOrder001', + where: getTableParams(), + even: true, + page: true, + limits: getLimits(), + limit: getLimit(), + cols: [[ + { title: systemLanguage["com.skyeye.serialNumber"][languageType], fixed: 'left', type: 'numbers'}, + { field: 'orderNum', title: '订单号', align: 'left', width: 180, fixed: 'left', templet: function(d){ + return '' + d.orderNum + ''; + }}, + { field: 'contacts', title: '会员名称', width: 100 }, + { field: 'phone', title: '会员手机号', width: 100, align: "center"}, + { field: 'payablePrice', title: '应付金额', width: 100, align: "left"}, + { field: 'state', title: '支付状态', width: 80, align: "center", templet: function(d){ + if(d.state == 1){ + return "待支付"; + }else{ + return "已支付"; + } + }}, + { field: 'payPrice', title: '实付金额', width: 100, align: "left"}, + { field: 'payTime', title: '实付日期', align: 'center', width: 150 }, + { field: 'type', title: '订单来源', width: 80, align: "center", templet: function(d){ + if(d.type == 1){ + return "线上下单"; + }else{ + return "线下下单"; + } + }}, + { field: 'createName', title: '录入人', width: 120 }, + { field: 'createTime', title: '单据日期', align: 'center', width: 150 }, + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar'} + ]], + done: function(){ + matchingLanguage(); + } + }); + + table.on('tool(messageTable)', function (obj) { + var data = obj.data; + var layEvent = obj.event; + if (layEvent === 'delete') { // 删除 + delet(data); + }else if(layEvent == 'select'){ // 详情 + select(data) + } + }); + + // 删除 + function delet(data){ + layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){ + layer.close(index); + AjaxPostUtil.request({url: shopBasePath + "deleteMealOrder", params: {id: data.id}, type: 'json', method: "DELETE", callback: function(json){ + if(json.returnCode == 0){ + winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); + loadTable(); + }else{ + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); + } + }}); + }); + } + + // 详情 + function select(data){ + rowId = data.id; + _openNewWindows({ + url: "../../tpl/meal/mealInfo.html", + title: systemLanguage["com.skyeye.detailsPageTitle"][languageType], + pageId: "mealInfo", + area: ['90vw', '90vh'], + callBack: function(refreshCode){ + } + }); + } + + // 添加 + $("body").on("click", "#addBean", function(){ + _openNewWindows({ + url: "../../tpl/mealOrder/storeMealOrderAdd.html", + title: systemLanguage["com.skyeye.addPageTitle"][languageType], + pageId: "storeMealOrderAdd", + area: ['90vw', '90vh'], + callBack: function(refreshCode){ + if (refreshCode == '0') { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1,time: 2000}); + loadTable(); + } else if (refreshCode == '-9999') { + winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); + } + }}); + }); + + form.render(); + form.on('submit(formSearch)', function (data) { + if (winui.verifyForm(data.elem)) { + table.reload("messageTable", {page: {curr: 1}, where: getTableParams()}) + } + return false; + }); + + $("body").on("click", "#reloadTable", function() { + loadTable(); + }); + + // 刷新 + function loadTable(){ + table.reload("messageTable", {where: getTableParams()}); + } + + function getTableParams(){ + return { + orderNum: $("#orderNum").val(), + memberId: memberMation.id + }; + } + + exports('memberMealOrderList', {}); +}); diff --git a/shop/src/main/resources/template/js/mealOrder/storeMealOrderAdd.js b/shop/src/main/resources/template/js/mealOrder/storeMealOrderAdd.js new file mode 100644 index 000000000..5dc63a2d0 --- /dev/null +++ b/shop/src/main/resources/template/js/mealOrder/storeMealOrderAdd.js @@ -0,0 +1,178 @@ + + +// 表格的序号 +var rowNum = 1; + +// 会员信息 +var memberMation = {}; + +// 已选择的套餐信息 +var mealMation = {}; + +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 memberCarHtml = ""; + + memberMation = parent.memberMation; + $("#memberName").html(memberMation.contacts); + + // 加载我所在的门店 + shopUtil.queryStaffBelongStoreList(function (json){ + $("#storeId").html(getDataUseHandlebars($("#selectTemplate").html(), json)); + }); + + textool.init({ + eleId: 'remark', + maxlength: 400, + tools: ['count', 'copy', 'reset', 'clear'] + }); + + // 获取会员拥有的车辆信息 + AjaxPostUtil.request({url: shopBasePath + "memberCar001", params: {memberId: memberMation.id}, type: 'json', method: "POST", callback: function(json){ + if(json.returnCode == 0){ + $.each(json.rows, function (i, item){ + item.name = item.modelType + "(" + item.plate + ")"; + }); + memberCarHtml = getDataUseHandlebars(selOption, json); + }else{ + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); + } + }, async: false}); + + addRow(); + 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 mealMation = JSON.parse($("#mealId" + rowNum.toString()).attr("mealMaion")); + var row = { + mealId: mealMation.id, + memberCarId: $("#carId" + rowNum.toString()).val() + }; + tableData.push(row); + }); + if(tableData.length == 0){ + winui.window.msg('请填写套餐信息.', {icon: 2,time: 2000}); + return false; + } + + var params = { + storeId: $("#storeId").val(), + memberId: memberMation.id, + remark: $("#remark").val(), + type: 1, + source: 2, + mealList: JSON.stringify(tableData) + }; + + AjaxPostUtil.request({url: shopBasePath + "insertMealOrder", params: params, type: 'json', method: "POST", callback: function(json){ + if(json.returnCode == 0){ + parent.layer.close(index); + parent.refreshCode = '0'; + }else{ + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); + } + }, 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 + mealId: "mealId" + rowNum.toString(), + num: "num" + rowNum.toString(), + price: "price" + rowNum.toString(), + carId: "carId" + rowNum.toString() + }; + $("#useTable").append(getDataUseHandlebars(usetableTemplate, par)); + $("#carId" + rowNum.toString()).html(memberCarHtml); + 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", ".chooseMealBtn", function(e){ + var trId = $(this).parent().parent().attr("trcusid"); + _openNewWindows({ + url: "../../tpl/meal/mealChoose.html", + title: "选择套餐", + pageId: "mealChoose", + area: ['90vw', '90vh'], + callBack: function(refreshCode){ + if (refreshCode == '0') { + // 获取表格行号 + var thisRowNum = trId.replace("tr", ""); + + $("#mealId" + thisRowNum.toString()).val(mealMation.title); + $("#num" + thisRowNum.toString()).html(mealMation.mealNum); + $("#price" + thisRowNum.toString()).html(mealMation.price); + $("#mealId" + thisRowNum.toString()).attr("mealMaion", JSON.stringify(mealMation)); + calcAllPrice(); + } else if (refreshCode == '-9999') { + winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); + } + }}); + }); + + function calcAllPrice(){ + var allPrice = "0.00"; + $.each($("#useTable tr"), function(i, item) { + // 获取行编号 + var rowNum = $(item).attr("trcusid").replace("tr", ""); + var mealMationJson = $("#mealId" + rowNum.toString()).attr("mealMaion"); + if(!isNull(mealMationJson)){ + var mealMation = JSON.parse(mealMationJson); + allPrice = sum(allPrice, mealMation.unformatPrice); + } + }); + $("#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/mealOrder/storeMealOrderList.js b/shop/src/main/resources/template/js/mealOrder/storeMealOrderList.js index 03dd2eb70..13e76db5e 100644 --- a/shop/src/main/resources/template/js/mealOrder/storeMealOrderList.js +++ b/shop/src/main/resources/template/js/mealOrder/storeMealOrderList.js @@ -10,7 +10,6 @@ layui.config({ var $ = layui.$, form = layui.form, table = layui.table; - authBtn('1644054570044'); // 加载我所在的门店 shopUtil.queryStaffBelongStoreList(function (json){ @@ -21,7 +20,7 @@ layui.config({ id: 'messageTable', elem: '#messageTable', method: 'post', - url: shopBasePath + 'meal001', + url: shopBasePath + 'mealOrder001', where: getTableParams(), even: true, page: true, @@ -29,31 +28,30 @@ layui.config({ limit: getLimit(), cols: [[ { title: systemLanguage["com.skyeye.serialNumber"][languageType], fixed: 'left', type: 'numbers'}, - { field: 'title', title: '套餐名称', align: 'left', width: 200, fixed: 'left', templet: function(d){ - return '' + d.title + ''; + { field: 'orderNum', title: '订单号', align: 'left', width: 180, fixed: 'left', templet: function(d){ + return '' + d.orderNum + ''; }}, - { field: 'logo', title: 'LOGO', align: 'center', width: 60, templet: function(d){ - return ''; - }}, - { field: 'mealNum', title: '可使用次数', width: 120 }, - { field: 'type', title: '套餐分类', width: 100, align: "center", templet: function(d){ - if(d.type == 1){ - return "保养套餐"; - } - return "-"; - }}, - { field: 'state', title: '状态', width: 80, align: "center", templet: function(d){ - if(d.state == 1){ - return "下线"; - }else{ - return "上线"; - } - }}, - { field: 'price', title: '价格', width: 100 }, - { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 }, - { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, - { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, - { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150}, + { field: 'contacts', title: '会员名称', width: 100 }, + { field: 'phone', title: '会员手机号', width: 100, align: "center"}, + { field: 'payablePrice', title: '应付金额', width: 100, align: "left"}, + { field: 'state', title: '支付状态', width: 80, align: "center", templet: function(d){ + if(d.state == 1){ + return "待支付"; + }else{ + return "已支付"; + } + }}, + { field: 'payPrice', title: '实付金额', width: 100, align: "left"}, + { field: 'payTime', title: '实付日期', align: 'center', width: 150 }, + { field: 'type', title: '订单来源', width: 80, align: "center", templet: function(d){ + if(d.type == 1){ + return "线上下单"; + }else{ + return "线下下单"; + } + }}, + { field: 'createName', title: '录入人', width: 120 }, + { field: 'createTime', title: '单据日期', align: 'center', width: 150 }, { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar'} ]], done: function(){ @@ -64,47 +62,27 @@ layui.config({ table.on('tool(messageTable)', function (obj) { var data = obj.data; var layEvent = obj.event; - if (layEvent === 'edit') { // 编辑 - edit(data); - }else if (layEvent === 'delete') { // 删除 + if (layEvent === 'delete') { // 删除 delet(data); }else if(layEvent == 'select'){ // 详情 select(data) - }else if (layEvent === 'logo') { // logo预览 - systemCommonUtil.showPicImg(fileBasePath + data.logo); + }else if(layEvent == 'complatePay'){ // 完成支付 + complatePay(data) } }); - // 编辑 - function edit(data){ - rowId = data.id; - _openNewWindows({ - url: "../../tpl/meal/mealEdit.html", - title: systemLanguage["com.skyeye.editPageTitle"][languageType], - pageId: "mealEdit", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1,time: 2000}); - loadTable(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); - } - // 删除 function delet(data){ layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){ layer.close(index); - AjaxPostUtil.request({url: shopBasePath + "meal004", params: {rowId: data.id}, type: 'json', method: "DELETE", callback: function(json){ - if(json.returnCode == 0){ - winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadTable(); - }else{ - winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); - } - }}); + AjaxPostUtil.request({url: shopBasePath + "deleteMealOrder", params: {id: data.id}, type: 'json', method: "DELETE", callback: function(json){ + if(json.returnCode == 0){ + winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); + loadTable(); + }else{ + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); + } + }}); }); } @@ -121,12 +99,13 @@ layui.config({ }); } - // 添加 - $("body").on("click", "#addBean", function(){ + // 完成支付 + function complatePay(data){ + rowId = data.id; _openNewWindows({ - url: "../../tpl/meal/mealAdd.html", - title: systemLanguage["com.skyeye.addPageTitle"][languageType], - pageId: "mealAdd", + url: "../../tpl/mealOrder/complatePayMealOrder.html", + title: '完成支付', + pageId: "complatePayMealOrder", area: ['90vw', '90vh'], callBack: function(refreshCode){ if (refreshCode == '0') { @@ -136,7 +115,7 @@ layui.config({ winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); } }}); - }); + } form.render(); form.on('submit(formSearch)', function (data) { @@ -156,11 +135,15 @@ layui.config({ } function getTableParams(){ + var storeId = $("#storeId").val(); + if(isNull(storeId)){ + storeId = "-"; + } return { orderNum: $("#orderNum").val(), memberName: $("#memberName").val(), memberPhone: $("#memberPhone").val(), - memberPlate: $("#memberPlate").val() + storeId: storeId }; } diff --git a/shop/src/main/resources/template/tpl/meal/mealAdd.html b/shop/src/main/resources/template/tpl/meal/mealAdd.html index 6831223a6..fa5707810 100644 --- a/shop/src/main/resources/template/tpl/meal/mealAdd.html +++ b/shop/src/main/resources/template/tpl/meal/mealAdd.html @@ -30,7 +30,7 @@