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.
 
 
 
 
 

204 lines
7.5 KiB

@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Form.cshtml";
}
@*<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
<script src="~/Content/js/select2/select2.min.js"></script>*@
<link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" />
<script src="~/Content/js/CommonReport/CommonReport.js"></script>
<link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
<script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
<style>
.form {
margin: 25px 15px;
}
</style>
<script>
var subgridCang = 'gridList';
var subgridQu = '';
var subgridPai = '';
var subgridHuo = '';
var subgridCeng = '';
var subgridGe = '';
//var subgrid_table_id = '';
var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
var User = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
var Times = new Date();
var Time = formatDate("YYYY-mm-dd HH:MM:SS", Times);
var Lots = decodeURI($.request("Lots"));
$(function () {
$("#minPackQty").keyup(function () {
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
}).bind("paste", function () { //CTR+V事件处理
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
}).css("ime-mode", "disabled"); //CSS设置输入法不可用
$("#thisCreateQty").keyup(function () {
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
}).bind("paste", function () { //CTR+V事件处理
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
}).css("ime-mode", "disabled"); //CSS设置输入法不可用
$("#cretePageCount").keyup(function () {
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
}).bind("paste", function () { //CTR+V事件处理
$(this).val($(this).val().replace(/[^0-9.]/g, ''));
}).css("ime-mode", "disabled"); //CSS设置输入法不可用
gridList();
$("#txtMUSER").val(User);
$("#txtMTIME").val(Time);
$("#txtMUSER").attr("disabled", "disabled");
$("#txtMTIME").attr("disabled", "disabled");
});
function formatDate(fomatType, date) {
let ret;
let valueDate = date;
if (!date) valueDate = new Date()
let opt = {
"Y+": valueDate.getFullYear().toString(), // 年
"m+": (valueDate.getMonth() + 1).toString(), // 月
"d+": valueDate.getDate().toString(), // 日
"H+": valueDate.getHours().toString(), // 时
"M+": valueDate.getMinutes().toString(), // 分
"S+": valueDate.getSeconds().toString() // 秒
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fomatType);
if (ret) {
fomatType = fomatType.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fomatType;
}
// 仓库
function gridList() {
debugger;
var $gridList = $("#gridList");
// 初始化表格
$gridList.dataGrid({
url: "/HGWMS/ICSTransfer/GetLocationCode" + "?" + Math.random(),
height: $(window).height() - 128,
width: $(window).width() - 128,
postData: {
queryJson: JSON.stringify({
WarehouseCode: $("#txt_WarehouseCode").val(),
LocationCode: $("#txt_LocationCode").val()
})
},
colModel: [
{ label: '主键', name: 'Id', hidden: true, key: true },
{ label: "ID", name: "ID", hidden: true },
{ label: '仓库编码', name: 'WarehouseCode', width: 120, align: 'left' }, // 修正了aligpager的错误
{ label: '仓库名称', name: 'WarehouseName', width: 120, align: 'left' },
{ label: '库位编码', name: 'LocationCode', width: 120, align: 'left' },
{ label: '库位名称', name: 'LocationName', width: 120, align: 'left' }
],
pager: "#gridPager",
sortname: 'WarehouseCode',
sortorder: "desc",
viewrecords: true,
multiselect: true
});
// 搜索按钮点击事件
$("#btn_search").click(function () {
var queryJson = {
WarehouseCode: $("#txt_WarehouseCode").val(),
LocationCode: $("#txt_LocationCode").val()
};
// 重置表格参数并重新加载,同时确保显示第一页
$gridList.jqGrid('setGridParam', {
postData: {
queryJson: JSON.stringify(queryJson)
},
page: 1 // 重置到第一页
}).trigger('reloadGrid');
});
}
function submitForm() {
debugger;
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
if (objList.length > 1) {
$.modalAlertNew("WMS00079");
return;
}
var rowId = objList[0];
var rowData = $("#gridList").jqGrid('getRowData', rowId);
var Parameter = {
User: User,
Lots: Lots,
LocationCode: rowData.LocationCode,
WarehouseCode: rowData.WarehouseCode
}
$.submitForm({
url: "/HGWMS/ICSTransfer/AddICSTransfer?" + Math.random(),
param: { keyValue: JSON.stringify(Parameter) },
success: function (data) {
if (data.status == "sucess") {
$.currentWindow().$("#gridList").trigger("reloadGrid");
}
else {
alert(data.message);
return;
}
}
})
}
</script>
<form id="form1">
<div class="search" style="padding-top: 2px; margin-right: 20px;">
@*<table class="form">*@
<table class="form">
<tr>
<th class="formTitle">创建人:</th>
<td class="formValue">
<input id="txtMUSER" name="txtMUSER" type="text" class="form-control" style="width: 160px" />
</td>
<th class="formTitle">仓库编码:</th>
<td class="formValue">
<input type="text" name="txt_WarehouseCode" id="txt_WarehouseCode" class="form-control" placeholder="仓库编码" />
</td>
<th class="formTitle">库位编码:</th>
<td class="formValue">
<input type="text" name="txt_LocationCode" id="txt_LocationCode" class="form-control" placeholder="库位编码" />
</td>
<th class="formTitle">创建日期:</th>
<td class="formValue">
<input id="txtMTIME" name="txtMTIME" type="text" class="form-control " style="width: 160px" />
</td>
<td>
<span class="input-group-btn" style="font-size: 12px" >
<button id="btn_search" type="button" class="btn btn-primary" onclick="Selchange()"><i class="fa fa-search"></i></button>
</span>
</td>
</tr>
</table>
</div>
</form>
<div class="gridPanel">
<table id="gridList"></table>
<div id="gridPager"></div>
</div>