|
|
|
@ -1719,7 +1719,50 @@ |
|
|
|
iframeChildren.css('height', '100%'); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
form.on('select()', function (data) { |
|
|
|
let unit = data.value; |
|
|
|
let id = data.elem.id; |
|
|
|
let idNum = id.split("unit")[1]; |
|
|
|
let mcode = $("#code" + idNum).val(); |
|
|
|
if (mcode === "" || mcode === undefined || mcode === null) { |
|
|
|
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () { |
|
|
|
$("#quantity" + idNum).val("") |
|
|
|
}); |
|
|
|
} else { |
|
|
|
let val = $("#quantity" + idNum).val(); |
|
|
|
if (val !== null && val !== undefined && val !== '') { |
|
|
|
var req = {}; |
|
|
|
req.mcode = mcode; |
|
|
|
req.quantity = val; |
|
|
|
req.unit = unit; |
|
|
|
req.placeId = -1; |
|
|
|
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); |
|
|
|
$("#quantity" + idNum).val(""); |
|
|
|
}, |
|
|
|
); |
|
|
|
} else { |
|
|
|
layer.close(loading2) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|