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.
257 lines
10 KiB
257 lines
10 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 Type = $.request("Type");
|
|
var Version = $.request("Version");
|
|
var BoxName = decodeURI($.request("BoxName"));
|
|
var Specification = $.request("Specification");
|
|
var Describe = $.request("Describe");
|
|
var FirstCleanCycle = $.request("FirstCleanCycle");
|
|
var SecondCleanCycle = $.request("SecondCleanCycle");
|
|
var ThirdCleanCycle = $.request("ThirdCleanCycle");
|
|
//var expArrivalDate = $
|
|
$(function () {
|
|
debugger;
|
|
InitControl();
|
|
if (ID != "") {
|
|
|
|
$("#sel_Type").val([Type]).trigger("change");
|
|
|
|
$("#BoxNumber").val(BoxNumber);
|
|
|
|
$("#BoxName").val(BoxName);
|
|
|
|
$("#Version").val(Version);
|
|
|
|
$("#Specification").val(Specification);
|
|
|
|
$("#Describe").val(Describe);
|
|
$("#FirstCleanCycle").val(FirstCleanCycle);
|
|
|
|
$("#SecondCleanCycle").val(SecondCleanCycle);
|
|
|
|
$("#ThirdCleanCycle").val(ThirdCleanCycle);
|
|
}
|
|
|
|
});
|
|
$.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_Type");
|
|
$VenCode.select2({
|
|
allowClear: true,
|
|
escapeMarkup: function (m) {
|
|
return m;
|
|
}
|
|
});
|
|
$.ajax({
|
|
url: "/Boxes/BasicSettings/GetType?tableName=" + "ICSWorkingCapitalBox" + "&" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
$.each(data, function (index, item) {
|
|
$VenCode.append("<option value='" + item.Type + "'>" + item.Type + "</option>");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
//新增条码
|
|
function btnCreate() {
|
|
var STNO = $("#STNO").text();
|
|
Vendor = $("#sel_VenCode").find("option:selected").val();
|
|
if (STNO == "") {
|
|
$.modalAlertNew("WMS00059");
|
|
return;
|
|
}
|
|
var expArrivalDate = $("#ExpArivalDate").val();
|
|
if (expArrivalDate == '' || expArrivalDate == null) {
|
|
$.modalAlertNew("WMS00060");
|
|
return;
|
|
}
|
|
$.modalOpen2({
|
|
id: "Form",
|
|
title: "条码信息",
|
|
url: "/SRM/ASNSelect/Index?STNO=" + STNO + "&Vendor=" + Vendor + "&" + Math.random(),
|
|
width: "800px",
|
|
height: "500px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
//新增箱号
|
|
function btnAddCartonNo() {
|
|
var STNO = $("#STNO").text();
|
|
Vendor = $("#sel_VenCode").find("option:selected").val();
|
|
|
|
if (STNO == "") {
|
|
$.modalAlertNew("WMS00059");
|
|
return;
|
|
}
|
|
var expArrivalDate = $("#ExpArivalDate").val();
|
|
if (expArrivalDate == '' || expArrivalDate == null) {
|
|
$.modalAlertNew("WMS00060");
|
|
return;
|
|
}
|
|
$.modalOpen2({
|
|
id: "Form",
|
|
title: "箱号信息",
|
|
url: "/SRM/ASNCartonSelect/Index?STNO=" + STNO + "&Vendor=" + Vendor + "&" + Math.random(),
|
|
width: "800px",
|
|
height: "500px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
//刷新
|
|
function reloadData() {
|
|
STNO = $("#STNO").text();
|
|
var queryJson = {
|
|
STNO: STNO,
|
|
}
|
|
$("#gridList").jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
}
|
|
//删除条码
|
|
function btn_delete() {
|
|
var objArr = "";
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
if (objList.length == 0) {
|
|
$.modalAlertNew("WMS00061");
|
|
return;
|
|
}
|
|
for (var i = 0; i < objList.length; i++) {
|
|
var rowId = objList[i];
|
|
var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
objArr += "'" + rowData.ASNDETAILID + "',";
|
|
}
|
|
$.deleteForm({
|
|
url: "/SRM/ASNAdd/DeleteInfo" + "?" + Math.random(),
|
|
param: { keyValue: JSON.stringify(objArr) },
|
|
success: function () {
|
|
reloadData();
|
|
}
|
|
})
|
|
}
|
|
//新增周转箱
|
|
function submitForm() {
|
|
debugger;
|
|
var BoxNumber = $("#BoxNumber").val();
|
|
var BoxName = $("#BoxName").val();
|
|
var Type = $("#sel_Type").find("option:selected").text();
|
|
var Version = $("#Version").val();
|
|
var Specification = $("#Specification").val();
|
|
var Describe = $("#Describe").val();
|
|
var FirstCleanCycle = $("#FirstCleanCycle").val();
|
|
var SecondCleanCycle = $("#SecondCleanCycle").val();
|
|
var ThirdCleanCycle = $("#ThirdCleanCycle").val();
|
|
if (BoxNumber == "" || BoxName == "" || Type == "" || Specification == "" || FirstCleanCycle == "" || SecondCleanCycle == "" || ThirdCleanCycle == "") {
|
|
$.modalAlertNew("WMS00062");
|
|
return;
|
|
}
|
|
|
|
var objArr = {
|
|
ID:ID,
|
|
BoxNumber: $("#BoxNumber").val(),
|
|
BoxName: decodeURI($("#BoxName").val()),
|
|
Type: $("#sel_Type").find("option:selected").text(),
|
|
Version: $("#Version").val(),
|
|
Specification: $("#Specification").val(),
|
|
Describe: $("#Describe").val(),
|
|
FirstCleanCycle: $("#FirstCleanCycle").val(),
|
|
SecondCleanCycle: $("#SecondCleanCycle").val(),
|
|
ThirdCleanCycle: $("#ThirdCleanCycle").val(),
|
|
Type: $("#sel_Type").find("option:selected").text(),
|
|
}
|
|
if (ID != "") {
|
|
$.submitForm({
|
|
url: "/Boxes/BasicSettings/UpdateBoxes" + "?" + Math.random(),
|
|
param: { keyValue: JSON.stringify(objArr) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
} else {
|
|
$.submitForm({
|
|
url: "/Boxes/BasicSettings/InsertBoxes" + "?" + 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"><span style="color: red;">*</span>周转箱编码:</th>
|
|
<td class="formValue">
|
|
<input id="BoxNumber" name="BoxNumber" type="text" class="form-control required" style="width: 150px;" maxlength="10" placeholder="周转箱编码" required />
|
|
</td>
|
|
<th class="formTitle"><span style="color: red;">*</span>名称:</th>
|
|
<td class="formValue">
|
|
<input id="BoxName" name="BoxName" type="text" class="form-control required" style="width: 160px; " maxlength="10" placeholder="名称" required/>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>型号:</th>
|
|
<td class="formValue">
|
|
<input id="Version" name="Version" type="text" class="form-control required" style="width: 150px;" maxlength="10" placeholder="型号" required/>
|
|
</td>
|
|
<th class="formTitle"><span style="color: red;">*</span>类型:</th>
|
|
<td style="width:150px">
|
|
<select id="sel_Type" name="sel_Type" class="form-control select2 required" style="width: 135px; height: 25px;" placeholder="类型"></select>
|
|
<input type="hidden" id="hidetext" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>第一次清洗周期:</th>
|
|
<td class="formValue">
|
|
<input id="FirstCleanCycle" name="FirstCleanCycle" type="text" ,class="form-control required" style="width: 150px; height: 25px; " placeholder="/次" required/>
|
|
</td>
|
|
<th class="formTitle">描述:</th>
|
|
<td class="formValue">
|
|
<input id="Describe" name="Describe" type="text" class="form-control required" style="width: 160px; " maxlength="10" placeholder="描述" />
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>第二次清洗周期:</th>
|
|
<td class="formValue">
|
|
<input id="SecondCleanCycle" name="SecondCleanCycle" type="text" class="form-control required" style="width: 150px; " maxlength="10" placeholder="/次" required />
|
|
</td>
|
|
<th class="formTitle"><span style="color: red;">*</span>规格:</th>
|
|
<td class="formValue">
|
|
<input id="Specification" name="Specification" type="text" class="form-control required" style="width: 160px; " maxlength="10" placeholder="规格" required/>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>第三次清洗周期:</th>
|
|
<td class="formValue">
|
|
<input id="ThirdCleanCycle" name="ThirdCleanCycle" type="text" class="form-control required" style="width: 150px;" maxlength="10" placeholder="/次" />
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</form>
|