diff --git a/shop/src/main/resources/template/js/storeOnlineSetUp/storeOnlineSetUp.js b/shop/src/main/resources/template/js/storeOnlineSetUp/storeOnlineSetUp.js index 7a0f82e3c8f1c7a6f6e0a00f79ea601229679cde..95d9e10ae1314379c29ee0d77398707a1cd78db3 100644 --- a/shop/src/main/resources/template/js/storeOnlineSetUp/storeOnlineSetUp.js +++ b/shop/src/main/resources/template/js/storeOnlineSetUp/storeOnlineSetUp.js @@ -12,8 +12,6 @@ layui.config({ laydate = layui.laydate; var beanTemplate = $("#beanTemplate").html(); - authBtn('1643984717466'); - // 加载我所在的门店 shopUtil.queryStaffBelongStoreList(function (json){ $("#storeId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), json)); @@ -31,7 +29,13 @@ layui.config({ pagination: false, method: "GET", template: beanTemplate, - ajaxSendLoadBefore: function(hdb){}, + ajaxSendLoadBefore: function(hdb, json){ + if(isNull(json.bean.onlineBookJson)){ + json.bean.onlineBookJson = []; + }else{ + json.bean.onlineBookJson = JSON.parse(json.bean.onlineBookJson); + } + }, ajaxSendAfter:function(data){ var startTime = laydate.render({ @@ -73,6 +77,7 @@ layui.config({ $("input:radio[name=onlineBookAppoint][value=" + data.bean.onlineBookAppoint + "]").attr("checked", true); $("input:radio[name=onlineBookType][value=" + data.bean.onlineBookType + "]").attr("checked", true); + authBtn('1644129110388'); matchingLanguage(); form.render(); form.on('submit(formSaveBean)', function (data) { @@ -85,36 +90,40 @@ layui.config({ }; tableData.push(row); }); - var onlineBookAppoint = $("input[name='type']:checked").val(); + var onlineBookAppoint = $("input[name='onlineBookAppoint']:checked").val(); if(onlineBookAppoint == 1){ // 开启预约 if(isNull($("#onlineBookRadix").val())){ winui.window.msg('请输入维修基数', {icon: 2,time: 2000}); return false; } + if(tableData.length == 0){ + winui.window.msg('请计算时间段', {icon: 2,time: 2000}); + return false; + } + if(isNull($("input[name='onlineBookType']:checked").val())){ + winui.window.msg('请选择类型', {icon: 2,time: 2000}); + return false; + } } - console.log(tableData) - // var params = { - // title: $("#title").val(), - // logo: $("#logo").find("input[type='hidden'][name='upload']").attr("oldurl"), - // type: $("input[name='type']:checked").val(), - // price: $("#price").val(), - // mealNum: $("#mealNum").val(), - // mealExplain: $("#mealExplain").val(), - // state: $("input[name='state']:checked").val(), - // mealAreaMationList: JSON.stringify(mealAreaMationList), - // mealConsumeMationList: JSON.stringify(tableData), - // }; - // - // AjaxPostUtil.request({url: shopBasePath + "meal002", 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}); + var params = { + rowId: $("#storeId").val(), + businessStartTime: $("#businessStartTime").val(), + businessEndTime: $("#businessEndTime").val(), + onlineBookAppoint: $("input[name='onlineBookAppoint']:checked").val(), + onlineBookRadix: $("#onlineBookRadix").val(), + onlineBookType: $("input[name='onlineBookType']:checked").val(), + onlineBookJson: JSON.stringify(tableData) + }; + + AjaxPostUtil.request({url: shopBasePath + "store009", params: params, type: 'json', method: "POST", callback: function(json){ + if(json.returnCode == 0){ + winui.window.msg('保存成功', {icon: 1,time: 2000}); + }else{ + winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); + } + }, async: true}); } return false; }); diff --git a/shop/src/main/resources/template/tpl/storeOnlineSetUp/storeOnlineSetUp.html b/shop/src/main/resources/template/tpl/storeOnlineSetUp/storeOnlineSetUp.html index 82555aec2555de71b5a67785f33a468fc8e4cdd1..84ebc7627e214ab89a4a94031d626355f2217799 100644 --- a/shop/src/main/resources/template/tpl/storeOnlineSetUp/storeOnlineSetUp.html +++ b/shop/src/main/resources/template/tpl/storeOnlineSetUp/storeOnlineSetUp.html @@ -54,7 +54,7 @@
+ {{#each onlineBookJson}} + | {{time}} | + {{/each}}
---|---|
+ {{#each onlineBookJson}} + |
+
+
+
+ |
+ {{/each}}
+