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.
507 lines
20 KiB
507 lines
20 KiB
|
|
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Form.cshtml";
|
|
}
|
|
<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
|
|
<link href="~/Content/js/dialog/dialog.css?v=20120420" rel="stylesheet" />
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<script src="~/Content/js/select2/select2.min.js"></script>
|
|
<style>
|
|
.selected-row {
|
|
background-color: yellow;
|
|
}
|
|
</style>
|
|
<style>
|
|
.divbox {
|
|
margin-left: 20px;
|
|
margin-top: 10px;
|
|
display: inline-block;
|
|
float: left;
|
|
}
|
|
|
|
.divformValue {
|
|
display: inline-block;
|
|
float: left;
|
|
}
|
|
|
|
.divformTitle {
|
|
display: inline-block;
|
|
float: left;
|
|
}
|
|
/*.divformValue{
|
|
display:inline-block;
|
|
}*/
|
|
</style>
|
|
<script>
|
|
var WorkPoint = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
|
|
var User = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
|
|
var MODetailID = '';
|
|
var TransSequence = '';
|
|
var ZSequence = '';
|
|
var Quantitys = '';
|
|
var Amounts = '';
|
|
var MODetailIDs = '';
|
|
var count = 0;
|
|
var selectedRowId = null;
|
|
debugger;
|
|
$(function () {
|
|
gridList();
|
|
gridList2(MODetailID);
|
|
//gridList3();
|
|
LotNoBinding();
|
|
});
|
|
|
|
|
|
|
|
function gridList() {
|
|
document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
|
|
var queryJson = {
|
|
Code: $("#txt_Code").val(),
|
|
}
|
|
$("#gridList").dataGrid({
|
|
url: "/OMAY/OMAYMoOutbound/GetMosByCode" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
height:150,
|
|
width: $(window).width() - 700,
|
|
colModel: [
|
|
{ label: '选择', width: 100, align: 'left', formatter: BtnLookPick },
|
|
{ label: '主键', name: 'ID', hidden: true, key: true },
|
|
{ label: '工单号', name: 'MOCode', width: 100, align: 'left' },
|
|
{ label: '工单行号', name: 'Sequence', width: 100, align: 'left' },
|
|
{ label: '存货编码', name: 'InvCode', width: 180, align: 'left' },
|
|
{ label: '存货代码', name: 'InvDesc', width: 100, align: 'left' },
|
|
{ label: '存货名称', name: 'InvName', width: 180, align: 'left' },
|
|
{ label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
|
|
{ label: '重量', name: 'Quantity', width: 100, align: 'left' },
|
|
{ label: '单位', name: 'InvUnit', width: 100, align: 'left' },
|
|
{ label: '数量', name: 'Amount', width: 100, align: 'left' },
|
|
{ label: 'ERP工单行ID', name: 'MODetailID', hidden: true },
|
|
// { label: '部门', name: 'DepName', width: 100, align: 'left' },
|
|
],
|
|
width: "100%",
|
|
autowidth: true,
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
sortname: 'MOCode',
|
|
sortorder: "desc",
|
|
viewrecords: true,
|
|
multiselect: false,
|
|
beforeSelectRow: function (rowid, e) {
|
|
$("#gridList").jqGrid('resetSelection');
|
|
selectedRowId = rowid;
|
|
return (true);
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function gridList2(MODetailID) {
|
|
document.getElementById("gridPanel2").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList2"></table> ';//重置grid
|
|
$("#gridList2").jqGrid("clearGridData");
|
|
$("#gridList3").jqGrid("clearGridData");
|
|
var queryJson = {
|
|
MODetailID: MODetailID,
|
|
}
|
|
$("#gridList2").dataGrid({
|
|
url: "/OMAY/OMAYMoOutbound/GetMoPicksByCode" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
height:200,
|
|
width: $(window).width() - 700,
|
|
colModel: [
|
|
// { label: '选择', width: 100, align: 'left', formatter: BtnPick },
|
|
{ label: '主键', name: 'ID', hidden: true, key: true },
|
|
{ label: 'ERP工单行ID', name: 'MODetailID', width: 100, align: 'left' },
|
|
{ label: '子件行号', name: 'Sequence', width: 100, align: 'left' },
|
|
{ label: '存货编码', name: 'InvCode', width: 180, align: 'left' },
|
|
{ label: '存货名称', name: 'InvName', width: 180, align: 'left' },
|
|
{ label: '料品描述', name: 'InvDesc', hidden: true },
|
|
{ label: '规格型号', name: 'InvStd', width: 180, align: 'left' },
|
|
{ label: '仓库名称', name: 'WarehouseName', width: 100, align: 'left' },
|
|
{ label: '应领数量', name: 'Quantity', width: 100, align: 'left' },
|
|
{ label: '单位', name: 'InvUnit', width: 100, align: 'left' },
|
|
{ label: '已领数量', name: 'IssueQuantity', width: 100, align: 'left' },
|
|
{ label: '辅计量', name: 'Amount', hidden: true },
|
|
{ label: '换算率', name: 'EATTRIBUTE1', width: 100, align: 'left' },
|
|
],
|
|
width: "100%",
|
|
autowidth: true,
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
sortname: 'Sequence',
|
|
sortorder: "asc",
|
|
viewrecords: true,
|
|
multiselect: false,
|
|
beforeSelectRow: function (rowid, e) {
|
|
$("#gridList").jqGrid('resetSelection');
|
|
return (true);
|
|
},
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function gridList3() {
|
|
$("#gridList3").dataGrid({
|
|
height:250,
|
|
width: $(window).width() - 400,
|
|
cellEdit: true,
|
|
cellsubmit: "clientArray",
|
|
colModel: [
|
|
{ label: "主键", name: "ID", hidden: true, key: true },
|
|
{
|
|
label: '删除', width: 100, align: 'left',
|
|
formatter: btnDelete
|
|
},
|
|
|
|
{ label: '存货编码', name: 'InvCode', width: 150, align: 'left' },
|
|
{ label: '存货名称', name: 'InvName', width: 100, align: 'left' },
|
|
{ label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
|
|
{ label: '条码', name: 'LotNo', width: 120, align: 'left' },
|
|
{ label: '入库日期', name: 'ProductDate', width: 150, align: 'left' },
|
|
{ label: '数量', name: 'Quantity', width: 100, align: 'left' },
|
|
{ label: '单位', name: 'InvUnit', width: 80, align: 'left' },
|
|
{ label: '辅计量', name: 'Amount', width: 100, align: 'left' },
|
|
{ label: '本次发料数量', name: 'CurrentQuantity', width: 200, align: 'left', editable: true },
|
|
{ label: '项目号', name: 'ProjectCode', width: 200, align: 'left', hidden: true },
|
|
{ label: '批次', name: 'BatchCode', width: 200, align: 'left', hidden: true },
|
|
{ label: '版本', name: 'Version', width: 200, align: 'left', hidden: true },
|
|
{ label: '厂牌', name: 'Brand', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项1', name: 'cFree1', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项2', name: 'cFree2', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项3', name: 'cFree3', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项4', name: 'cFree4', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项5', name: 'cFree5', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项6', name: 'cFree6', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项7', name: 'cFree7', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项8', name: 'cFree8', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项9', name: 'cFree9', width: 200, align: 'left', hidden: true },
|
|
{ label: '自由项10', name: 'cFree10', width: 200, align: 'left', hidden: true },
|
|
{ label: '本次最大发料数', name: 'QTY', hidden: true },
|
|
],
|
|
width: "100%",
|
|
autowidth: true,
|
|
rownumbers: true,
|
|
viewrecords: true,
|
|
});
|
|
}
|
|
|
|
|
|
|
|
//查看子件信息
|
|
function BtnLookPick(cellvalue, options, rowObject) {
|
|
debugger;
|
|
|
|
return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"GridListClick('" + rowObject.ID + "','" + rowObject.MODetailID + "','" + rowObject.Sequence + "','" + rowObject.Quantity + "','" + rowObject.Amount + "')\">选择</a>";
|
|
|
|
}
|
|
|
|
//function BtnPick(cellvalue, options, rowObject) {
|
|
// debugger;
|
|
|
|
// return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"GridList2Click('" + rowObject.ID + "','" + rowObject.Sequence + "')\">选择</a>";
|
|
|
|
//}
|
|
|
|
|
|
function GridListClick(ID, MODetailID, Sequence, Quantity, Amount) {
|
|
debugger;
|
|
$("#gridList").find("td").css("background-color", "");
|
|
$("#" + ID).find("td").css("background-color", "yellow");
|
|
TransSequence = Sequence;
|
|
Quantitys = Quantity;
|
|
Amounts = Amount;
|
|
MODetailIDs = MODetailID;
|
|
gridList2(MODetailID);
|
|
$("#gridList3").jqGrid("clearGridData");
|
|
gridList3();
|
|
}
|
|
function GridList2Click(ID, Sequence) {
|
|
$("#gridList2").find("td").css("background-color", "");
|
|
$("#" + ID).find("td").css("background-color", "yellow");
|
|
// ZSequence = Sequence;
|
|
$("#gridList3").jqGrid("clearGridData");
|
|
gridList3();
|
|
}
|
|
|
|
|
|
function btnDelete(cellvalue, options, rowObject) {
|
|
return cellvalue = "<a class=\"btn btn-primary dropdown-text\" onclick=\"Delete('" + rowObject.ID + "')\">删除</a>";
|
|
}
|
|
|
|
function Delete(ID) {
|
|
$("#gridList3").delRowData(ID);
|
|
}
|
|
|
|
|
|
|
|
|
|
function SeachMO() {
|
|
$.modalOpen({
|
|
id: "SeachMO",
|
|
title: "工单",
|
|
url: "/OMAY/OMAYMoOutbound/SeachMoInfo" + "?" + Math.random(),
|
|
width: "500px",
|
|
height: "600px",
|
|
callBack: function (iframeId) {
|
|
var obj = top.frames[iframeId].submitForm();
|
|
$("#txt_Code").val(obj.MOCode);
|
|
$("#gridList").jqGrid("clearGridData");
|
|
$("#gridList2").jqGrid("clearGridData");
|
|
$("#gridList3").jqGrid("clearGridData");
|
|
gridList();
|
|
$(".unwritten").hide();
|
|
top.frames[iframeId].Close();
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function LotNoBinding() {
|
|
//if (count!=0) {
|
|
// if (ZSequence == '') {
|
|
// $.modalAlert("请先选择工单子件!", "warning");
|
|
// return;
|
|
// }
|
|
//}
|
|
//count = count + 1;
|
|
var Msg = '';
|
|
$("#LotNo").keydown(function (e) {
|
|
var curKey = e.which;rowIds
|
|
debugger;
|
|
if (curKey == 13) {
|
|
var Code = $("#txt_Code").val();//工单号
|
|
var LotNos = $("#LotNo").val();//条码号
|
|
var LotNo= LotNos.replace(/\s+/g, '');
|
|
if (LotNo=='') {
|
|
$.modalAlert("扫入的条码异常,请重新扫入!", "warning");
|
|
return;
|
|
}
|
|
var gridList3 = $("#gridList3");
|
|
var rowIds = gridList3.getDataIDs();
|
|
if (rowIds.length > 0) {
|
|
for (var i = 0; i < rowIds.length; i++) {
|
|
var RowData = gridList3.getRowData(rowIds[i]);
|
|
if (RowData.LotNo == LotNo) {
|
|
$.modalAlert("条码" + LotNo + "重复扫入,请确认!", "warning");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
var TransType = '生产发料-生产订单备料表';
|
|
WorkPoint
|
|
var keyValue = {
|
|
TransCode: Code,
|
|
TransSequence: TransSequence,
|
|
Code: LotNo,
|
|
TransType: TransType,
|
|
WorkPoint: WorkPoint,
|
|
User: User,
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
url: "/OMAY/OMAYMoOutbound/GetLotNotInfo" + "?" + Math.random(),
|
|
data: { keyValue: JSON.stringify(keyValue) },
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
debugger;
|
|
if (data == "" || data == null) {
|
|
$.modalAlertNew("WMS00022");
|
|
return;
|
|
}
|
|
//Msg = data.msg;
|
|
if (data.msg!="") {
|
|
$.modalAlert(data.msg);
|
|
return;
|
|
}
|
|
var cQuantity = data.dt[0].Quantity;
|
|
if (data.dt[0].AmountEnable == true) {
|
|
cQuantity = data.dt[0].Amount;
|
|
}
|
|
|
|
//最后一行新增数据
|
|
var obj = {
|
|
ID: data.dt[0].ID,
|
|
LotNo: data.dt[0].LotNo,
|
|
InvCode: data.dt[0].InvCode,
|
|
InvName: data.dt[0].InvName,
|
|
InvStd: data.dt[0].InvStd,
|
|
InvUnit: data.dt[0].InvUnit,
|
|
ProductDate: data.dt[0].ProductDate,
|
|
Quantity: data.dt[0].Quantity,
|
|
CurrentQuantity: cQuantity,
|
|
Amount: data.dt[0].Amount,
|
|
ProjectCode: data.dt[0].ProjectCode,
|
|
BatchCode: data.dt[0].BatchCode,
|
|
Version: data.dt[0].Version,
|
|
Brand: data.dt[0].Brand,
|
|
cFree1: data.dt[0].cFree1,
|
|
cFree2: data.dt[0].cFree2,
|
|
cFree3: data.dt[0].cFree3,
|
|
cFree4: data.dt[0].cFree4,
|
|
cFree5: data.dt[0].cFree5,
|
|
cFree6: data.dt[0].cFree6,
|
|
cFree7: data.dt[0].cFree7,
|
|
cFree8: data.dt[0].cFree8,
|
|
cFree9: data.dt[0].cFree9,
|
|
cFree10: data.dt[0].cFree10,
|
|
QTY: cQuantity
|
|
};
|
|
$("#gridList3").jqGrid('addRowData', obj.ID, obj, 'first');
|
|
$(".unwritten").hide();
|
|
}
|
|
});
|
|
var LotNo = $("#LotNo");
|
|
LotNo.select();
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
function submitForm() {
|
|
$("#gridList3").find($("td[aria-describedby='gridList3_rn']")).click();//提交取消编辑状态
|
|
var AllLotNoNum = 0;
|
|
var Code = $("#txt_Code").val();//工单号
|
|
var Details = [];
|
|
var myDate = new Date();
|
|
var year = myDate.getFullYear(); //获取当前年
|
|
var mon = myDate.getMonth() + 1 < 10 ? "0" + (myDate.getMonth() + 1) : myDate.getMonth() + 1; //获取当前月
|
|
var dates = myDate.getDate() + 1 < 10 ? "0" + myDate.getDate() : myDate.getDate(); //获取当前日
|
|
var hours = myDate.getHours() + 1 < 10 ? "0" + myDate.getHours() : myDate.getHours(); //获取当前小时
|
|
var minutes = myDate.getMinutes() + 1 < 10 ? "0" + myDate.getMinutes() : myDate.getMinutes(); //获取当前分钟
|
|
var seconds = myDate.getSeconds() + 1 < 10 ? "0" + myDate.getSeconds() : myDate.getSeconds(); //获取当前秒
|
|
var date = year + "-" + mon + "-" + dates + ' ' + hours + ':' + minutes + ':' + seconds;
|
|
var gridList3 = $("#gridList3");
|
|
var rowIds = gridList3.getDataIDs();
|
|
if (rowIds.length > 0) {
|
|
for (var i = 0; i < rowIds.length; i++) {
|
|
var RowData = gridList3.getRowData(rowIds[i]);
|
|
|
|
if (RowData.CurrentQuantity == 0 || RowData.CurrentQuantity=='') {
|
|
$.modalAlert("条码" + RowData.LotNo + "未输入本次发料数量,请确认!", "warning");
|
|
return;
|
|
}
|
|
if (Number(RowData.CurrentQuantity) > Number(RowData.QTY)) {
|
|
$.modalAlert("条码" + RowData.LotNo + "所输入本次发料数量大于条码剩余数量,请确认!", "warning");
|
|
return;
|
|
}
|
|
AllLotNoNum = AllLotNoNum + Number(RowData.CurrentQuantity);
|
|
var obj = {
|
|
LotNo: RowData.LotNo,
|
|
CurrentQuantity: RowData.CurrentQuantity,
|
|
};
|
|
Details.push(obj);
|
|
}
|
|
var ICSASNs = {
|
|
WorkPoint: WorkPoint,
|
|
TransSequence: TransSequence ,
|
|
User: User,
|
|
TransCode: Code,
|
|
Amount: Amounts,
|
|
Quantity: AllLotNoNum,
|
|
TransType: "生产发料-生产订单备料表",
|
|
MTime: date,
|
|
Detail: Details,
|
|
}
|
|
var ICSASN = [];
|
|
ICSASN.push(ICSASNs);
|
|
|
|
} else {
|
|
$.modalAlert("请扫入条码!", "warning");
|
|
return;
|
|
}
|
|
|
|
$.modalConfirm("请确认是否出库?", function (r) {
|
|
if (r) {
|
|
$.submitForm({
|
|
url: "/OMAY/OMAYMoOutbound/OutboundShipments?" + Math.random(),
|
|
param: { ICSASN: JSON.stringify(ICSASN) },
|
|
success: function () {
|
|
$("#gridList3").jqGrid("clearGridData");
|
|
gridList2(MODetailIDs);
|
|
// $.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
});
|
|
};
|
|
|
|
|
|
</script>
|
|
<div class="topPanel" style="height:50px">
|
|
<div class="toolbar">
|
|
<div class="btn-group">
|
|
|
|
<a id="NF-Submit" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="submitForm()"><i class="fa fa-pencil-square-o"></i>确定出库</a>
|
|
|
|
|
|
</div>
|
|
@*<script>$('.toolbar').authorizeButton()</script>*@
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<label>工单号:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_Code" type="text" class="form-control" placeholder="工单号" style="width: 120px;">
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="SeachMO()"><i class="fa fa-pencil-square-o"></i>查询</a>
|
|
</td>
|
|
<td style="width:20px"></td>
|
|
<td>
|
|
<label>条码:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="LotNo" type="text" class="form-control" placeholder="条码" style="width: 500px;" οnkeydοwn="LotNoBinding()">
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr></tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="gridPanel" id="gridPanel" style="width:99%;height:20%">
|
|
<span><strong>工单信息</strong></span>
|
|
<table id="gridList"></table>
|
|
|
|
</div>
|
|
<div class="gridPanel" id="gridPanel2" style="width:99%;height:28%">
|
|
<span><strong>子件信息</strong></span>
|
|
<table id="gridList2"></table>
|
|
</div>
|
|
<div class="gridPanel" id="gridPanel3" style="width:99%;height:28%">
|
|
<span><strong>条码明细</strong></span>
|
|
<table id="gridList3"></table>
|
|
</div>
|