You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
162 lines
5.2 KiB
162 lines
5.2 KiB
|
|
|
|
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Form.cshtml";
|
|
}
|
|
|
|
<script>
|
|
var LotNO = $.request("LotNO");
|
|
var Quantity = $.request("Quantity");
|
|
var InvName = decodeURI($.request("InvName"));
|
|
|
|
debugger;
|
|
var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
|
|
$(function () {
|
|
$("#minPackQty").keyup(function () {
|
|
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
|
|
}).bind("paste", function () { //CTR+V事件处理
|
|
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
|
|
}).css("ime-mode", "disabled"); //CSS设置输入法不可用
|
|
$("#thisCreateQty").keyup(function () {
|
|
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
|
|
}).bind("paste", function () { //CTR+V事件处理
|
|
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
|
|
}).css("ime-mode", "disabled"); //CSS设置输入法不可用
|
|
$("#cretePageCount").keyup(function () {
|
|
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
|
|
}).bind("paste", function () { //CTR+V事件处理
|
|
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
|
|
}).css("ime-mode", "disabled"); //CSS设置输入法不可用
|
|
|
|
var VenCode = "";
|
|
var WorkPoint = "";
|
|
$("#txtLotNO").val(LotNO);
|
|
$("#txtQuantity").val(Quantity);
|
|
$("#txtInvName").val(InvName);
|
|
$("#txtLotNO").attr("disabled", "disabled");
|
|
$("#txtQuantity").attr("disabled", "disabled");
|
|
$("#txtInvName").attr("disabled", "disabled");
|
|
|
|
});
|
|
|
|
|
|
function submitForm() {
|
|
debugger;
|
|
if (!$('#form1').formValid()) {
|
|
return false;
|
|
}
|
|
var RoleEnCode = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
|
|
var WorkPoint = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
|
|
var date = new Date();
|
|
var Details = [];
|
|
var NewLotNoM;
|
|
var createPageCount;
|
|
var LotNo = $("#txtLotNO").val();
|
|
var BQTY = $("#txtCount").val();
|
|
if (BQTY=='') {
|
|
$.modalAlert("请输入包装数量!");
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: "/JHWMS/Deciliter/GetNewLotNoByPacking?LotNO=" + LotNO,
|
|
//data: { keyValue: keyValue },
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
debugger;
|
|
NewLotNoM = data.rows;
|
|
}
|
|
});
|
|
|
|
if (parseInt(Math.ceil(Quantity * 10000)) % parseInt(Math.ceil(BQTY * 10000)) != 0) {
|
|
createPageCount = parseInt(Quantity / BQTY) + 1;
|
|
}
|
|
else {
|
|
createPageCount = parseInt(Quantity / BQTY);
|
|
}
|
|
var LOTQTY = BQTY;
|
|
for (var i = 0; i < createPageCount; i++) {
|
|
|
|
if (i + 1 == createPageCount) {
|
|
if (BQTY * createPageCount > Quantity) {
|
|
LOTQTY = Quantity - (BQTY * (createPageCount - 1));
|
|
}
|
|
}
|
|
var obj = {
|
|
CurrentLotNo: LotNo + '-' + NewLotNoM,
|
|
CurrentQuantity: LOTQTY,
|
|
|
|
};
|
|
NewLotNoM = Number(NewLotNoM) + 1;
|
|
Details.push(obj);
|
|
|
|
}
|
|
|
|
var Header = {
|
|
LotNo: $("#txtLotNO").val(),
|
|
User: RoleEnCode,
|
|
MTIME: date,
|
|
WorkPoint: WorkPoint,
|
|
Detail: Details,
|
|
}
|
|
var Parameter = [];
|
|
Parameter.push(Header);
|
|
|
|
$.submitForm({
|
|
url: "/JHWMS/Deciliter/Split?" + Math.random(),
|
|
param: { Parameter: JSON.stringify(Parameter) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<form id="form1">
|
|
<div style="padding-top: 20px; margin-right: 20px;">
|
|
<table class="form">
|
|
<tr>
|
|
<th class="formTitle">料品条码</th>
|
|
<td class="formValue">
|
|
<input id="txtLotNO" name="txtLotNO" type="text" class="form-control " />
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">料品在库数量</th>
|
|
<td class="formValue">
|
|
<input id="txtQuantity" name="Quantity" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">料品名称</th>
|
|
<td class="formValue">
|
|
<input id="txtInvName" name="txtInvName" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
@*<tr>
|
|
<th class="formTitle">新条码</th>
|
|
<td class="formValue">
|
|
<input id="txtNewLotNo" name="txtNewLotNo" type="text" class="form-control " />
|
|
</td>
|
|
</tr>*@
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>包装数量</th>
|
|
<td class="formValue">
|
|
<input id="txtCount" name="txtCount" type="text" class="form-control required" placeholder="请输入包装数量" />
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</form>
|
|
|