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.
967 lines
41 KiB
967 lines
41 KiB
|
|
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Form.cshtml";
|
|
}
|
|
<script>
|
|
var CheckCode = $.request("CheckCode");
|
|
var Type = $.request("Type");
|
|
var VenCode = "";
|
|
var WorkPoint = "";
|
|
var Mtime = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();
|
|
var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
|
|
//料品辅助计量开关
|
|
var InvAmountEnable = false;
|
|
|
|
//主计量、辅计量标志
|
|
var minPackQtyEnable = false;
|
|
var AmountEnable = false;
|
|
|
|
//本次生成数量、最小包装量、计量标志
|
|
var thisCreateQtyEnable = false;
|
|
var MeasureEnable = false;
|
|
var cretePageCountEnable = false;
|
|
var IsContainerEnable = false;
|
|
|
|
|
|
$(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设置输入法不可用
|
|
$("#PRODUCTDATE").val(Mtime);
|
|
|
|
|
|
$("#creatPackCount").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设置输入法不可用
|
|
|
|
$("#INVUOM").attr("disabled", "disabled");
|
|
$("#INVNAME").attr("disabled", "disabled");
|
|
$("#INVSTD").attr("disabled", "disabled");
|
|
$("#Quantity").attr("disabled", "disabled");
|
|
$("#WHCode").attr("disabled", "disabled");
|
|
SeachMeasure();
|
|
SeachLableofDisable();
|
|
SeachDatabyInvCode(InvCode);//查是否启用府计量 AmountEnable;是否自动生成箱号 ContainerEnable;
|
|
SeachInfoByCodeAndSequence();
|
|
debugger;
|
|
if (thisCreateQtyEnable == true && cretePageCountEnable == true)
|
|
{
|
|
$("#Amount").attr("disabled", "disabled");
|
|
$("#minPackQty").attr("disabled", "disabled");
|
|
$("#cretePageCount").change(cretePageCount_Change);
|
|
$("#thisCreateQty").change(thisCreate_Change);
|
|
|
|
}
|
|
else if (thisCreateQtyEnable == true && MeasureEnable==true)
|
|
{
|
|
if (InvAmountEnable == true && AmountEnable == true)
|
|
{
|
|
$("#cretePageCount").attr("disabled", "disabled");
|
|
$("#minPackQty").attr("disabled", "disabled");
|
|
$("#Amount").change(Amount_Change);
|
|
$("#thisCreateQty").change(thisCreate_Change);
|
|
}
|
|
else
|
|
{
|
|
//基础版原逻辑
|
|
$("#Amount").attr("disabled", "disabled");
|
|
$("#cretePageCount").attr("disabled", "disabled");
|
|
$("#minPackQty").change(minPack_Change);
|
|
$("#thisCreateQty").change(thisCreate_Change);
|
|
//$("#minPackQty").change(minPackQty_Change);
|
|
//$("#thisCreateQty").change(thisCreateQty_Change);
|
|
//$("#cretePageCount").change(function () {
|
|
// var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
|
|
// createPageCount = createPageCount.toFixed(0);
|
|
// if (createPageCount <= 0) {
|
|
// $.modalAlertNew("WMS00102");
|
|
// return false;
|
|
// }
|
|
//});
|
|
}
|
|
}
|
|
else if (MeasureEnable == true && cretePageCountEnable==true)
|
|
{
|
|
if (InvAmountEnable == true && AmountEnable == true)
|
|
{
|
|
$("#minPackQty").attr("disabled", "disabled");
|
|
$("#thisCreateQty").attr("disabled", "disabled");
|
|
$("#Amount").change(Amount_Change);
|
|
$("#cretePageCount").change(cretePageCount_Change);
|
|
|
|
}
|
|
else
|
|
{
|
|
$("#Amount").attr("disabled", "disabled");
|
|
$("#thisCreateQty").attr("disabled", "disabled");
|
|
$("#minPackQty").change(minPack_Change);
|
|
$("#cretePageCount").change(cretePageCount_Change);
|
|
}
|
|
}
|
|
|
|
if (IsContainerEnable == true)//是否自动生成箱号 ContainerEnable=true
|
|
{
|
|
|
|
}
|
|
else//是否自动生成箱号 ContainerEnable=false
|
|
{
|
|
$(".HideTxt").css('display', 'none');
|
|
}
|
|
ControlVendorLotNo(VenCode);
|
|
ControlICSExtensionEnable();
|
|
ControlICSColumnEnable();
|
|
LoadShow();
|
|
LoadShowForColumn();
|
|
});
|
|
|
|
//查询料品辅计量开关
|
|
function SeachDatabyInvCode(InvCode) {
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/SeachDatabyInvCode?InvCode=" + InvCode + "&" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data.rows[0].AmountEnable == '1') {
|
|
InvAmountEnable = true;
|
|
}
|
|
if (data.rows[0].ContainerEnable == '1') {
|
|
IsContainerEnable = true;
|
|
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//查询配置项-计量单位
|
|
function SeachMeasure() {
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/SeachMeasure" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data.rows[0].Code == 'AmountEnable') {
|
|
AmountEnable = true;
|
|
} else {
|
|
minPackQtyEnable = true;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//查询配置项-栏位输入限制
|
|
function SeachLableofDisable() {
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/SeachLableofDisable" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data.rows[0].Code == 'thisCreateQtyEnable' && data.rows[0].Enable==true) {
|
|
thisCreateQtyEnable = true;
|
|
}
|
|
if (data.rows[1].Code == 'MeasureEnable' && data.rows[1].Enable == true) {
|
|
MeasureEnable = true;
|
|
}
|
|
if (data.rows[2].Code == 'cretePageCountEnable' && data.rows[2].Enable == true) {
|
|
cretePageCountEnable = true;
|
|
}
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
//加载页面信息
|
|
function SeachInfoByCodeAndSequence() {
|
|
$.ajax({
|
|
url: "/PNWMS/Blitem/GetCheckDocInfo?CheckCode=" + CheckCode + "&WorkPoint=" + WorkPoints,
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
LotNoInfoControlFreeTerm(data.rows[0].WHCode, data.rows[0].BatchCode, data.rows[0].WorkPoint, data.rows[0].ProjectCode, data.rows[0].BatchCode, data.rows[0].Version, data.rows[0].Brand, data.rows[0].cFree1, data.rows[0].cFree2, data.rows[0].cFree3, data.rows[0].cFree4, data.rows[0].cFree5, data.rows[0].cFree6, data.rows[0].cFree7, data.rows[0].cFree8, data.rows[0].cFree9, data.rows[0].cFree10, data.rows[0].ClassCode, data.rows[0].EATTRIBUTE2, data.rows[0].EATTRIBUTE3, data.rows[0].EATTRIBUTE4, data.rows[0].EATTRIBUTE5, data.rows[0].EATTRIBUTE6, data.rows[0].EATTRIBUTE7, data.rows[0].EATTRIBUTE8, data.rows[0].EATTRIBUTE9, data.rows[0].EATTRIBUTE10)
|
|
}
|
|
});
|
|
}
|
|
|
|
//查询后台自由项表(控制前台显示)
|
|
function ControlICSExtensionEnable() {
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/SelectICSExtensionEnable" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
if (data != null && data.length > 0) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
if (data[i].ColCode == 'ProjectCode') { $("#trProjectCode").css('display', 'none'); }
|
|
if (data[i].ColCode == 'BatchCode') { $("#trBatchCode").css('display', 'none'); }
|
|
if (data[i].ColCode == 'Version') { $("#trVersion").css('display', 'none'); }
|
|
if (data[i].ColCode == 'Brand') { $("#trBrand").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree1') { $("#trcFree1").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree2') { $("#trcFree2").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree3') { $("#trcFree3").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree4') { $("#trcFree4").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree5') { $("#trcFree5").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree6') { $("#trcFree6").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree7') { $("#trcFree7").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree8') { $("#trcFree8").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree9') { $("#trcFree9").css('display', 'none'); }
|
|
if (data[i].ColCode == 'cFree10') { $("#trcFree10").css('display', 'none'); }
|
|
//if (i >= 4) {
|
|
// if (data[i].ColName == 'cFree' + (i - 3)) {$("#trcFree'" + (i - 3) + "'").css('display', 'none');}
|
|
//}
|
|
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//查询后台条码表单据自定义项(控制前台显示)
|
|
function ControlICSColumnEnable() {
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/SelectICSColumnEnableForLotEnable" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
if (data != null && data.length > 0) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
|
|
//if (data[i].ColumnCode == 'EATTRIBUTE1') { $("#trEATTRIBUTE1").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE2') { $("#trEATTRIBUTE2").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE3') { $("#trEATTRIBUTE3").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE4') { $("#trEATTRIBUTE4").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE5') { $("#trEATTRIBUTE5").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE6') { $("#trEATTRIBUTE6").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE7') { $("#trEATTRIBUTE7").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE8') { $("#trEATTRIBUTE8").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE9') { $("#trEATTRIBUTE9").css('display', 'none'); }
|
|
if (data[i].ColumnCode == 'EATTRIBUTE10') { $("#trEATTRIBUTE10").css('display', 'none'); }
|
|
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function ControlVendorLotNo(VenCode) {
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/GetVendorLotNo?VenCode=" + VenCode + "&WorkPoint=" + WorkPoint,
|
|
//data: { keyValue: keyValue },
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
$("#VendorLotNo").val(data.VendorLotNo);
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
//控制加载信息的公共方法
|
|
|
|
function LotNoInfoControlFreeTerm(WHCode, EffectiveEnable, EffectiveDays, BatchCode, WorkPoint, ProjectCode, BatchCode, Version, Brand, cFree1, cFree2, cFree3, cFree4, cFree5, cFree6, cFree7, cFree8, cFree9, cFree10, ClassCode, EATTRIBUTE2, EATTRIBUTE3, EATTRIBUTE4, EATTRIBUTE5, EATTRIBUTE6, EATTRIBUTE7, EATTRIBUTE8, EATTRIBUTE9, EATTRIBUTE10) {
|
|
debugger;
|
|
|
|
|
|
$("#EffectiveEnable").val(EffectiveEnable);
|
|
$("#EffectiveDays").val(EffectiveDays);
|
|
|
|
$("#WHCode").val(WHCode);
|
|
VenCode = VenCode;
|
|
WorkPoint = WorkPoint;
|
|
|
|
if (ProjectCode != "") { $("#ProjectCode").prop("disabled", true); $("#ProjectCode").val(ProjectCode);}
|
|
if (BatchCode != "") { $("#BatchCode").prop("disabled", true); $("#BatchCode").val(BatchCode); }
|
|
if (Version != "") { $("#Version").prop("disabled", true); $("#Version").val(Version); }
|
|
if (Brand != "") { $("#Brand").prop("disabled", true); $("#Brand").val(Brand); }
|
|
if (cFree1 != "") { $("#cFree1").prop("disabled", true); $("#cFree1").val(cFree1); }
|
|
if (cFree2 != "") { $("#cFree2").prop("disabled", true); $("#cFree2").val(cFree2); }
|
|
if (cFree3 != "") { $("#cFree3").prop("disabled", true); $("#cFree3").val(cFree3); }
|
|
if (cFree4 != "") { $("#cFree4").prop("disabled", true); $("#cFree4").val(cFree4); }
|
|
if (cFree5 != "") { $("#cFree5").prop("disabled", true); $("#cFree5").val(cFree5); }
|
|
if (cFree6 != "") { $("#cFree6").prop("disabled", true); $("#cFree6").val(cFree6); }
|
|
if (cFree7 != "") { $("#cFree7").prop("disabled", true); $("#cFree7").val(cFree7); }
|
|
if (cFree8 != "") { $("#cFree8").prop("disabled", true); $("#cFree8").val(cFree8); }
|
|
if (cFree9 != "") { $("#cFree9").prop("disabled", true); $("#cFree9").val(cFree9); }
|
|
if (cFree10 != "") { $("#cFree10").prop("disabled", true); $("#cFree10").val(cFree10); }
|
|
//if (EATTRIBUTE1 != "") { $("#EATTRIBUTE1").prop("disabled", true); $("#EATTRIBUTE1").val(EATTRIBUTE1); }
|
|
if (EATTRIBUTE2 != "") { $("#EATTRIBUTE2").prop("disabled", true); $("#EATTRIBUTE2").val(EATTRIBUTE2); }
|
|
if (EATTRIBUTE3 != "") { $("#EATTRIBUTE3").prop("disabled", true); $("#EATTRIBUTE3").val(EATTRIBUTE3); }
|
|
if (EATTRIBUTE4 != "") { $("#EATTRIBUTE4").prop("disabled", true); $("#EATTRIBUTE4").val(EATTRIBUTE4); }
|
|
if (EATTRIBUTE5 != "") { $("#EATTRIBUTE5").prop("disabled", true); $("#EATTRIBUTE5").val(EATTRIBUTE5); }
|
|
if (EATTRIBUTE6 != "") { $("#EATTRIBUTE6").prop("disabled", true); $("#EATTRIBUTE6").val(EATTRIBUTE6); }
|
|
if (EATTRIBUTE7 != "") { $("#EATTRIBUTE7").prop("disabled", true); $("#EATTRIBUTE7").val(EATTRIBUTE7); }
|
|
if (EATTRIBUTE8 != "") { $("#EATTRIBUTE8").prop("disabled", true); $("#EATTRIBUTE8").val(EATTRIBUTE8); }
|
|
if (EATTRIBUTE9 != "") { $("#EATTRIBUTE9").prop("disabled", true); $("#EATTRIBUTE9").val(EATTRIBUTE9); }
|
|
if (EATTRIBUTE10 != "") { $("#EATTRIBUTE10").prop("disabled", true); $("#EATTRIBUTE10").val(EATTRIBUTE10); }
|
|
if (MPQ != "") {
|
|
$("#minPackQty").val(MPQ);
|
|
minPack_Change();
|
|
}
|
|
}
|
|
//加载自由项名字
|
|
function LoadShow() {
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/GetLoadShow" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
|
|
$("#LableProjectCode").text(data.rows[0].ColName);
|
|
$("#LableBatchCode").text(data.rows[1].ColName);
|
|
$("#LableVersion").text(data.rows[2].ColName);
|
|
$("#LableBrand").text(data.rows[3].ColName);
|
|
$("#LablecFree1").text(data.rows[4].ColName);
|
|
$("#LablecFree2").text(data.rows[5].ColName);
|
|
$("#LablecFree3").text(data.rows[6].ColName);
|
|
$("#LablecFree4").text(data.rows[7].ColName);
|
|
$("#LablecFree5").text(data.rows[8].ColName);
|
|
$("#LablecFree6").text(data.rows[9].ColName);
|
|
$("#LablecFree7").text(data.rows[10].ColName);
|
|
$("#LablecFree8").text(data.rows[11].ColName);
|
|
$("#LablecFree9").text(data.rows[12].ColName);
|
|
$("#LablecFree10").text(data.rows[13].ColName);
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
//加载自定义项名字
|
|
function LoadShowForColumn() {
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/GetLoadShowForColumn" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
$("#LableEATTRIBUTE2").text(data.rows[0].Name);
|
|
$("#LableEATTRIBUTE3").text(data.rows[1].Name);
|
|
$("#LableEATTRIBUTE4").text(data.rows[2].Name);
|
|
$("#LableEATTRIBUTE5").text(data.rows[3].Name);
|
|
$("#LableEATTRIBUTE6").text(data.rows[4].Name);
|
|
$("#LableEATTRIBUTE7").text(data.rows[5].Name);
|
|
$("#LableEATTRIBUTE8").text(data.rows[6].Name);
|
|
$("#LableEATTRIBUTE9").text(data.rows[7].Name);
|
|
$("#LableEATTRIBUTE10").text(data.rows[8].Name);
|
|
// $("#LableEATTRIBUTE10").text(data.rows[9].Name);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//本次生成数量改变事件
|
|
function thisCreate_Change() {
|
|
//本+辅
|
|
if (thisCreateQtyEnable == true && AmountEnable == true) {
|
|
thisCreateAndAmount();
|
|
}
|
|
//本+张数
|
|
else if (thisCreateQtyEnable == true && cretePageCountEnable == true)
|
|
{
|
|
thisCreateAndcretePageCount();
|
|
}
|
|
//本+最小
|
|
else
|
|
{
|
|
thisCreateAndminPack();
|
|
}
|
|
|
|
}
|
|
|
|
//最小包装量改变事件
|
|
function minPack_Change() {
|
|
//最小+张数
|
|
if (minPackQtyEnable == true && cretePageCountEnable == true) {
|
|
minPackAndcretePageCount();
|
|
}
|
|
//最小+本
|
|
else {
|
|
thisCreateAndminPack();
|
|
}
|
|
|
|
}
|
|
|
|
//辅计量数量改变事件
|
|
function Amount_Change() {
|
|
//辅+张数
|
|
if (AmountEnable == true && cretePageCountEnable == true) {
|
|
AmountAndcretePageCount();
|
|
}
|
|
//辅+本
|
|
else
|
|
{
|
|
thisCreateAndAmount();
|
|
}
|
|
}
|
|
|
|
//生成张数改变事件
|
|
function cretePageCount_Change() {
|
|
//张数+本
|
|
if (thisCreateQtyEnable == true && cretePageCountEnable == true) {
|
|
thisCreateAndcretePageCount();
|
|
}
|
|
//张数+最小
|
|
else if (minPackQtyEnable == true && cretePageCountEnable == true)
|
|
{
|
|
minPackAndcretePageCount();
|
|
}
|
|
//张数+辅
|
|
else
|
|
{
|
|
AmountAndcretePageCount();
|
|
}
|
|
}
|
|
//辅+张数
|
|
function AmountAndcretePageCount() {
|
|
|
|
var Amount = $("#Amount").val() * 1;//辅计量数量
|
|
Amount = Amount.toFixed(6);
|
|
var cretePageCount = $("#cretePageCount").val() * 1;//张数
|
|
cretePageCount = cretePageCount.toFixed(6);
|
|
if (Amount <= 0) {
|
|
$.modalAlertNew("WMS00102");
|
|
return false;
|
|
}
|
|
if (cretePageCount <= 0) {
|
|
$.modalAlertNew("WMS00102");
|
|
return false;
|
|
}
|
|
var minPackQty = Amount ;
|
|
var thisCreateQty = minPackQty * cretePageCount;
|
|
$("#thisCreateQty").val(thisCreateQty);
|
|
$("#minPackQty").val(minPackQty);
|
|
|
|
}
|
|
|
|
//最小+张数
|
|
function minPackAndcretePageCount() {
|
|
|
|
var minPackQty = $("#minPackQty").val() * 1;//最小包装量
|
|
minPackQty = minPackQty.toFixed(6);
|
|
var cretePageCount = $("#cretePageCount").val() * 1;//张数
|
|
cretePageCount = cretePageCount.toFixed(6);
|
|
if (cretePageCount <= 0) {
|
|
$.modalAlertNew("WMS00102");
|
|
return false;
|
|
}
|
|
if (minPackQty <= 0) {
|
|
$.modalAlertNew("WMS00102");
|
|
return false;
|
|
}
|
|
var thisCreateQty = minPackQty * cretePageCount;
|
|
$("#thisCreateQty").val(thisCreateQty);
|
|
var Ratio = minPackQty;
|
|
|
|
$("#Amount").val(Ratio);//自动计算出的条码辅计量数量
|
|
}
|
|
|
|
//本+辅
|
|
function thisCreateAndAmount() {
|
|
var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
|
|
thisCreateQty = thisCreateQty.toFixed(6);
|
|
var Amount = $("#Amount").val() * 1;//辅计量数量
|
|
Amount = Amount.toFixed(6);
|
|
if (Amount <= 0) {
|
|
$.modalAlertNew("WMS00102");
|
|
return false;
|
|
}
|
|
var minPackQty = Amount;
|
|
if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
|
|
createPageCount = parseInt(thisCreateQty / minPackQty) + 1;
|
|
$("#cretePageCount").val(createPageCount);
|
|
}
|
|
else {
|
|
createPageCount = parseInt(thisCreateQty / minPackQty);
|
|
$("#cretePageCount").val(createPageCount);
|
|
}
|
|
$("#minPackQty").val(minPackQty);
|
|
}
|
|
|
|
//本+张数
|
|
function thisCreateAndcretePageCount() {
|
|
var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
|
|
thisCreateQty = thisCreateQty.toFixed(6);
|
|
var cretePageCount = $("#cretePageCount").val() * 1;//张数
|
|
cretePageCount = cretePageCount.toFixed(6);
|
|
if (cretePageCount <= 0) {
|
|
$.modalAlertNew("WMS00102");
|
|
return false;
|
|
}
|
|
var minPackQty = thisCreateQty / cretePageCount;//最小包装量
|
|
minPackQty = minPackQty.toFixed(6);
|
|
$("#minPackQty").val(minPackQty);
|
|
var Ratio = minPackQty;
|
|
|
|
$("#Amount").val(Ratio);//自动计算出的条码辅计量数量
|
|
|
|
}
|
|
|
|
//本+最小
|
|
function thisCreateAndminPack() {
|
|
var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
|
|
thisCreateQty = thisCreateQty.toFixed(6);
|
|
var minPackQty = $("#minPackQty").val() * 1;//最小包装量
|
|
minPackQty = minPackQty.toFixed(6);
|
|
if (parseInt(Math.ceil(thisCreateQty * 10000)) % parseInt(Math.ceil(minPackQty * 10000)) != 0) {
|
|
// createPageCount = parseInt(thisCreateQty / minPackQty) + 1;
|
|
createPageCount = Math.floor(thisCreateQty / minPackQty) + 1;
|
|
$("#cretePageCount").val(createPageCount);
|
|
}
|
|
else {
|
|
createPageCount = parseInt(thisCreateQty / minPackQty);
|
|
$("#cretePageCount").val(createPageCount);
|
|
}
|
|
|
|
var Ratio = minPackQty;
|
|
|
|
$("#Amount").val(Ratio);//自动计算出的条码辅计量数量
|
|
}
|
|
//提交
|
|
function submitForm() {
|
|
|
|
if (!$('#form1').formValid()) {
|
|
return false;
|
|
}
|
|
|
|
//if ($("#LocationCode").val() == "") {
|
|
// $.modalAlert("盘点生成条码必须选择入库库位!", "warning");
|
|
// return;
|
|
//}
|
|
//if ($("#trBatchCode").css('display') != 'none' && $("#BatchCode").val() == "") {
|
|
// $.modalAlert("盘点生成条码必须填写批号!", "warning");
|
|
// return;
|
|
//}
|
|
//if ($("#trEATTRIBUTE3").css('display') != 'none' && $("#EATTRIBUTE3").val() == "") {
|
|
// $.modalAlert("盘点生成条码必须填写供应商名称!", "warning");
|
|
// return;
|
|
//}
|
|
|
|
//if ($("#trEATTRIBUTE5").css('display') != 'none' && $("#EATTRIBUTE5").val() == "") {
|
|
// $.modalAlert("盘点生成条码必须填写客户名称!", "warning");
|
|
// return;
|
|
//}
|
|
|
|
//if ($("#trEATTRIBUTE6").css('display') != 'none' && $("#EATTRIBUTE6").val() == "") {
|
|
// $.modalAlert("盘点生成条码必须填写业务员!", "warning");
|
|
// return;
|
|
//}
|
|
|
|
var thisCreateQty = $("#thisCreateQty").val() * 1;//本次生成数量
|
|
thisCreateQty = thisCreateQty.toFixed(6);
|
|
var minPackQty = $("#minPackQty").val() * 1;//最小包装量
|
|
minPackQty = minPackQty.toFixed(6);
|
|
var createPageCount = $("#cretePageCount").val() * 1;//本次生成张数
|
|
createPageCount = createPageCount.toFixed(0);
|
|
|
|
var VendorLot = $("#VendorLotNo").val();
|
|
//if (flag1) { }
|
|
//else {
|
|
// return false;
|
|
//}
|
|
|
|
var ExpirationDate = '';//条码失效日期
|
|
var EffectiveEnable = $("#EffectiveEnable").val();//料品是否启用有效天数
|
|
var EffectiveDays = $("#EffectiveDays").val();//料品有效期天数
|
|
var PRODUCTDATE = $("#PRODUCTDATE").val();//条码生产日期
|
|
if (EffectiveEnable=='true') {
|
|
var ExpirationDate= dateChange(EffectiveDays, PRODUCTDATE);
|
|
} else {
|
|
var ExpirationDate = '2999-12-31 00:00:00.000';
|
|
}
|
|
|
|
var InvCode= $("#InvCode").val();
|
|
var ClassCode = $("#ClassCode").val();
|
|
var Complete = '';
|
|
$.ajax({
|
|
url: "/PNWMS/WMSCreateItemLot/GetInvBatchEnable?InvCode=" + InvCode,
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
if (data != null && data.length > 0) {
|
|
Complete = data[0].BatchEnable;
|
|
}
|
|
}
|
|
});
|
|
|
|
if (Complete == true) {
|
|
if ($("#BatchCode").val()=="") {
|
|
$.modalAlert("该料品已开启批次,请输入批次!", "warning");
|
|
return;
|
|
}
|
|
}
|
|
var createPackCount = 0;
|
|
if (IsContainerEnable == true)//是否自动生成箱号 ContainerEnable=true
|
|
{
|
|
if ($("#creatPackCount").val() == "") {
|
|
$.modalAlert("该料品已开启自动生成箱号功能,请输入生成箱数!", "warning");
|
|
return;
|
|
}
|
|
var createPackCount = $("#creatPackCount").val() * 1;//本次生成箱数
|
|
createPackCount = createPackCount.toFixed(0);
|
|
if (parseInt(createPackCount) > parseInt(createPageCount)) {
|
|
$.modalAlert("该料品生成箱数:" + createPackCount + "不能大于生成张数:" + createPageCount + "!", "warning");
|
|
return;
|
|
}
|
|
if (createPackCount <= 0)
|
|
{
|
|
$.modalAlert("该料品生成箱数:" + createPackCount + "必须大于0!", "warning");
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
var obj = {
|
|
thisCreateQty: thisCreateQty,
|
|
minPackQty: minPackQty,
|
|
createPageCount: createPageCount,
|
|
VendorLot: VendorLot,
|
|
PRODUCTDATE: PRODUCTDATE,
|
|
ExpirationDate: ExpirationDate,
|
|
WHCode: $("#WHCode").val(),
|
|
LocationCode: $("#LocationCode").val(),
|
|
Amount: $("#Amount").val(),
|
|
//自由项
|
|
ProjectCode: $("#ProjectCode").val(),
|
|
BatchCode: $("#BatchCode").val().replace(/\s+/g, ''),
|
|
Version: $("#Version").val(),
|
|
Brand: $("#Brand").val(),
|
|
cFree1: $("#cFree1").val(),
|
|
cFree2: $("#cFree2").val(),
|
|
cFree3: $("#cFree3").val(),
|
|
cFree4: $("#cFree4").val(),
|
|
cFree5: $("#cFree5").val(),
|
|
cFree6: $("#cFree6").val(),
|
|
cFree7: $("#cFree7").val(),
|
|
cFree8: $("#cFree8").val(),
|
|
cFree9: $("#cFree9").val(),
|
|
cFree10: $("#cFree10").val(),
|
|
//单据自定义项
|
|
EATTRIBUTE1: '',
|
|
EATTRIBUTE2: $("#EATTRIBUTE2").val(),
|
|
EATTRIBUTE3: $("#EATTRIBUTE3").val(),
|
|
EATTRIBUTE4: $("#EATTRIBUTE4").val(),
|
|
EATTRIBUTE5: $("#EATTRIBUTE5").val(),
|
|
EATTRIBUTE6: $("#EATTRIBUTE6").val(),
|
|
EATTRIBUTE7: $("#EATTRIBUTE7").val(),
|
|
EATTRIBUTE8: $("#EATTRIBUTE8").val(),
|
|
EATTRIBUTE9: $("#EATTRIBUTE9").val(),
|
|
EATTRIBUTE10: $("#EATTRIBUTE10").val(),
|
|
InvCode: InvCode,
|
|
ClassCode: ClassCode,
|
|
createPackCount: createPackCount,
|
|
VenCode:VenCode,
|
|
}
|
|
$.submitForm({
|
|
url: "/PNWMS/Blitem/CreateLotNoForPD?CheckCode=" + CheckCode + "&WorkPoint=" + WorkPoints,
|
|
param: {
|
|
keyValue: JSON.stringify(obj)
|
|
},
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
|
|
function dateChange(num ,date ) {
|
|
if (!date) {
|
|
date = new Date();//没有传入值时,默认是当前日期
|
|
date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
|
|
}
|
|
date += " 00:00:00";//设置为当天凌晨12点
|
|
date = Date.parse(new Date(date))/1000;//转换为时间戳
|
|
date += (86400) * num;//修改后的时间戳
|
|
var newDate = new Date(parseInt(date) * 1000);//转换为时间
|
|
return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
|
|
}
|
|
|
|
function SearchINV() {
|
|
$.modalOpen({
|
|
id: "selectDeatil",
|
|
title: "查看物料",
|
|
url: "/PNWMS/Blitem/SeachInventory?&" + Math.random(),
|
|
width: "1000px",
|
|
height: "1000px",
|
|
callBack: function (iframeId) {
|
|
var objArr = top.frames[iframeId].submitForm();
|
|
$("#INVUOM").val(objArr[0].InvUnit);
|
|
$("#InvCode").val(objArr[0].InvCode);
|
|
$("#INVNAME").val(objArr[0].InvName);
|
|
$("#INVSTD").val(objArr[0].InvStd);
|
|
$("#EffectiveEnable").val(objArr[0].EffectiveEnable);
|
|
$("#EffectiveDays").val(objArr[0].EffectiveDays);
|
|
top.frames[iframeId].Close();
|
|
}
|
|
});
|
|
}
|
|
|
|
function SearchLocation() {
|
|
var WHCode = $("#WHCode").val();
|
|
$.modalOpen({
|
|
id: "selectDeatil",
|
|
title: "查看库位",
|
|
url: "/PNWMS/Blitem/SeachLocation?WHCode=" + WHCode + "&" + Math.random(),
|
|
width: "1000px",
|
|
height: "1000px",
|
|
callBack: function (iframeId) {
|
|
var objArr = top.frames[iframeId].submitForm();
|
|
$("#LocationCode").val(objArr[0].LocationCode);
|
|
top.frames[iframeId].Close();
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<form id="form1">
|
|
<div style="padding-top: 20px; margin-right: 20px;">
|
|
<table class="form">
|
|
<tr>
|
|
<th class="formTitle">料品编码</th>
|
|
<td class="formValue">
|
|
<input id="InvCode" name="InvCode" type="text" class="form-control " placeholder="点击查询物料编码" onclick="SearchINV()" />
|
|
<input id="Enable" name="Enable" type="text" style="display:none" />
|
|
<input id="ClassCode" name="ClassCode" type="text" style="display:none" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">料品名称</th>
|
|
<td class="formValue">
|
|
<input id="INVNAME" name="INVNAME" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">规格型号</th>
|
|
<td class="formValue">
|
|
<input id="INVSTD" name="INVSTD" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle">计量单位</th>
|
|
<td class="formValue">
|
|
<input id="INVUOM" name="INVUOM" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>入库仓库</th>
|
|
<td class="formValue">
|
|
<input id="WHCode" name="WHCode" type="text" class="form-control required" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>入库库位</th>
|
|
<td class="formValue">
|
|
<input id="LocationCode" name="LocationCode" type="text" class="form-control required" placeholder="点击查询库位编码" onclick="SearchLocation()" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>本次生成数量</th>
|
|
<td class="formValue">
|
|
<input id="thisCreateQty" name="thisCreateQty" type="text" class="form-control required" placeholder="请输入本次生成数量" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>最小包装量</th>
|
|
<td class="formValue">
|
|
<input id="minPackQty" name="minPackQty" type="text" class="form-control required" placeholder="请输入最小包装量" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>生产日期</th>
|
|
<td class="formValue">
|
|
<input type="text" name="PRODUCTDATE" id="PRODUCTDATE" class="form-control required" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="生产日期" />
|
|
<input id="EffectiveEnable" name="EffectiveEnable" type="text" style="display:none" />
|
|
<input id="EffectiveDays" name="EffectiveDays" type="text" style="display:none" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle"><span style="color: red;">*</span>生成张数</th>
|
|
<td class="formValue">
|
|
<input id="cretePageCount" name="cretePageCount" class="form-control required" type="text" placeholder="请输入生成张数" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th class="formTitle HideTxt"><span style="color: red;">*</span>生成箱数</th>
|
|
<td class="formValue HideTxt">
|
|
<input id="creatPackCount" name="creatPackCount" class="form-control HideTxt" type="text" placeholder="请输入生成箱数" />
|
|
</td>
|
|
</tr>
|
|
<tr style="display:none">
|
|
<th class="formTitle">辅计量数量</th>
|
|
<td class="formValue">
|
|
<input id="Amount" name="Amount" class="form-control" type="text" placeholder="请输入辅计量数量" />
|
|
</td>
|
|
</tr>
|
|
@*自由项*@
|
|
<tr id="trProjectCode">
|
|
<th class="formTitle"><label id="LableProjectCode"></label></th>
|
|
<td class="formValue">
|
|
<input id="ProjectCode" name="ProjectCode" class="form-control " type="text" />
|
|
</td>
|
|
</tr>
|
|
<tr id="trBatchCode">
|
|
<th class="formTitle"><span style="color: red;">*</span><label id="LableBatchCode"></label></th>
|
|
<td class="formValue">
|
|
<input id="BatchCode" name="BatchCode" class="form-control required" type="text" />
|
|
</td>
|
|
</tr>
|
|
<tr id="trVersion">
|
|
<th class="formTitle"><label id="LableVersion"></label></th>
|
|
<td class="formValue">
|
|
<input id="Version" name="Version" class="form-control " type="text" />
|
|
</td>
|
|
</tr>
|
|
<tr id="trBrand">
|
|
<th class="formTitle"><label id="LableBrand"></label></th>
|
|
<td class="formValue">
|
|
<input id="Brand" name="Brand" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree1">
|
|
<th class="formTitle"><label id="LablecFree1"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree1" name="cFree1" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree2">
|
|
<th class="formTitle"><label id="LablecFree2"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree2" name="cFree2" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree3">
|
|
<th class="formTitle"><label id="LablecFree3"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree3" name="cFree3" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree4">
|
|
<th class="formTitle"><label id="LablecFree4"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree4" name="cFree4" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree5">
|
|
<th class="formTitle"><label id="LablecFree5"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree5" name="cFree5" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree6">
|
|
<th class="formTitle"><label id="LablecFree6"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree6" name="cFree6" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree7">
|
|
<th class="formTitle"><label id="LablecFree7"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree7" name="cFree7" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree8">
|
|
<th class="formTitle"><label id="LablecFree8"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree8" name="cFree8" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree9">
|
|
<th class="formTitle"><label id="LablecFree9"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree9" name="cFree9" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trcFree10">
|
|
<th class="formTitle"><label id="LablecFree10"></label></th>
|
|
<td class="formValue">
|
|
<input id="cFree10" name="cFree10" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
|
|
@*单据自由项*@
|
|
|
|
@*<tr id="trEATTRIBUTE1">
|
|
<th class="formTitle"><label id="LableEATTRIBUTE1"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE1" name="EATTRIBUTE1" type="text" class="form-control " />
|
|
</td>
|
|
</tr>*@
|
|
<tr id="trEATTRIBUTE2">
|
|
<th class="formTitle"><label id="LableEATTRIBUTE2"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE2" name="EATTRIBUTE2" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trEATTRIBUTE3">
|
|
<th class="formTitle"><span style="color: red;">*</span><label id="LableEATTRIBUTE3"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE3" name="EATTRIBUTE3" type="text" class="form-control required" />
|
|
</td>
|
|
</tr>
|
|
<tr id="trEATTRIBUTE4">
|
|
<th class="formTitle"><label id="LableEATTRIBUTE4"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE4" name="EATTRIBUTE4" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trEATTRIBUTE5">
|
|
<th class="formTitle"><span style="color: red;">*</span><label id="LableEATTRIBUTE5"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE5" name="EATTRIBUTE5" type="text" class="form-control required" />
|
|
</td>
|
|
</tr>
|
|
<tr id="trEATTRIBUTE6">
|
|
<th class="formTitle"><span style="color: red;">*</span><label id="LableEATTRIBUTE6"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE6" name="EATTRIBUTE6" type="text" class="form-control required" />
|
|
</td>
|
|
</tr>
|
|
<tr id="trEATTRIBUTE7">
|
|
<th class="formTitle"><label id="LableEATTRIBUTE7"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE7" name="EATTRIBUTE7" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trEATTRIBUTE8">
|
|
<th class="formTitle"><label id="LableEATTRIBUTE8"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE8" name="EATTRIBUTE8" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trEATTRIBUTE9">
|
|
<th class="formTitle"><label id="LableEATTRIBUTE9"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE9" name="EATTRIBUTE9" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
<tr id="trEATTRIBUTE10">
|
|
<th class="formTitle"><label id="LableEATTRIBUTE10"></label></th>
|
|
<td class="formValue">
|
|
<input id="EATTRIBUTE10" name="EATTRIBUTE10" type="text" class="form-control " />
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
|
</form>
|