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.
 
 
 
 
 

215 lines
7.8 KiB

@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Index.cshtml";
}
<style>
#ISO {
width: 10px;
}
</style>
<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
<script src="~/Content/js/select2/select2.min.js"></script>
<script>
var ID = $.request("ID");
var Warehouse = $.request("Warehouse");
var WarehouseName = decodeURI($.request("WarehouseName"));
//var WarehouseName = decodeURI($.getUrlParam("WarehouseName"));
var LocationCode = $.request("LocationCode");
var LocationName = decodeURI($.request("LocationName"));
//var expArrivalDate = $
$(function () {
debugger;
InitControl();
if (ID != "") {
//$("#sel_Warehouse").children('option:selected').val(WarehouseName)
$("#sel_Warehouse").val([WarehouseName]).trigger("change");
$("#WarehouseName").val(WarehouseName);
var s = LocationName;
var str = LocationCode.split('-');
for (var i = 1; i <= str.length; i++) {
if (i == 1)
$("#Qu").val(str[1]);
if (i == 2)
$("#Pai").val(str[2]);
if (i == 3)
$("#Jia").val(str[3]);
if (i == 4)
$("#Ceng").val(str[4]);
if (i == 5)
$("#Ge").val(str[5]);
}
}
$("#sel_Warehouse").change(function () {
debugger;
var Was = $("#sel_Warehouse").children('option:selected').val();
$("#WarehouseName").val(Was);
//var VenCode = $("#sel_VenCode").children('option:selected').val();
});
});
$.getUrlParam = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
;
function InitControl() {
debugger;
var $VenCode = $("#sel_Warehouse");
$VenCode.select2({
allowClear: true,
escapeMarkup: function (m) {
return m;
}
});
$.ajax({
url: "/PNWMS/BasicSettings/GetWarehouse" + "?" + Math.random(),
dataType: "json",
async: false,
success: function (data) {
$.each(data, function (index, item) {
$VenCode.append("<option value='" + item.WarehouseName + "'>" + item.WarehouseCode + "</option>");
});
}
});
}
//新增库位
function submitForm() {
debugger;
var StackCode = "";
var StackName = "";
var Warehouse = "";
var WarehouseName = "";
var Qu = $("#Qu").val();
var Pai = $("#Pai").val();
var Jia = $("#Jia").val();
var Ceng = $("#Ceng").val();
var Ge = $("#Ge").val();
if (Qu == "" && Pai == "" && Jia == "" && Ceng == "" && Ge == "") {
$.modalAlertNew("WMS00062");
return;
}
StackCode = $("#sel_Warehouse").find("option:selected").text();
StackName = $("#sel_Warehouse").find("option:selected").text() + "仓库";
if (Qu != "") {
StackCode += Qu;
// StackCode += "-" + Qu;
StackName += Qu + "区";
}
if (Pai != "") {
StackCode += Pai;
// StackCode += "-" + Pai;
StackName += Pai + "排";
}
if (Jia != "") {
StackCode +=Jia;
// StackCode += "-" + Jia;
StackName += Jia + "货架";
}
if (Ceng != "") {
StackCode += Ceng;
// StackCode += "-" + Ceng;
StackName += Ceng + "层";
}
if (Ge != "") {
StackCode += Ge;
// StackCode += "-" + Ge;
StackName += Ge + "格";
}
var objArr = {
ID:ID,
StackCode:StackCode,
StackName: StackName,
Qu : $("#Qu").val(),
Pai : $("#Pai").val(),
Jia : $("#Jia").val(),
Ceng : $("#Ceng").val(),
Ge : $("#Ge").val(),
Warehouse:$("#sel_Warehouse").find("option:selected").text(),
WarehouseName:$("#WarehouseName").val()
}
if (ID != "") {
$.submitForm({
url: "/PNWMS/BasicSettings/UpdateStack" + "?" + Math.random(),
param: { keyValue: JSON.stringify(objArr) },
success: function () {
$.currentWindow().$("#gridList").trigger("reloadGrid");
}
})
} else {
$.submitForm({
url: "/PNWMS/BasicSettings/InsertStack" + "?" + Math.random(),
param: { keyValue: JSON.stringify(objArr) },
success: function () {
$.currentWindow().$("#gridList").trigger("reloadGrid");
}
})
}
}
</script>
<form id="form1">
<div style="padding-top: 20px; margin-right: 20px;">
<table class="form">
<tr>
<th class="formTitle">库房编号:</th>
<td style="width:100px">
<select id="sel_Warehouse" name="sel_Warehouse" class="form-control select2" style="width: 500px" placeholder="库房编号"></select>
<input type="hidden" id="hidetext" />
</td>
</tr>
<tr>
<th class="formTitle">库房名称:</th>
<td class="formValue">
<input id="WarehouseName" name="WarehouseName" type="text" class="form-control required" style="width: 300px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="库房名称" />
</td>
</tr>
<tr>
<th class="formTitle">库位编号:</th>
<td class="formValue">
<input id="Qu" name="Qu" type="text" class="form-control required" style="width:80px;" maxlength="10" placeholder="仓库编码" />
</td>
@*<td id="ISO">-</td>*@
<td class="formValue">
<input id="Pai" name="Pai" type="text" class="form-control required" style="width: 80px;" maxlength="10" placeholder="库区编码" />
</td>
@*<td style="width:30px">-</td>*@
<td class="formValue">
<input id="Jia" name="Jia" type="text" class="form-control required" style="width: 80px;" maxlength="10" placeholder="货架编码" />
</td>
@*<td style="width:30px">-</td>*@
<td class="formValue">
<input id="Ceng" name="Ceng" type="text" class="form-control required" style="width: 80px;" maxlength="10" placeholder="层编码" />
</td>
@*<td style="width:30px">-</td>*@
<td class="formValue" style="display:none">
<input id="Ge" name="Ge" type="text" class="form-control required" style="width: 80px;" maxlength="10" placeholder="格" />
</td>
</tr>
<tr>
<th class="formTitle">格式:</th>
<td class="formValue">
<span>&nbsp;区</span>
</td>
<td class="formValue">
<span>&nbsp;排</span>
</td>
<td class="formValue">
<span>&nbsp;货架</span>
</td>
<td class="formValue">
<span>&nbsp;层</span>
</td>
<td class="formValue">
<span>&nbsp;格</span>
</td>
</tr>
</table>
</div>
</form>