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.
251 lines
11 KiB
251 lines
11 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<script>
|
|
var Type = $.request("Type");
|
|
$(document).ready(function () {
|
|
$("input.cell").keyup(function (e) {
|
|
switch (e.keyCode) {
|
|
// up arrow
|
|
case 40:
|
|
$(this).parent()
|
|
.parent()
|
|
.next()
|
|
.children("td")
|
|
.children("input.cell[name="
|
|
+ $(this).attr("name") + "]")
|
|
.focus();
|
|
break;
|
|
|
|
// down arrow
|
|
case 38:
|
|
$(this).parent()
|
|
.parent()
|
|
.prev()
|
|
.children("td")
|
|
.children("input.cell[name="
|
|
+ $(this).attr("name") + "]")
|
|
.focus();
|
|
break;
|
|
}
|
|
});
|
|
});</script>
|
|
<script>
|
|
$(function () {
|
|
gridList();
|
|
})
|
|
|
|
function gridList() {
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
VenCode: $("#txt_VenCode").val(),
|
|
VenName: $("#txt_VenName").val(),
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/KBSSRM/InvMaintenance/GetGridJson" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
height: $(window).height() - 200,
|
|
width: $(window).width() - 300,
|
|
colModel: [
|
|
{ label: "主键", name: "ID", hidden: true, key: true },
|
|
{ label: '物料编码', name: 'InvCode', width: 150, align: 'left' },
|
|
{ label: '物料名称', name: 'InvName', width: 100, align: 'left' },
|
|
{ label: '原材料厂商', name: 'EATTRIBUTE11', width: 150, align: 'left' },
|
|
{ label: 'UL证书编号', name: 'EATTRIBUTE12', width: 100, align: 'left' },
|
|
{ label: '工厂UL编号', name: 'EATTRIBUTE13', width: 100, align: 'left' },
|
|
{ label: '采购贸易商', name: 'EATTRIBUTE14', width: 100, align: 'left' },
|
|
{ label: '版本:', name: 'EATTRIBUTE15', width: 100, align: 'left' },
|
|
{ label: '制造商::', name: 'EATTRIBUTE16', width: 100, align: 'left' },
|
|
{ label: '地址:', name: 'EATTRIBUTE17', width: 100, align: 'left' },
|
|
{ label: '重量:', name: 'EATTRIBUTE18', width: 100, align: 'left' },
|
|
{ label: '是否食品安全级:', name: 'EATTRIBUTE19', width: 100, align: 'left' },
|
|
{ label: '站点:', name: 'WorkPoint', hidden: true },
|
|
],
|
|
shrinkToFit: true,//宽度自适应
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
sortorder: "desc",
|
|
sortname: 'InvCode ',
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
|
|
});
|
|
|
|
$("#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 = {
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
VenCode: $("#txt_VenCode").val(),
|
|
VenName: $("#txt_VenName").val(),
|
|
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
page: 1
|
|
}).trigger('reloadGrid');
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function btn_update() {
|
|
debugger;
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
if (ids.length != 1) {
|
|
$.modalAlert("请选择一行数据进行修改!");
|
|
return;
|
|
}
|
|
for (var i in ids) {
|
|
var rowData = jQuery("#gridList").jqGrid("getRowData", ids[i]);
|
|
var InvCode = rowData.InvCode;
|
|
var WorkPoint = rowData.WorkPoint;
|
|
$.modalOpen({
|
|
id: "InvMaintenanceUpdate",
|
|
title: "修改",
|
|
url: "/KBSSRM/InvMaintenance/InvMaintenanceUpdate?InvCode=" + InvCode + "&WorkPoint=" + WorkPoint + "&" + Math.random(),
|
|
width: "500px",
|
|
height: "660px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
},
|
|
btnClose: function (iframeId) {
|
|
top.frames[iframeId].dessubmitForm();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function btn_UPload() {
|
|
$("#FileUp").click();
|
|
|
|
}
|
|
function btnUpLoad(up) {
|
|
debugger;
|
|
// var JSDateDay = $("#txt_JSDate").val();
|
|
var form = new FormData(document.getElementById("form1"));
|
|
$.ajax({
|
|
url: "/KBSSRM/InvMaintenance/UploadFile?" + Math.random() ,
|
|
type: "post",
|
|
data: form,
|
|
contentType: false,
|
|
processData: false,
|
|
success: function (data) {
|
|
var obj = eval('(' + data + ')');
|
|
alert(obj.mass);
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
},
|
|
error: function (aa) {
|
|
alert("上传失败:" + aa);
|
|
}
|
|
});
|
|
document.getElementById("FileUp").value = "";
|
|
}
|
|
|
|
|
|
|
|
function btn_ExportAll() {
|
|
var postData = "&keyValue=1";
|
|
if ($("#txt_InvCode").val() != null && $("#txt_InvCode").val() != "") {
|
|
postData = "&InvCode=" + $("#txt_InvCode").val()
|
|
}
|
|
if ($("#txt_InvName").val() != null && $("#txt_InvName").val() != "") {
|
|
postData += "&InvName=" + $("#txt_InvName").val()
|
|
}
|
|
if ($("#txt_VenCode").val() != null && $("#txt_VenCode").val() != "") {
|
|
postData += "&VenCode=" + $("#txt_VenCode").val()
|
|
}
|
|
if ($("#txt_VenName").val() != null && $("#txt_VenName").val() != "") {
|
|
postData += "&VenName=" + $("#txt_VenName").val()
|
|
}
|
|
$.download("/KBSSRM/InvMaintenance/ExportAll" + "?" + Math.random(), postData, 'post');
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
<form id="form1">
|
|
<iframe id="ifrm" src="" width="0" height="0"></iframe>
|
|
<div class="topPanel" style="height:60px">
|
|
<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="btnUpLoad(this)" />
|
|
@* <a id="NF-CreateCartonNo" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreate()"><i class="fa fa-pencil-square-o"></i>维护</a>*@
|
|
<a id="NF-updateInv" authorize="yes" style="margin-left:3px;" class="btn btn-warning" onclick="btn_update()"><i class="fa fa-pencil-square-o"></i>维护</a>
|
|
<a id="NF-UPload" authorize="yes" style="margin-left:3px;" class="btn btn-danger" onclick="btn_UPload()"><i class="fa fa-pencil-square-o"></i>导入</a>
|
|
<a id="NF-ExportAll" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_ExportAll()"><i class="fa fa-pencil-square-o"></i>导出</a>
|
|
<a href="~/File/Stack/物料维护导入模板.xlsx" id="NF-IntroductionMould" authorize="yes" class="btn btn-primary dropdown-text"><i class="fa fa-file-excel-o"></i>导入模板下载</a>
|
|
@*<a id="NF-Print" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrint()"><i class="fa fa-pencil-square-o"></i>打印</a>*@
|
|
@*<a class="btn btn-primary" style="margin-left:3px;" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>*@
|
|
</div>
|
|
@*<div class="btn-group" style="display:block;padding-left:2px;">
|
|
<a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe">点击下载打印组件</a>
|
|
</div>*@
|
|
<script>$('.toolbar').authorizeButton()</script>
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<label>物料编码:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvCode" type="text" class="form-control" placeholder="物料编码" style="width: 120px;">
|
|
</div>
|
|
</td>
|
|
<td> </td>
|
|
<td>
|
|
<label>物料名称:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvName" type="text" class="form-control" placeholder="物料名称" style="width: 120px;">
|
|
</div>
|
|
</td>
|
|
<td> </td>
|
|
<td>
|
|
<label>供应商编码:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_VenCode" type="text" class="form-control" placeholder="供应商编码" style="width: 120px;">
|
|
</div>
|
|
</td>
|
|
<td> </td>
|
|
<td>
|
|
<label>供应商名称:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_VenName" type="text" class="form-control" placeholder="供应商名称" style="width: 120px;">
|
|
</div>
|
|
</td>
|
|
<td> </td>
|
|
<td>
|
|
<span class="input-group-btn">
|
|
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
|
|
<button id="btn btn-info" type="button" style="margin-left:3px;" class="btn btn-primary" onclick="$.reload()"><i class=" glyphicon glyphicon-refresh"></i></button>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
<div id="gridPager"></div>
|
|
</div>
|
|
</form>
|