提交 0619911c 编写于 作者: doc_wei's avatar doc_wei

门店信息设定完成

上级 60ca7c14
......@@ -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;
});
......
......@@ -54,7 +54,7 @@
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">维修基数(分钟)</label>
<div class="layui-input-block">
<input type="text" id="onlineBookRadix" name="onlineBookRadix" win-verify="required|number" placeholder="请输入维修基数" class="layui-input" value="{{onlineBookRadix}}"/>
<input type="text" id="onlineBookRadix" name="onlineBookRadix" win-verify="number" placeholder="请输入维修基数" class="layui-input" value="{{onlineBookRadix}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
......@@ -69,17 +69,30 @@
<div class="layui-input-block">
<div class="winui-toolbar">
<div class="winui-tool" style="text-align: left;">
<button id="calc" class="winui-toolbtn" type="button">计算</button>
<button id="calc" class="winui-toolbtn" type="button"><i class="fa fa-calculator" aria-hidden="true"></i>计算</button>
</div>
</div>
<div class=" layui-col-xs12" style="overflow-x: auto">
<table class="layui-table">
<thead>
<tr id="tableHead">
<th style="width: 30px;"></th>
{{#each onlineBookJson}}
<th>{{time}}</th>
{{/each}}
</tr>
</thead>
<tbody id="useTable" class="insurance-table">
<tr>
<td style="width: 30px;"></td>
{{#each onlineBookJson}}
<td>
<div style="width: 100px;">
<input type="text" id="td{{time}}" win-verify="required|number" placeholder="请输入数量" class="layui-input onlineJson" value="{{value}}"/>
</div>
</td>
{{/each}}
</tr>
</tbody>
</table>
</div>
......@@ -88,7 +101,7 @@
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" lay-submit lay-filter="formSaveBean"><language showName="com.skyeye.save"></language></button>
<button class="winui-btn" lay-submit lay-filter="formSaveBean" auth="1644129110388"><language showName="com.skyeye.save"></language></button>
</div>
</div>
{{/bean}}
......@@ -97,7 +110,7 @@
<script type="text/x-handlebars-template" id="tableHeadTemplate">
<th style="width: 30px;"></th>
{{#each rows}}
<th style="width: 150px;">{{this}}</th>
<th>{{this}}</th>
{{/each}}
</script>
......@@ -106,7 +119,7 @@
<td style="width: 30px;"></td>
{{#each rows}}
<td>
<div style="width: 150px;">
<div style="width: 100px;">
<input type="text" id="td{{this}}" win-verify="required|number" placeholder="请输入数量" class="layui-input onlineJson"/>
</div>
</td>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册