|
|
@ -74,7 +74,7 @@ |
|
|
<script type="text/html" id="toolbarDemo"> |
|
|
<script type="text/html" id="toolbarDemo"> |
|
|
<div class="layui-btn-container"> |
|
|
<div class="layui-btn-container"> |
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add" th:style="'display:'+${display}"> 添加</button> |
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add" th:style="'display:'+${display}"> 添加</button> |
|
|
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete" th:style="'display:'+${display}"> 删除</button> |
|
|
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete" id="display" th:style="'display:'+${display}"> 删除</button> |
|
|
</div> |
|
|
</div> |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
@ -397,114 +397,119 @@ |
|
|
|
|
|
|
|
|
//监听状态操作 |
|
|
//监听状态操作 |
|
|
form.on('switch(changeState)', function (obj) { |
|
|
form.on('switch(changeState)', function (obj) { |
|
|
var req = new Map; |
|
|
let display = $("#display").css("display"); |
|
|
req["id"] = this.value; |
|
|
if(display !== "none"){ |
|
|
if (obj.elem.checked) { |
|
|
var req = new Map; |
|
|
req["state"] = 1; |
|
|
req["id"] = this.value; |
|
|
$.ajax({ |
|
|
if (obj.elem.checked) { |
|
|
url: "/split/split_edit", |
|
|
req["state"] = 1; |
|
|
type: 'post', |
|
|
$.ajax({ |
|
|
dataType: 'json', |
|
|
url: "/split/split_edit", |
|
|
contentType: "application/json;charset=utf-8", |
|
|
type: 'post', |
|
|
data: JSON.stringify(req), |
|
|
dataType: 'json', |
|
|
beforeSend: function () { |
|
|
contentType: "application/json;charset=utf-8", |
|
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|
|
data: JSON.stringify(req), |
|
|
}, |
|
|
beforeSend: function () { |
|
|
success: function (data) { |
|
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|
|
layer.close(this.layerIndex); |
|
|
}, |
|
|
if (data.status >= 300) { |
|
|
success: function (data) { |
|
|
layer.msg(data.statusInfo.message);//失败的表情 |
|
|
layer.close(this.layerIndex); |
|
|
|
|
|
if (data.status >= 300) { |
|
|
} else { |
|
|
layer.msg(data.statusInfo.message);//失败的表情 |
|
|
layer.msg("修改成功", { |
|
|
|
|
|
icon: 6,//成功的表情 |
|
|
} else { |
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
layer.msg("修改成功", { |
|
|
}, function () { |
|
|
icon: 6,//成功的表情 |
|
|
window.location = '/split_out' |
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
}) |
|
|
}, function () { |
|
|
|
|
|
window.location = '/split_out' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/split/findAllSplitInfoForbidden", |
|
|
|
|
|
type: 'post', |
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: JSON.stringify(req), |
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
data = data.data; |
|
|
|
|
|
if(data){ |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/split/split_edit", |
|
|
|
|
|
type: 'post', |
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: JSON.stringify(req), |
|
|
|
|
|
beforeSend: function () { |
|
|
|
|
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|
|
|
|
|
}, |
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
layer.close(this.layerIndex); |
|
|
|
|
|
if (data.status >= 300) { |
|
|
|
|
|
layer.msg(data.statusInfo.message);//失败的表情 |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
layer.msg("修改成功", { |
|
|
|
|
|
icon: 6,//成功的表情 |
|
|
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
|
|
}, function () { |
|
|
|
|
|
window.location = '/split_out' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
layer.confirm('该拆单正在使用中,是否禁用?', { |
|
|
|
|
|
btn: ['继续', '取消'] //按钮 |
|
|
|
|
|
}, function () { |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/split/split_edit", |
|
|
|
|
|
type: 'post', |
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: JSON.stringify(req), |
|
|
|
|
|
beforeSend: function () { |
|
|
|
|
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|
|
|
|
|
}, |
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
layer.close(this.layerIndex); |
|
|
|
|
|
if (data.status >= 300) { |
|
|
|
|
|
layer.msg(data.statusInfo.message);//失败的表情 |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
layer.msg("修改成功", { |
|
|
|
|
|
icon: 6,//成功的表情 |
|
|
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
|
|
}, function () { |
|
|
|
|
|
window.location = '/split_out' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, function () { |
|
|
|
|
|
// 执行重加载 |
|
|
|
|
|
table.reload('currentTableId', { |
|
|
|
|
|
url: '/split/split_out', |
|
|
|
|
|
page: { |
|
|
|
|
|
curr: 1 |
|
|
|
|
|
} |
|
|
|
|
|
},'data'); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/split/findAllSplitInfoForbidden", |
|
|
|
|
|
type: 'post', |
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: JSON.stringify(req), |
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
data = data.data; |
|
|
|
|
|
if(data){ |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/split/split_edit", |
|
|
|
|
|
type: 'post', |
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: JSON.stringify(req), |
|
|
|
|
|
beforeSend: function () { |
|
|
|
|
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|
|
|
|
|
}, |
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
layer.close(this.layerIndex); |
|
|
|
|
|
if (data.status >= 300) { |
|
|
|
|
|
layer.msg(data.statusInfo.message);//失败的表情 |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
layer.msg("修改成功", { |
|
|
|
|
|
icon: 6,//成功的表情 |
|
|
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
|
|
}, function () { |
|
|
|
|
|
window.location = '/split_out' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
layer.confirm('该拆单正在使用中,是否禁用?', { |
|
|
|
|
|
btn: ['继续', '取消'] //按钮 |
|
|
|
|
|
}, function () { |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
url: "/split/split_edit", |
|
|
|
|
|
type: 'post', |
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: JSON.stringify(req), |
|
|
|
|
|
beforeSend: function () { |
|
|
|
|
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
|
|
|
|
|
}, |
|
|
|
|
|
success: function (data) { |
|
|
|
|
|
layer.close(this.layerIndex); |
|
|
|
|
|
if (data.status >= 300) { |
|
|
|
|
|
layer.msg(data.statusInfo.message);//失败的表情 |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
layer.msg("修改成功", { |
|
|
|
|
|
icon: 6,//成功的表情 |
|
|
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
|
|
}, function () { |
|
|
|
|
|
window.location = '/split_out' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, function () { |
|
|
|
|
|
// 执行重加载 |
|
|
|
|
|
table.reload('currentTableId', { |
|
|
|
|
|
url: '/split/split_out', |
|
|
|
|
|
page: { |
|
|
|
|
|
curr: 1 |
|
|
|
|
|
} |
|
|
|
|
|
},'data'); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -532,10 +537,6 @@ |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$('body').on('click', '[data-refresh]', function () { |
|
|
|
|
|
location.reload(); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|