|
|
|
@ -17,6 +17,7 @@ |
|
|
|
margin-top: -10px; |
|
|
|
margin-left: -15px; |
|
|
|
} |
|
|
|
|
|
|
|
/* .laytable-cell-1-0-7 { |
|
|
|
overflow: visible !important; |
|
|
|
} |
|
|
|
@ -24,19 +25,18 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
<div class="layuimini-container"> |
|
|
|
<div class="layuimini-main"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script id="toolbarDemo" type="text/html"> |
|
|
|
<div class="layui-btn-container"> |
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="delete">删除</button> |
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="applicationIn">入库</button> |
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="applicationOut">出库申请</button> |
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="applicationIn">入库 |
|
|
|
</button> |
|
|
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="applicationOut">出库申请 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</script> |
|
|
|
|
|
|
|
@ -48,11 +48,15 @@ |
|
|
|
|
|
|
|
<!-- 用于计量单位的展示--> |
|
|
|
<script id="changeUnit" type="text/html"> |
|
|
|
<button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="changeUnit" click_num="0" id="btn_unit_{{d.iid}}" value="-1">{{d.showUnit}}</button> |
|
|
|
<button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="changeUnit" click_num="0" |
|
|
|
id="btn_unit_{{d.iid}}" value="-1">{{d.showUnit}} |
|
|
|
</button> |
|
|
|
</script> |
|
|
|
|
|
|
|
<script id="selectLocation" type="text/html"> |
|
|
|
<button class="layui-btn layui-btn-primary layui-btn-xs" click_num="0" lay-event="selectLocation" id="btn_placeCode_{{d.iid}}" value="{{d.placeCode}}">{{d.placeCode}}</button> |
|
|
|
<button class="layui-btn layui-btn-primary layui-btn-xs" click_num="0" lay-event="selectLocation" |
|
|
|
id="btn_placeCode_{{d.iid}}" value="{{d.placeCode}}">{{d.placeCode}} |
|
|
|
</button> |
|
|
|
</script> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -120,6 +124,19 @@ |
|
|
|
|
|
|
|
table.on('edit(currentTableFilter)', function (obj) { //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值" |
|
|
|
// console.log(obj.data); //所在行的所有相关数据 |
|
|
|
let data = obj.data; |
|
|
|
let quantity = data.quantity; |
|
|
|
let mcode = data.code; |
|
|
|
let unit = data.unit; |
|
|
|
let depositoryId = data.depositoryId; |
|
|
|
let req = {}; |
|
|
|
req.mcode = mcode; |
|
|
|
req.quantity = quantity; |
|
|
|
req.unit = unit; |
|
|
|
req.placeId = -1; |
|
|
|
req.depositoryId = depositoryId; |
|
|
|
MaterialQuantityIsTrue(req,obj); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
/** |
|
|
|
@ -178,13 +195,11 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
else{ |
|
|
|
} else { |
|
|
|
layer.msg("未选中记录,请确认!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
else if(obj.event === 'applicationIn'){ |
|
|
|
} else if (obj.event === 'applicationIn') { |
|
|
|
req.type = 'in'; |
|
|
|
$.ajax({ |
|
|
|
url: "/depositoryRecord/createMultiApplications", |
|
|
|
@ -210,8 +225,7 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
return false; |
|
|
|
} |
|
|
|
else if(obj.event === 'applicationOut'){ |
|
|
|
} else if (obj.event === 'applicationOut') { |
|
|
|
req.type = 'out'; |
|
|
|
$.ajax({ |
|
|
|
url: "/depositoryRecord/createMultiApplications", |
|
|
|
@ -242,8 +256,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
return |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
layer.msg("申请成功!", { |
|
|
|
icon: 6,//成功的表情 |
|
|
|
time: 1000 |
|
|
|
@ -295,8 +308,7 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
return false; |
|
|
|
} |
|
|
|
else if(obj.event === 'applicationOut'){ |
|
|
|
} else if (obj.event === 'applicationOut') { |
|
|
|
// 出库申请 |
|
|
|
var req = data; |
|
|
|
req.type = "out"; |
|
|
|
@ -330,8 +342,7 @@ |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else if (obj.event === 'changeUnit') { |
|
|
|
} else if (obj.event === 'changeUnit') { |
|
|
|
let splitInfoList = data.splitInfoList; |
|
|
|
let btn = $("#btn_unit_" + data.iid); |
|
|
|
let clickNum = Number(btn.attr("click_num")); |
|
|
|
@ -350,8 +361,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else if(obj.event === 'selectLocation'){ |
|
|
|
} else if (obj.event === 'selectLocation') { |
|
|
|
let btn = $("#btn_placeCode_" + data.iid); |
|
|
|
let placeCodes = data.placeCodes; |
|
|
|
let clickNum = Number(btn.attr("click_num")); |
|
|
|
@ -374,9 +384,32 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
$('body').on('click', '[data-refresh]', function () { |
|
|
|
location.reload(); |
|
|
|
}) |
|
|
|
// 用于判断当前数量是否合法 |
|
|
|
MaterialQuantityIsTrue = function (req, obj) { |
|
|
|
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); |
|
|
|
$.ajax({ |
|
|
|
url: "/material/MaterialQuantityIsTrue", |
|
|
|
type: "post", |
|
|
|
data: JSON.stringify(req), |
|
|
|
dataType: 'json', |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
success: function (res) { |
|
|
|
var flag = res.data; |
|
|
|
if (!flag) { // 如果当前数目不合适 |
|
|
|
layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { |
|
|
|
layer.close(loading2); |
|
|
|
obj.update({quantity: 1}) |
|
|
|
}, |
|
|
|
); |
|
|
|
} else { |
|
|
|
layer.close(loading2) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|
|