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.
239 lines
10 KiB
239 lines
10 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<style>
|
|
.td {
|
|
padding: 0 5px 0 5px;
|
|
}
|
|
</style>
|
|
<script>
|
|
var WorkPoints = $.request("WorkPoint");
|
|
var Cus = $.request("Cus");
|
|
$(function () {
|
|
gridList();
|
|
})
|
|
|
|
function guid() {
|
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
return v.toString(16);
|
|
});
|
|
}
|
|
function gridList() {
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
SOCode: $("#txt_SOCode").val(),
|
|
Sequence: $("#txt_Sequence").val(),
|
|
NewInv: $("#txt_NewInv").val(),
|
|
OldInv: $("#txt_OldInv").val(),
|
|
CusCode: $("#txt_CusCode").val(),
|
|
CusName: $("#txt_CusName").val(),
|
|
CusDoc: $("#txt_CusDoc").val(),
|
|
}
|
|
debugger;
|
|
$gridList.dataGrid({
|
|
url: "/DHAY/ICSSDN/GetItemList" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson), WorkPoint: JSON.stringify(WorkPoints) },
|
|
height: $(window).height() - 120,
|
|
width: $(window).width() - 180,
|
|
colModel: [
|
|
{ label: "主键", name: "ID", hidden: true, key: true },
|
|
{ label: '销售订单编码', name: 'SOCode', width: 240, align: 'left' },
|
|
{ label: '客户订单', name: 'CusDoc', width: 240, align: 'left' },
|
|
{ label: '项次', name: 'Project', width: 80, align: 'left' },
|
|
{ label: '物料编码', name: 'INVCODE', width: 240, align: 'left' },
|
|
{ label: 'U8料号', name: 'U8InvCode', width: 240, align: 'left' },
|
|
{ label: '物料名称', name: 'INVNAME', width: 240, align: 'left' },
|
|
{ label: '数量', name: 'ZQuantity', width: 100, align: 'left' },
|
|
{ label: '订单已发数量', name: 'SOQuantity', width: 150, align: 'left' },
|
|
{ label: '订单剩余数量', name: 'SQuantity', width: 150, align: 'left' },
|
|
{ label: '库存可用数量', name: 'KQuantity', width: 100, align: 'left' },
|
|
{ label: '客户编码', name: 'CusCode', width: 150, align: 'left' },
|
|
{ label: '客户名称', name: 'CusName', width: 200, align: 'left' },
|
|
{ label: '客户品名', name: 'CusInvName', width: 100, align: 'left' },
|
|
{ label: '客户料号', name: 'CusInvCode', width: 150, align: 'left' },
|
|
{ label: '客户版本', name: 'CusVersion', width: 200, align: 'left' },
|
|
{ label: '行号', name: 'Sequence', width: 80, align: 'left' },
|
|
{ label: '数量', name: 'Quantity', width: 100, align: 'left' },
|
|
],
|
|
sortname: 'INVCODE,EATTRIBUTE7 asc,SOCode asc,Cast(Project as int)',
|
|
shrinkToFit: true,//宽度自适应
|
|
pager: "#gridPager",
|
|
//sortname: 'ID',
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
rowNum: 200
|
|
});
|
|
$("#btn_search").click(function () {
|
|
var queryJson = {
|
|
SOCode: $("#txt_SOCode").val(),
|
|
Sequence: $("#txt_Sequence").val(),
|
|
NewInv: $("#txt_NewInv").val(),
|
|
OldInv: $("#txt_OldInv").val(),
|
|
CusCode: $("#txt_CusCode").val(),
|
|
CusName: $("#txt_CusName").val(),
|
|
CusDoc: $("#txt_CusDoc").val(),
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
}
|
|
//提交
|
|
function submitForm() {
|
|
debugger;
|
|
|
|
var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
if (rows.length < 1) {
|
|
$.modalAlertNew("WMS00079");
|
|
return;
|
|
}
|
|
|
|
var objs = [];
|
|
for (var i = 0; i < rows.length; i++) {
|
|
|
|
var SOCode = $("#gridList").jqGrid('getRowData', rows[i]).SOCode;
|
|
$.ajax({
|
|
url: "/DHAY/ICSSDN/GetU9Status?SOCode=" + SOCode+"&" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
debugger;
|
|
if (data.state == "error") {
|
|
$.modalAlert(data.message, data.state);
|
|
return;
|
|
}
|
|
else {
|
|
//判断客户是不是同一个,不是用同一个不能创建在同一个单子里面
|
|
if (Cus == '') {
|
|
Cus = $("#gridList").jqGrid('getRowData', rows[i]).CusCode;
|
|
}
|
|
else {
|
|
if (Cus != $("#gridList").jqGrid('getRowData', rows[i]).CusCode) {
|
|
$.modalAlertNew("WMSAPIInfo506");
|
|
return;
|
|
}
|
|
}
|
|
var obj = {
|
|
ID: guid(),
|
|
INVCODE: $("#gridList").jqGrid('getRowData', rows[i]).INVCODE,
|
|
INVNAME: $("#gridList").jqGrid('getRowData', rows[i]).INVNAME,
|
|
SOCode: SOCode,
|
|
SOSequence: $("#gridList").jqGrid('getRowData', rows[i]).Sequence,
|
|
Project: $("#gridList").jqGrid('getRowData', rows[i]).Project,
|
|
CusCode: $("#gridList").jqGrid('getRowData', rows[i]).CusCode,
|
|
CusDoc: $("#gridList").jqGrid('getRowData', rows[i]).CusDoc,
|
|
CusName: $("#gridList").jqGrid('getRowData', rows[i]).CusName,
|
|
Quantity: $("#gridList").jqGrid('getRowData', rows[i]).Quantity,
|
|
KQuantity: $("#gridList").jqGrid('getRowData', rows[i]).KQuantity,
|
|
SQuantity: $("#gridList").jqGrid('getRowData', rows[i]).SQuantity,
|
|
|
|
}
|
|
objs.push(obj);
|
|
}
|
|
}
|
|
});
|
|
|
|
}
|
|
return objs;
|
|
//var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
//if (rows.length != 1) {
|
|
// $.modalAlertNew("WMS00079");
|
|
// return;
|
|
//}
|
|
//var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
|
|
|
|
//var obj = {
|
|
// INVCODE: rowdata.INVCODE,
|
|
// /*InvStd: rowdata.InvStd,*/
|
|
// INVNAME: rowdata.INVNAME,
|
|
// SOCode: rowdata.SOCode,
|
|
// Sequence: rowdata.Sequence,
|
|
// CusCode: rowdata.CusCode,
|
|
// CusName: rowdata.CusName,
|
|
//}
|
|
//return obj;
|
|
}
|
|
|
|
function Close() {
|
|
$.modalClose();
|
|
}
|
|
</script>
|
|
|
|
<form id="form1">
|
|
<div class="topPanel" style="height:50px">
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>销售订单编码:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_SOCode" type="text" class="form-control" placeholder="销售订单编码" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>行号:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_Sequence" type="text" class="form-control" placeholder="行号" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>新料号:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_NewInv" type="text" class="form-control" placeholder="新料号" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>旧料号:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_OldInv" type="text" class="form-control" placeholder="旧料号" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>客户编码:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_CusCode" type="text" class="form-control" placeholder="客户编码" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>客户名称:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_CusName" type="text" class="form-control" placeholder="客户名称" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;padding: 0 5px 0 5px;">
|
|
<label>客户订单:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_CusDoc" type="text" class="form-control" placeholder="客户订单" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<span class="input-group-btn" style="padding-left:10px;">
|
|
<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>
|