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.
512 lines
21 KiB
512 lines
21 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<script>
|
|
debugger;
|
|
var _Clos = new Array();
|
|
var Name = "单据号";
|
|
var ColModelMain = [];
|
|
var ColModelSub = [];
|
|
$(function () {
|
|
SetCols();
|
|
|
|
$(".GDLX").css('display', 'block');
|
|
gridList();
|
|
|
|
})
|
|
|
|
function SetCols() {
|
|
$.ajax({
|
|
url: "/Print/SelectColumnName?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
var cols = new Array();
|
|
var cols1 = new Array();
|
|
var collast = { label: "主键", name: "ID", hidden: true, key: true };
|
|
cols.push(collast);
|
|
var collast = { label: '入库单号', name: 'RCVCode', width: 120, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '入库单行号', name: 'Sequence', width: 50, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '工单号', name: 'ProductionCode', width: 120, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '料品代码', name: 'InvCode', width: 120, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '规格型号', name: 'InvStd', width: 120, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '入库数量', name: 'Quantity', width: 60, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '已绑定数量', name: 'BoundQuantity', width: 150, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '入库仓库', name: 'WHCode', width: 150, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '创建人', name: 'CreatePerson', width: 150, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '创建时间', name: 'CreateDateTime', width: 150, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '是否入库', name: 'IsWH', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
|
|
$.ajax({
|
|
url: "/Print/SelectTableColumnName?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data != null && data.length > 0) {
|
|
DateList = data;
|
|
for (var i = 0; i < data.length; i++) {
|
|
var TableCode = data[i].TableCode;
|
|
if (TableCode == "ICSManufactureReceive") {
|
|
var Code = data[i].Code;
|
|
var Name = data[i].Name;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: Name,
|
|
name: Code,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
}
|
|
|
|
}
|
|
}
|
|
_Clos = cols;
|
|
|
|
//_Clos1 = cols1;
|
|
}
|
|
|
|
});
|
|
var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
|
|
cols1.push(collast1);
|
|
//var collast1 = { label: '炉批号', name: 'EATTRIBUTE4', width: 100, align: 'left' };
|
|
//cols1.push(collast1);
|
|
var collast1 = { label: '备注', name: 'EATTRIBUTE5', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
|
|
var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '是否打印', name: 'isPrint', width: 150, align: 'left' };
|
|
cols1.push(collast1);
|
|
|
|
_Clos = cols;
|
|
_Clos1 = cols1;
|
|
}
|
|
});
|
|
}
|
|
|
|
//产成品入库单
|
|
function gridList() {
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
BatchCode: $("#txt_BatchCode").val(),
|
|
POStatus: $("#selShow").val(),
|
|
WHStatus: $("#selStatus").val(),
|
|
InvStd: $("#txt_InvStd").val(),
|
|
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/KBSWMS/ICSManufactureReceive/GetManufactureReceive" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
height: $(window).height() - 200,
|
|
width: $(window).width() - 300,
|
|
colModel: _Clos,
|
|
width: "100%",
|
|
autowidth: true,
|
|
//shrinkToFit: true,
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
//sortname: 'MOCode,cast(Sequence as int)',
|
|
sortname: "RCVCode,Sequence ",
|
|
sortorder: "asc",
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
//beforeSelectRow: function (rowid, e) {
|
|
// $("#gridList").jqGrid('resetSelection');
|
|
// return (true);
|
|
//},
|
|
//subGrid: true, // (1)开启子表格支持
|
|
//subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
|
|
// $("#gridList").jqGrid("setSelection", rowid, false);
|
|
// bindSubGrid3(subgrid_id, rowid)
|
|
//}
|
|
});
|
|
|
|
$("#warehouse a.btn-default").click(function () {
|
|
$("#warehouse a.btn-default").removeClass("active");
|
|
$(this).addClass("active");
|
|
$('#btn_search').trigger("click");
|
|
});
|
|
$("#btn_search").click(function () {
|
|
var warehouse = $("#warehouse a.active").attr('data-value');
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
BatchCode: $("#txt_BatchCode").val(),
|
|
POStatus: $("#selShow").val(),
|
|
WHStatus: $("#selStatus").val(),
|
|
InvStd: $("#txt_InvStd").val(),
|
|
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
|
|
}
|
|
|
|
function bindSubGrid3(subgrid_id, rowid) {
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
var subgrid_table_id;
|
|
subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
|
|
|
|
var subgrid_pager_id;
|
|
subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
|
|
|
|
// (5)动态添加子报表的table和pager
|
|
$("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
|
|
var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
|
|
var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
|
|
var isPrint = $("#selPrint").val();
|
|
// (6)创建jqGrid对象
|
|
$("#" + subgrid_table_id).dataGrid({
|
|
cellEdit: true,
|
|
url: "/KBSWMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&isPrint=" + isPrint + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
|
|
|
|
colModel: _Clos1,
|
|
shrinkToFit: true,//宽度自适应
|
|
multiselect: false,
|
|
prmNames: { search: "search" },
|
|
viewrecords: true,
|
|
height: "100%",
|
|
rowNum: 20,
|
|
pager: subgrid_pager_id,
|
|
|
|
});
|
|
}
|
|
|
|
|
|
function btnDelete() {
|
|
debugger;
|
|
var MOCodes='';
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
if (ids.length < 1) {
|
|
$.modalAlertNew("WMS00100");
|
|
return;
|
|
}
|
|
for (var i in ids) {
|
|
var MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
|
|
MOCodes += "'" + MOCode + "',";
|
|
}
|
|
MOCodes = MOCodes.slice(0, MOCodes.length - 1);
|
|
$.deleteForm({
|
|
url: "/KBSWMS/WMSCreateItemLot/DeleteItemLot",
|
|
param: { MOCodes: JSON.stringify(MOCodes) },
|
|
success: function (data) {
|
|
if (data.state == "success") {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
else {
|
|
alert(data.messages);
|
|
}
|
|
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
function dateChange(num, date) {
|
|
if (!date) {
|
|
date = new Date();//没有传入值时,默认是当前日期
|
|
date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
|
|
}
|
|
date += " 00:00:00";//设置为当天凌晨12点
|
|
date = Date.parse(new Date(date)) / 1000;//转换为时间戳
|
|
date += (86400) * num;//修改后的时间戳
|
|
var newDate = new Date(parseInt(date) * 1000);//转换为时间
|
|
return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
|
|
}
|
|
|
|
|
|
|
|
function btnBind() {
|
|
debugger;
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
var objects = [];
|
|
if (ids.length != 1) {
|
|
$.modalAlertNew("WMS00079");
|
|
return;
|
|
}
|
|
|
|
var RCVCode = $("#gridList").jqGrid('getRowData', ids[0]).RCVCode;
|
|
var Sequence = $("#gridList").jqGrid('getRowData', ids[0]).Sequence;
|
|
var ProductionCode = $("#gridList").jqGrid('getRowData', ids[0]).ProductionCode;
|
|
var Quantity = $("#gridList").jqGrid('getRowData', ids[0]).Quantity;
|
|
var InvCode = $("#gridList").jqGrid('getRowData', ids[0]).InvCode;
|
|
var InvName = $("#gridList").jqGrid('getRowData', ids[0]).InvName;
|
|
var WHCode = $("#gridList").jqGrid('getRowData', ids[0]).WHCode;
|
|
var BoundQuantity = $("#gridList").jqGrid('getRowData', ids[0]).BoundQuantity;
|
|
|
|
$.modalOpen({
|
|
id: "BindAdd",
|
|
title: "绑定条码",
|
|
url: "/KBSWMS/ICSManufactureReceive/BindAdd" + "?" + Math.random() + "&RCVCode=" + RCVCode + "&Sequence=" + Sequence + "&ProductionCode=" + ProductionCode + "&Quantity=" + Quantity + "&InvCode=" + InvCode + "&InvName=" + encodeURI(encodeURI(InvName)) + "&WHCode=" + WHCode + "&BoundQuantity=" + BoundQuantity,
|
|
width: "70%",
|
|
height: "70%",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function btn_UnBind() {
|
|
debugger;
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
var objects = [];
|
|
if (ids.length != 1) {
|
|
$.modalAlertNew("WMS00079");
|
|
return;
|
|
}
|
|
for (var i = 0; i < ids.length; i++){
|
|
objects.push(ids[i]);
|
|
}
|
|
|
|
$.submitForm({
|
|
url: "/KBSWMS/ICSManufactureReceive/PostUnBind",
|
|
param: { ids: JSON.stringify(objects) },
|
|
success: function (data) {
|
|
if (data.state == "success") {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
else {
|
|
alert(data.messages);
|
|
}
|
|
|
|
}
|
|
})
|
|
|
|
}
|
|
|
|
function btn_Examine() {
|
|
debugger;
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
var objects = [];
|
|
if (ids.length < 1) {
|
|
$.modalAlertNew("WMS00077");
|
|
return;
|
|
}
|
|
for (var i = 0; i < ids.length; i++) {
|
|
var RCVCode = $("#gridList").jqGrid('getRowData', ids[0]).RCVCode;
|
|
objects.push(RCVCode);
|
|
}
|
|
$.submitForm({
|
|
url: "/KBSWMS/ICSManufactureReceive/PostExamine",
|
|
param: { RCVCodes: JSON.stringify(objects) },
|
|
success: function (data) {
|
|
if (data.state == "success") {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
else {
|
|
alert(data.messages);
|
|
}
|
|
|
|
}
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function fullscreen() {
|
|
var docElm = document.documentElement;
|
|
if (docElm.requestFullscreen) {
|
|
docElm.requestFullscreen();
|
|
} else if (docElm.mozRequestFullScreen) {
|
|
docElm.mozRequestFullScreen();
|
|
} else if (docElm.webkitRequestFullScreen) {
|
|
docElm.webkitRequestFullScreen();
|
|
} else if (docElm.msRequestFullscreen) {
|
|
docElm.msRequestFullscreen();
|
|
}
|
|
$(window).bind('resize', function () {
|
|
$("#gridList").setGridWidth($(window).width());
|
|
}).trigger('resize');
|
|
$(window).bind('resize', function () {
|
|
$("#gridList").setGridHeight($(window).height());
|
|
}).trigger('resize');
|
|
}
|
|
|
|
|
|
|
|
|
|
function btnPrint() {
|
|
debugger;
|
|
var MOCodes = [];
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
if (ids.length < 1) {
|
|
$.modalAlertNew("WMS00100");
|
|
return;
|
|
}
|
|
for (var i in ids) {
|
|
var MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
|
|
MOCodes.push(MOCode);
|
|
}
|
|
$.submitForm({
|
|
url: "/KBSWMS/CreateItemLot/PrintViewByLot",
|
|
param: { MOCodes: JSON.stringify(MOCodes) },
|
|
success: function (data) {
|
|
if (data.state == "success") {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
else {
|
|
alert(data.messages);
|
|
}
|
|
|
|
}
|
|
})
|
|
|
|
}
|
|
|
|
|
|
function btn_ImPort() {
|
|
$("#FileUp").click();
|
|
}
|
|
|
|
|
|
|
|
function btnInvBadGroup(up) {
|
|
debugger;
|
|
var form = new FormData(document.getElementById("form1"));
|
|
$.ajax({
|
|
url: "/KBSWMS/ICSManufactureReceive/UploadFileBinding?" + Math.random(),
|
|
type: "post",
|
|
data: form,
|
|
contentType: false,
|
|
processData: false,
|
|
success: function (data) {
|
|
if (data == "导入成功") {
|
|
debugger;
|
|
$.modalMsg('导入成功', "success");
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
//alert("导入成功");
|
|
|
|
}
|
|
else {
|
|
$.modalMsg(data, "warning");
|
|
}
|
|
},
|
|
error: function (aa) {
|
|
$.modalMsg(aa, "error");
|
|
// alert("导入失败:" + aa);
|
|
}
|
|
});
|
|
document.getElementById("FileUp").value = "";
|
|
}
|
|
|
|
</script>
|
|
<iframe id="ifrm" src="" width="0" height="0"></iframe>
|
|
|
|
<form id="form1">
|
|
<div class="topPanel" style="height:120px;">
|
|
<div class="toolbar">
|
|
<div class="btn-group">
|
|
|
|
<input id="FileUp" name="FileUp" type="file" style="display:none;" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" onchange="btnInvBadGroup(this)" />
|
|
<a id="NF-ImPort" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_ImPort()"><i class="fa fa-pencil-square-o"></i>导入条码</a>
|
|
<a href="~/File/Stack/生产入库单绑定条码模板.xlsx" id="NF-IntroductionMould" style="margin-left:3px;" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_IntroductionMould()"><i class="fa fa-file-excel-o"></i>导入模板下载</a>
|
|
</div>
|
|
<div class="btn-group" style="display:block;padding-left:2px;">
|
|
<a id="NF-Bind" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnBind()"><i class="fa fa-pencil-square-o"></i>绑定条码</a>
|
|
<a id="NF-UnBind" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_UnBind()"><i class="fa fa-pencil-square-o"></i>解绑条码</a>
|
|
<a id="NF-Examine" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Examine()"><i class="fa fa-pencil-square-o"></i>提交过帐</a>
|
|
<a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
|
|
</div>
|
|
<script>$('.toolbar').authorizeButton()</script>
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td class="POCodeShow" style="text-align:right;"><label class="lglabel " id="POCodeShowLable" for="txt_POCode"> 单据号</label>:</td>
|
|
<td class="POCodeShow">
|
|
<div class="input-group">
|
|
<input id="txt_POCode" type="text" class="form-control" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_InvCode"> 料品编码</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvCode" type="text" class="form-control" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_InvName"> 料品名称</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvName" type="text" class="form-control" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="HideItems3" style="text-align:right;"><label class="lglabel HideItems3" for="txt_InvStd"> 规格型号</label>:</td>
|
|
<td class="HideItems3">
|
|
<div class="input-group HideItems3">
|
|
<input id="txt_InvStd" type="text" class="form-control" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_BatchCode"> 批次号</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_BatchCode" type="text" class="form-control" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
|
|
<td clsaa="Status">
|
|
<label> 是否入库: </label>
|
|
</td>
|
|
<td clsaa="Status">
|
|
<div class="input-group">
|
|
<select id="selStatus" name="F_Target" class="form-control" style="width: 130px;">
|
|
<option value="1">是</option>
|
|
<option value="0" selected="selected">否</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<span class="input-group-btn">
|
|
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
<div id="gridPager"></div>
|
|
</div>
|
|
</form>
|