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.
115 lines
3.9 KiB
115 lines
3.9 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
|
|
<script src="~/Content/js/select2/select2.min.js"></script>
|
|
<script>
|
|
var InvCode = decodeURI($.request("InvCode"));
|
|
var JYID = decodeURI($.request("JYID"));
|
|
|
|
$(function () {
|
|
debugger;
|
|
gridList();
|
|
})
|
|
|
|
|
|
function gridList() {
|
|
debugger;
|
|
var $gridList = $("#gridList");
|
|
$gridList.dataGrid({
|
|
url: "/WMS/ICSRCVIQCs/GetInventoryInspection?InvCode=" + InvCode + "&" + Math.random(),
|
|
height: 400,
|
|
width: $(window).height() - 200,
|
|
cellEdit: true,
|
|
colModel: [
|
|
{ label: "主键", name: "ID", hidden: true, key: true },
|
|
{ label: '检验ID', name: 'InspectionID', hidden: true },
|
|
{ label: "检验项目组代码", name: "GroupCode", width: 100, align: 'left' },
|
|
{ label: "检验项目组名称", name: "GroupName", width: 100, align: 'left' },
|
|
{ label: "检验项目代码", name: "ListCode", width: 100, align: 'left' },
|
|
{ label: "检验项目名称", name: "ListName", width: 100, align: 'left' },
|
|
{ label: "单位", name: "Unit", width: 100, align: 'left' },
|
|
{ label: '标准上限', name: 'SetValueMax', width: 80, align: 'left' },
|
|
{ label: '标准下限', name: 'SetValueMin', width: 80, align: 'left' },
|
|
{ label: '实际值', name: 'SetValue', width: 150, align: 'left', editable: true, editrules: { number: true } },
|
|
|
|
],
|
|
//pager: "#gridPager",
|
|
cellsubmit: "clientArray",
|
|
sortname: 'ListCode',
|
|
viewrecords: true,
|
|
rowNum: 200
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function submitForm() {
|
|
debugger;
|
|
var ICSMTDOC = [];
|
|
var obj_Item1 = $("#gridList");
|
|
var Result = '';
|
|
var rowIds_Item1 = obj_Item1.getDataIDs();
|
|
if (rowIds_Item1.length > 0) {
|
|
for (var i = 0; i < rowIds_Item1.length; i++) {
|
|
var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]);
|
|
if (RowData_Item1.SetValue=='') {
|
|
$.modalAlertNew("WMS00105");
|
|
return;
|
|
}
|
|
if (Number(RowData_Item1.SetValueMin)<Number(RowData_Item1.SetValue)&&Number(RowData_Item1.SetValue)<Number(RowData_Item1.SetValueMax)) {
|
|
Result='1';
|
|
}else {
|
|
Result='0';
|
|
}
|
|
var obj = {
|
|
ID: RowData_Item1.ID,
|
|
InspectionID: JYID,
|
|
GroupCode: RowData_Item1.GroupCode,
|
|
GroupName: RowData_Item1.GroupName,
|
|
ListCode: RowData_Item1.ListCode,
|
|
ListName: RowData_Item1.ListName,
|
|
Unit: RowData_Item1.Unit,
|
|
SetValueMax: RowData_Item1.SetValueMax,
|
|
SetValueMin: RowData_Item1.SetValueMin,
|
|
SetValue: RowData_Item1.SetValue,
|
|
Result: Result,
|
|
};
|
|
ICSMTDOC.push(obj);
|
|
}
|
|
|
|
}
|
|
debugger;
|
|
$.modalConfirm("确定保存吗?", function (r) {
|
|
if (r) {
|
|
$.submitForm({
|
|
url: "/WMS/ICSRCVIQCs/SaveICSInspectionDetail?InvCode=" + InvCode + "&" + Math.random(),
|
|
param: { ICSMTDOC: JSON.stringify(ICSMTDOC) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<form id="form1">
|
|
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
@*<div id="gridPager"></div>*@
|
|
</div>
|
|
|
|
|
|
</form>
|
|
|