|
|
|
@ -18,47 +18,50 @@ |
|
|
|
<form class="layui-form layui-form-pane" action=""> |
|
|
|
<div class="layui-form-item"> |
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">开始日期</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input type="text" name="applyTime" id="date" placeholder="请选择开始日期" |
|
|
|
autocomplete="off" class="layui-input"> |
|
|
|
<label class="layui-form-label">申请时间</label> |
|
|
|
<div class="layui-input-inline" style="width: 100px;"> |
|
|
|
<input type="text" id="startDate" name="startDate" autocomplete="off" placeholder="开始日期" class="layui-input"> |
|
|
|
</div> |
|
|
|
<div class="layui-form-mid">-</div> |
|
|
|
<div class="layui-input-inline" style="width: 100px;"> |
|
|
|
<input type="text" id="endDate" name="endDate" autocomplete="off" placeholder="结束日期" class="layui-input"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">仓库</label> |
|
|
|
<div class="layui-input-inline"> |
|
|
|
<!--<select name="depositoryId" > |
|
|
|
<option value="" selected>请选择仓库</option> |
|
|
|
<option th:each="depository,iterStar:${depositories}" th:value="${depository?.getId()}" th:text="${depository?.getDname()}" >外芯仓库</option> |
|
|
|
</select>--> |
|
|
|
<input type="text" placeholder="请选择仓库" class="layui-input" id="openSonByDepository" |
|
|
|
readonly/> |
|
|
|
<input type="text" name="depositoryId" class="layui-input" id="depositoryId" |
|
|
|
style="display: none"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">记录编码</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input type="text" class="layui-input" id="code" name="code" autocomplete="off"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">物料名称:</label> |
|
|
|
<div class="layui-input-inline"> |
|
|
|
<input id="openSonByMaterial" readonly type="text" placeholder="请填写物料名称" |
|
|
|
class="layui-input" onclick="selectMaterialByName(this)"/> |
|
|
|
<input id="mid" name="mid" readonly type="text" placeholder="请填写物料名称" |
|
|
|
class="layui-input" style="display:none;"/> |
|
|
|
<input id="mname" name="mname" type="text" placeholder="请填写物料名称" |
|
|
|
class="layui-input" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">存货编码</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input type="text" name="code" autocomplete="off" class="layui-input"> |
|
|
|
<input type="text" name="mcode" autocomplete="off" class="layui-input"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="layui-inline"> |
|
|
|
<label class="layui-form-label">型号</label> |
|
|
|
<div class="layui-input-block"> |
|
|
|
<input type="text" class="layui-input" id="version" name="version" autocomplete="off"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="layui-inline"> |
|
|
|
<button type="submit" class="layui-btn layui-btn-primary" lay-submit |
|
|
|
lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索 |
|
|
|
@ -72,7 +75,9 @@ |
|
|
|
<script type="text/html" id="toolbarDemo"> |
|
|
|
<div class="layui-btn-container"> |
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加</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" |
|
|
|
th:style="'display:'+${display}"> 删除 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</script> |
|
|
|
|
|
|
|
@ -80,7 +85,8 @@ |
|
|
|
|
|
|
|
<script type="text/html" id="currentTableBar"> |
|
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="detail">详情</a> |
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete" th:style="'display:'+${display}">删除</a> |
|
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete" |
|
|
|
th:style="'display:'+${display}">删除</a> |
|
|
|
</script> |
|
|
|
|
|
|
|
</div> |
|
|
|
@ -110,12 +116,12 @@ |
|
|
|
move: '.layui-layer-title', |
|
|
|
fixed: false, |
|
|
|
content: '/selectDepository?type=2', |
|
|
|
success: function(layero, index){ |
|
|
|
success: function (layero, index) { |
|
|
|
var children = layero.children(); |
|
|
|
var content = $(children[1]); |
|
|
|
var iframeChildren = $(content.children()); |
|
|
|
content.css('height','100%'); |
|
|
|
iframeChildren.css('height','100%'); |
|
|
|
content.css('height', '100%'); |
|
|
|
iframeChildren.css('height', '100%'); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -135,12 +141,12 @@ |
|
|
|
content: '/getMaterialAll?type=1&mname=""', |
|
|
|
move: '.layui-layer-title', |
|
|
|
fixed: false, |
|
|
|
success: function(layero, index){ |
|
|
|
success: function (layero, index) { |
|
|
|
var children = layero.children(); |
|
|
|
var content = $(children[1]); |
|
|
|
var iframeChildren = $(content.children()); |
|
|
|
content.css('height','100%'); |
|
|
|
iframeChildren.css('height','100%'); |
|
|
|
content.css('height', '100%'); |
|
|
|
iframeChildren.css('height', '100%'); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
@ -148,7 +154,10 @@ |
|
|
|
|
|
|
|
//日期 |
|
|
|
laydate.render({ |
|
|
|
elem: '#date' |
|
|
|
elem: '#startDate' |
|
|
|
}); //日期 |
|
|
|
laydate.render({ |
|
|
|
elem: '#endDate' |
|
|
|
}); |
|
|
|
table.render({ |
|
|
|
elem: "#currentTableId", |
|
|
|
@ -209,7 +218,7 @@ |
|
|
|
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"} |
|
|
|
] |
|
|
|
], |
|
|
|
limits: [10, 15, 20, 25, 50,100], |
|
|
|
limits: [10, 15, 20, 25, 50, 100], |
|
|
|
limit: 10, |
|
|
|
page: true, |
|
|
|
skin: 'line', |
|
|
|
@ -227,13 +236,22 @@ |
|
|
|
if (data.depositoryId !== '') { |
|
|
|
req.depositoryId = data.depositoryId; |
|
|
|
} |
|
|
|
if (data.applyTime !== '') { |
|
|
|
req.applyTime = data.applyTime; |
|
|
|
if (data.startDate !== '') { |
|
|
|
req.startDate = data.startDate; |
|
|
|
}if (data.endDate !== '') { |
|
|
|
req.endDate = data.endDate; |
|
|
|
} |
|
|
|
if (data.mcode !== '') { |
|
|
|
req.mcode = data.mcode; |
|
|
|
} |
|
|
|
if (data.code !== '') { |
|
|
|
req.code = data.code; |
|
|
|
} |
|
|
|
if (data.code !== '') { |
|
|
|
if (data.mname !== '') { |
|
|
|
req.mname = data.mname; |
|
|
|
} |
|
|
|
|
|
|
|
if (data.version !== '') { |
|
|
|
req.version = data.version; |
|
|
|
} |
|
|
|
//执行搜索重载 |
|
|
|
@ -275,35 +293,72 @@ |
|
|
|
if (req.ids.length > 0) { |
|
|
|
layer.confirm('真的删除么', {icon: 2, title: '提示'}, function (index) { |
|
|
|
$.ajax({ |
|
|
|
url: '/depositoryRecord/deleteApplicationOutRecord', |
|
|
|
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);//失败的表情 |
|
|
|
url: 'depositoryRecord/judgeApplicationOutRecordStatus', |
|
|
|
type: 'post', |
|
|
|
dataType: 'json', |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
data: JSON.stringify(req), |
|
|
|
success: function (res) { |
|
|
|
let status = res.status; |
|
|
|
let res_data = res.data; |
|
|
|
if(status === 2){ |
|
|
|
if(res_data.length === 0){ |
|
|
|
layer.confirm("该操作会造成不可逆的后果,确定删除?",{ |
|
|
|
icon:2, |
|
|
|
title:"提示" |
|
|
|
},function () { |
|
|
|
$.ajax({ |
|
|
|
url: '/depositoryRecord/deleteApplicationOutRecord', |
|
|
|
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秒) |
|
|
|
}); |
|
|
|
//执行搜索重载 |
|
|
|
table.reload('currentTableId', { |
|
|
|
url: '/depositoryRecord/applicationOutView', |
|
|
|
page: { |
|
|
|
curr: 1 |
|
|
|
} else { |
|
|
|
layer.msg("删除成功", { |
|
|
|
icon: 6,//成功的表情 |
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
}); |
|
|
|
//执行搜索重载 |
|
|
|
table.reload('currentTableId', { |
|
|
|
url: '/depositoryRecord/applicationOutView', |
|
|
|
page: { |
|
|
|
curr: 1 |
|
|
|
} |
|
|
|
}, 'data'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
else { |
|
|
|
let msg = "申请编码为:"; |
|
|
|
$.each(res_data,function (index_num,item_num) { |
|
|
|
$.each(data,function (index,item) { |
|
|
|
if(item_num === item.id){ |
|
|
|
msg += item.code+","; |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
msg += "的出库记录正在出库中,不允许删除"; |
|
|
|
layer.msg(msg,{ |
|
|
|
icon:2, |
|
|
|
time:1500 |
|
|
|
}) |
|
|
|
} |
|
|
|
}, 'data'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
) |
|
|
|
|
|
|
|
}); |
|
|
|
} else { |
|
|
|
layer.msg("未选中记录,请确认!"); |
|
|
|
@ -338,28 +393,53 @@ |
|
|
|
req.id = data.id; |
|
|
|
layer.confirm('真的删除么', {icon: 2, title: '提示'}, function (index) { |
|
|
|
$.ajax({ |
|
|
|
url: 'depositoryRecord/deleteApplicationOutRecord', |
|
|
|
url: 'depositoryRecord/judgeApplicationOutRecordStatus', |
|
|
|
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);//失败的表情 |
|
|
|
success: function (res) { |
|
|
|
let data = res.data; |
|
|
|
let status = res.status; |
|
|
|
if (status === 1) { |
|
|
|
if (data) { |
|
|
|
// 如果可以删除 |
|
|
|
layer.confirm('该操作将造成不可逆的后果,是否删除?', {icon: 2, title: '提示'}, function (index) { |
|
|
|
$.ajax({ |
|
|
|
url: 'depositoryRecord/deleteApplicationOutRecord', |
|
|
|
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 { |
|
|
|
obj.del(); |
|
|
|
layer.msg("删除成功", { |
|
|
|
icon: 6,//成功的表情 |
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
}); |
|
|
|
} else { |
|
|
|
obj.del(); |
|
|
|
layer.msg("删除成功", { |
|
|
|
icon: 6,//成功的表情 |
|
|
|
time: 500 //1秒关闭(如果不配置,默认是3秒) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 如果不可以删除 |
|
|
|
layer.msg("该出库正在进行中,不允许删除", { |
|
|
|
icon: 0, |
|
|
|
time: 1500 |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|