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.
133 lines
4.6 KiB
133 lines
4.6 KiB
|
|
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Form.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 BoxNumber = $.request("BoxNumber");
|
|
//var WarehouseName = decodeURI($.getUrlParam("WarehouseName"));
|
|
var BoxCode = $.request("BoxCode");
|
|
var Describe = $.request("Describe");
|
|
var BoxName = decodeURI($.request("BoxName"));
|
|
$(function () {
|
|
debugger;
|
|
InitControl();
|
|
if (ID != "") {
|
|
$("#sel_BoxNumber").val([BoxNumber]).trigger("change");
|
|
$("#BoxName").val(BoxName);
|
|
|
|
$("#Describe").val(Describe);
|
|
|
|
$("#BoxCode").val(BoxCode);
|
|
}
|
|
});
|
|
$.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_BoxNumber");
|
|
$VenCode.select2({
|
|
allowClear: true,
|
|
escapeMarkup: function (m) {
|
|
return m;
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "/Boxes/BasicSettings/GetBoxNumber" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
$.each(data, function (index, item) {
|
|
$VenCode.append("<option value='" + item.BoxNumber + "'>" + item.BoxNumber + "</option>");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function submitForm() {
|
|
var BoxCode = $("#BoxCode").val();//周转箱代码
|
|
var BoxNumber = $("#sel_BoxNumber").find("option:selected").text();//周转箱编码
|
|
var BoxName = $("#BoxName").val();//周转箱名称
|
|
var Describe = $("#Describe").val();//周转箱描述
|
|
if (BoxCode == "" || BoxCode == undefined) {
|
|
$.modalAlertNew("WMS00113");
|
|
return;
|
|
}
|
|
if (BoxNumber == "" || BoxNumber == undefined) {
|
|
$.modalAlertNew("WMS00114");
|
|
return;
|
|
}
|
|
if (BoxName == "" || BoxName == undefined) {
|
|
$.modalAlertNew("WMS00115");
|
|
return;
|
|
}
|
|
var objArr = {
|
|
ID: ID,
|
|
BoxCode: BoxCode,
|
|
BoxNumber: BoxNumber,
|
|
BoxName: BoxName,
|
|
Describe: Describe
|
|
}
|
|
debugger;
|
|
if (ID != "") {
|
|
$.submitForm({
|
|
url: "/Boxes/BasicSettings/UpdateBoxAccount" + "?" + Math.random(),
|
|
param: { keyValue: JSON.stringify(objArr) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
} else {
|
|
$.submitForm({
|
|
url: "/Boxes/BasicSettings/InsertBoxAccount" + "?" + Math.random(),
|
|
param: { keyValue: JSON.stringify(objArr) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<form id="form1">
|
|
<div style="padding-top: 50px; margin-right: 50px;">
|
|
<table class="form">
|
|
<tr>
|
|
<th class="formTitle">周转箱编码:</th>
|
|
<td style="width:150px">
|
|
<select id="sel_BoxNumber" name="sel_BoxNumber" class="form-control select2" style="width: 135px; height: 25px;" placeholder="周转箱编码"></select>
|
|
<input type="hidden" id="hidetext" />
|
|
</td>
|
|
<th class="formTitle">名称:</th>
|
|
<td class="formValue">
|
|
<input id="BoxName" name="BoxName" type="text" class="form-control required" style="width: 150px;" maxlength="10" placeholder="名称" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">周转箱代码:</th>
|
|
<td class="formValue">
|
|
<input id="BoxCode" name="BoxCode" type="text" class="form-control required" maxlength="10" placeholder="周转箱代码" />
|
|
</td>
|
|
<th class="formTitle">描述:</th>
|
|
<td class="formValue">
|
|
<input id="Describe" name="Describe" type="text" class="form-control required" style="width: 150px; " maxlength="10" placeholder="描述" />
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</form>
|