|
/**
|
*
|
*入库管理功能
|
*
|
**/
|
var ErpInManager = {
|
InTable: undefined,
|
DataInteractWay: function (URL, data, callback) {
|
$.gitAjax({
|
url: URL,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
callback(result);
|
}
|
});
|
},
|
Server: function () {
|
var config = (function () {
|
var URL_Add = "/Business/ErpInAjax/Add";
|
|
var URL_LoadDetail = "/Business/ErpInAjax/LoadDetail";
|
var URL_AddProduct = "/Business/ErpInAjax/AddMat";
|
|
var URL_DelProduct = "/Business/ErpInAjax/DelProduct";
|
|
var URL_GetDetail = "/Business/ErpInAjax/GetDetail";
|
var URL_Delete = "/Business/ErpInAjax/Delete";
|
var URL_Close = "/Business/ErpInAjax/Close";
|
var URL_ToExcel = "/Business/ErpInAjax/ToExcel";
|
|
var URL_Init = "/Business/ErpInAjax/Init";
|
var URL_CheckOrdStatus = "/Business/ErpInAjax/CheckOrdStatus";
|
var URL_AddIPalletBind = "/Business/ErpInAjax/AddIPalletBind";
|
var URL_CheckPalletNo = "/Business/IPalletBindAjax/CheckPalletNo";
|
|
return {
|
URL_GetDetail: URL_GetDetail,
|
URL_LoadDetail: URL_LoadDetail,
|
URL_AddProduct: URL_AddProduct,
|
URL_DelProduct: URL_DelProduct,
|
|
URL_Add: URL_Add,
|
|
URL_Delete: URL_Delete,
|
URL_Close: URL_Close,
|
URL_ToExcel: URL_ToExcel,
|
|
URL_Init: URL_Init,
|
URL_CheckOrdStatus: URL_CheckOrdStatus,
|
URL_AddIPalletBind: URL_AddIPalletBind,
|
URL_CheckPalletNo: URL_CheckPalletNo,
|
};
|
})();
|
|
//数据操作服务
|
var dataServer = (function ($, config) {
|
|
//查询分页列表
|
|
var LoadDetail = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_LoadDetail,
|
data: { ajaxdata: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var AddProduct = function (data, callback) {
|
// debugger
|
$.gitAjax({
|
url: config.URL_AddProduct,
|
data: { ajaxdata: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var DelProduct = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_DelProduct,
|
data: { ajaxdata: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var GetDetails = function (data, callback) {
|
$.gitAjax({
|
url: "/Business/ErpInAjax/GetDetails",
|
data: { ajaxdata: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var Delete = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_Delete,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var Close = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_Close,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var Init = function (callback) {
|
$.gitAjax({
|
url: config.URL_Init,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var CheckOrdStatus = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_CheckOrdStatus,
|
data: { ajaxdata: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var ToExcel = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_ToExcel,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var AddIPalletBind = function (data, callback) {
|
$.gitAjax({
|
async: false, // 顺序执行
|
url: config.URL_AddIPalletBind,
|
data: { ajaxdata: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
var CheckPalletNo = function (data, callback) {
|
$.gitAjax({
|
async: false, // 顺序执行
|
url: config.URL_CheckPalletNo,
|
data: { ajaxdata: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
|
return {
|
LoadDetail: LoadDetail,
|
AddProduct: AddProduct,
|
DelProduct: DelProduct,
|
Delete: Delete,
|
Close: Close,
|
GetDetails: GetDetails,
|
ToExcel: ToExcel,
|
Init: Init,
|
CheckOrdStatus: CheckOrdStatus,
|
AddIPalletBind: AddIPalletBind,
|
CheckPalletNo: CheckPalletNo,
|
}
|
|
})($, config);
|
return dataServer;
|
},
|
PageClick: function (PageIndex, PageSize) {
|
$.jBox.tip("正在努力加载数据...", "loading");
|
var search = ErpInManager.GetSearch();
|
search["PageIndex"] = PageIndex;
|
search["PageSize"] = PageSize;
|
|
ErpInManager.DataInteractWay("/Business/ErpInAjax/GetErpInList",
|
{ ajaxdata: JSON.stringify(search) }, function (result) {
|
$.jBox.closeTip();
|
if (result != null) {
|
if (result.Code == 1) {
|
// 查询成功,绑定Table
|
ErpInManager.SetTable(result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
}
|
});
|
},
|
SetTable: function (result) {
|
var cols = [
|
{
|
title: '操作', name: 'guid', width: 150, align: 'left', lockWidth: false, renderer: function (data, item, rowIndex) {
|
var html = "";
|
if (item.Statu == "等待执行") {
|
html += '<a class="view" href="javascript:void(0)">查看</a> ';
|
html += '<a class="edit dis" href="javascript:void(0)">编辑</a> ';
|
html += '<a class="send dis" href="javascript:void(0)">组盘</a> '; // 一键组盘功能
|
html += '<a class="delete dis" href="javascript:void(0)">删除</a> ';
|
html += '<a class="print" href="javascript:void(0)">打印</a> ';
|
}
|
else {
|
html += '<a class="view" href="javascript:void(0)">查看</a> ';
|
html += '<a class="print" href="javascript:void(0)">打印</a> ';
|
}
|
|
return html;
|
}
|
},
|
{
|
title: '订单号', name: 'OrdNo', width: 125, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
//{
|
// title: '批次号', name: 'BatchNo', width: 125, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
// return data;
|
// }
|
//},
|
//{
|
// title: '批次描述', name: 'BatchDemo', width: 135, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
// return data;
|
// }
|
//},
|
{
|
title: '订单状态', name: 'Statu', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '完成时间', name: 'CompletionTime', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return git.JsonToDateTimeto(data);
|
//return data;
|
}
|
},
|
{
|
title: '创建人', name: 'CreateUser', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '创建时间', name: 'CreateTime', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return git.JsonToDateTimeto(data);
|
//return data;
|
}
|
},
|
{
|
title: '修改人', name: 'UpdateUser', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '修改时间', name: 'UpdateTime', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return git.JsonToDateTimeto(data)
|
//return data;
|
}
|
},
|
{
|
title: '备注', name: 'Demo', width: 240, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
|
];
|
|
if (this.InTable == undefined) {
|
|
var ht = masterUI.MMGridHeight();
|
this.InTable = $("#tabList").mmGrid({
|
cols: cols,
|
items: result.Result.List,
|
checkCol: true,
|
nowrap: true,
|
multiSelect: false,//设置是否可以多选
|
height: ht
|
});
|
//绑定编辑 删除事件
|
ErpInManager.BindEvent();
|
} else {
|
this.InTable.load(result.Result.List);
|
}
|
|
var pageInfo = result.PageInfo;
|
if (pageInfo != undefined) {
|
$("#mypager").pager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: ErpInManager.PageClick });
|
}
|
},
|
BindEvent: function () {
|
|
this.InTable.on('loadSuccess', function (e, data) {
|
LoadBtn.SetBtn();
|
});
|
this.InTable.off("cellSelected").on("cellSelected", function (e, item, rowIndex, colIndex) {
|
if ($(e.target).is("a.edit")) {
|
if (item.Statu == "等待执行") {
|
|
ErpInDetail.AddProduct(item.OrdNo, item.LingNo, item.Statu, item.Demo);
|
}
|
}
|
else if ($(e.target).is("a.view")) {
|
var SN = item.OrdNo;
|
ErpInManager.Detail(SN, "View");
|
}
|
else if ($(e.target).is("a.delete")) {
|
if (item.Statu == "等待执行") {
|
var SN = item.OrdNo;
|
var submit = function (v, h, f) {
|
if (v == "ok") {
|
var list = [];
|
list.push(SN);
|
var param = {};
|
param["list"] = JSON.stringify(list);
|
|
ErpInManager.DataInteractWay("/Business/ErpInAjax/Delete",
|
param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
ErpInManager.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "success");
|
}
|
});
|
}
|
}
|
$.jBox.confirm("该操作将删除该订单数据,确定要删除吗?", "提示", submit);
|
}
|
}
|
else if ($(e.target).is("a.print")) {
|
var SN = item.OrdNo;
|
window.location.href = "/Business/ErpIn/ReportShow?ReportNo=航天入库单&OrdNo=" + SN;
|
}
|
else if ($(e.target).is("a.send")) // 一键组盘
|
{
|
ErpInManager.Detail(item.OrdNo, "Send");
|
ErpInManager.PageClick(1, 15);
|
}
|
});
|
},
|
GetSelect: function () {
|
var list = [];
|
if (this.InTable != undefined) {
|
var rows = this.InTable.selectedRows();
|
if (rows != undefined && rows.length > 0) {
|
for (var i = 0; i < rows.length; i++) {
|
list.push(rows[i].OrdNo);
|
}
|
}
|
}
|
return list;
|
},
|
GetRows: function () {
|
var list = [];
|
if (this.InTable != undefined) {
|
var rows = this.InTable.selectedRows();
|
if (rows != undefined && rows.length > 0) {
|
for (var i = 0; i < rows.length; i++) {
|
list.push(rows[i]);
|
}
|
}
|
}
|
return list;
|
},
|
GetSearch: function () {
|
var search = {};
|
var searchBar = $("div[data-condition='search']");
|
search["OrdNo"] = searchBar.find("input[name='OrdNo']").val();
|
search["Statu"] = searchBar.find("select[name='Statu']").val();
|
search["BatchNo"] = searchBar.find("input[name='BatchNo']").val();
|
search["BatchDemo"] = searchBar.find("input[name='BatchDemo']").val();
|
/* search["DepartGuid"] = searchBar.find("select[name='DepartGuid']").val();*/
|
|
search["MatNo"] = searchBar.find("input[name='MatNo']").val();
|
search["MatName"] = searchBar.find("input[name='MatName']").val();
|
search["LingNo"] = searchBar.find("input[name='LingNo']").val();
|
search["TuNo"] = searchBar.find("input[name='TuNo']").val();
|
|
search["BeginTime"] = searchBar.find("input[name='BeginTime']").val();
|
search["EndTime"] = searchBar.find("input[name='EndTime']").val();
|
|
return search;
|
},
|
Detail: function (OrdNo, Commad) {
|
var TabGrid = undefined;
|
|
var submit = function (v, h, f) {
|
if (v == "1") {
|
var submitt = function (m, n, t) {
|
if (m) {
|
var list = [];
|
list.push(OrdNo);
|
var param = {};
|
param["list"] = JSON.stringify(list);
|
param["Operation"] = "AD02"; //审核不通过
|
var Server = ErpInManager.Server();
|
Server.Audite(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
ErpInManager.PageClick(1, pageSize);
|
$.jBox.close();
|
} else {
|
$.jBox.tip(result.Message, "info");
|
}
|
});
|
}
|
|
}
|
var html = "<div style='padding: 20px; text-align: center'>您确定通过该订单审核吗?</div> ";
|
$.jBox(html, { title: "提示信息", buttons: { "确定": true, "取消": false }, submit: submitt });
|
} else if (v == "2") {
|
var submitt = function (m, n, t) {
|
if (m) {
|
var list = [];
|
list.push(OrdNo);
|
var param = {};
|
param["list"] = JSON.stringify(list);
|
param["Operation"] = "AD03"; //审核不通过
|
|
var Server = ErpInManager.Server();
|
Server.Audite(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
ErpInManager.PageClick(1, pageSize);
|
$.jBox.close();
|
} else {
|
$.jBox.tip(result.Message, "success");
|
}
|
});
|
}
|
|
}
|
var html = "<div style='padding: 20px; text-align: center'>您确定不通过该订单审核吗?</div> ";
|
$.jBox(html, { title: "提示信息", buttons: { "确定": true, "取消": false }, submit: submitt });
|
} else if (v == "3") {
|
//打印
|
} else if (v == "4") {
|
$.jBox.close();
|
}
|
return false;
|
}
|
|
var SetTable = function (h, result) {
|
|
var cols = [
|
{
|
title: '生产令号', name: 'LingNo', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '图号', name: 'TuNo', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '序号', name: 'PageNo', width: 60, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '物料编码', name: 'MatNo', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '物料名称', name: 'MatName', width: 160, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '单数', name: 'PlanQuant', width: 55, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '总数', name: 'CurQuant', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '合格证', name: 'Certificate', width: 60, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '类型', name: 'MatType', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '批次号', name: 'BatchNo', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '批次描述', name: 'BatchDemo', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '备注', name: 'DetailDemo', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
];
|
|
if (TabGrid == undefined) {
|
TabGrid = h.find('#tabDetail').mmGrid({
|
cols: cols,
|
items: result.Result.List,
|
checkCol: false,
|
indexCol: true,
|
nowrap: true,
|
height: 340
|
});
|
ErpInManager.position(h, TabGrid);
|
} else {
|
TabGrid.load(result.Result.List);
|
}
|
|
var pageInfo = result.PageInfo;
|
if (pageInfo != undefined) {
|
$("#myDetailPager").pager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: function (PageIdex, PageSize) { PageClick(h, PageIdex, PageSize); } });
|
}
|
}
|
|
var load = function (h) {
|
PageClick(h, 1, 50);
|
}
|
|
var PageClick = function (h, PageIndex, PageSize) {
|
var search = {};
|
search["OrdNo"] = OrdNo;
|
if (PageIndex == undefined) {
|
PageIndex = h.find('#myDetailPager').pager("GetCurrent");
|
search["PageIndex"] = pageIndex;
|
}
|
else {
|
search["PageIndex"] = PageIndex;
|
}
|
|
if (PageSize == undefined) {
|
PageSize = h.find('#myDetailPager').pager("GetCurrent");
|
search["PageSize"] = PageSize;
|
}
|
else {
|
search["PageSize"] = PageSize;
|
}
|
|
ErpInManager.DataInteractWay("/Business/ErpInAjax/GetDetails",
|
{ ajaxdata: JSON.stringify(search) },
|
function (result) {
|
if (result.Code == 1) {
|
SetTable(h, result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
|
switch (Commad) {
|
case "View":
|
$.jBox.open("get:/Business/ErpIn/Detail?OrdNo=" + OrdNo, "入库单详细", 850, 560,
|
{ buttons: { "关闭": 4 }, top: '6%', submit: submit, loaded: function (h) { load(h); } });
|
; break;
|
case "Send":
|
var html = "<div style='padding:10px;'>输入托盘号:<input type='text' id='yourname' name='yourname' /></div>";
|
var submit = function (v, h, f) {
|
if (f.yourname == '') {
|
//$.jBox.tip("请输入托盘号。","error");
|
$.jBox.tip("请输入托盘号。", "error"); // 关闭设置 yourname 为焦点
|
h.find("input[name='yourname']").focus();
|
return false;
|
} else {
|
var param1 = {};
|
param1["PalletNo"] = f.yourname;
|
// 验证托盘号长度
|
if (!git.checkStrLength(f.yourname)) {
|
$.jBox.tip("托盘码长度异常,请将输入法切换为英文,重新扫码!", "warn");
|
return false;
|
}
|
|
// 验证托盘号是否合法
|
var bl = true;
|
ErpInManager.Server().CheckPalletNo(param1, function (result) {
|
if (result.Code != 1) {
|
bl = false;
|
$.jBox.tip(result.Message, "warn");
|
h.find("#yourname").val("");
|
h.find("input[name='yourname']").focus();
|
}
|
});
|
|
if (bl) {
|
var param = {};
|
param["OrdNo"] = OrdNo;
|
param["PalletNo"] = f.yourname;
|
|
var Server = ErpInManager.Server();
|
Server.AddIPalletBind(param, function (result) {
|
$.jBox.tip(result.Message, "success");
|
});
|
ErpInManager.PageClick(1, 50);
|
return true;
|
}
|
|
return false;
|
}
|
};
|
|
$.jBox(html, { title: "便捷组盘", submit: submit });
|
|
; break;
|
default: break;
|
}
|
},
|
position: function (h, TabGrid) {
|
TabGrid.off("cellSelected").on("cellSelected", function (e, item, rowIndex, colIndex) {
|
if ($(e.target).is("a.position")) {
|
var load = function (h) {
|
|
$.gitAjax({
|
url: "/Business/ErpInAjax/Getposition",
|
data: { OrdNo: $("#OrdNo").html(), MatNo: item.MatNo },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
positionTable(h, result);
|
|
}
|
});
|
}
|
|
var submit = function () { }
|
var positionTable = function (h, result) {
|
|
var Grid = undefined;
|
var cols = [
|
|
{
|
title: '托盘号', name: 'PalletNo', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '货位号', name: 'addreNo', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '数量', name: 'MatCount', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
}
|
|
];
|
|
if (Grid == undefined) {
|
Grid = h.find('#tabposition').mmGrid({
|
cols: cols,
|
items: result.Result.List,
|
checkCol: false,
|
nowrap: true,
|
height: 190
|
});
|
|
} else {
|
Grid.load(result.Result.List);
|
}
|
}
|
|
$.jBox.open("get:/Business/ErpIn/Position", "物料详情", 400, 280, { buttons: { "关闭": false, }, submit: submit, loaded: function (h) { load(h); } });
|
|
}
|
});
|
},
|
ToolBar: function () {
|
//工具栏按钮点击事件
|
$("div.toolbar").find("a.btn").click(function () {
|
var command = $(this).attr("data-command");
|
switch (command) {
|
case "Add":
|
ErpInDetail.AddProduct();
|
break;
|
case "Edit":
|
var list = ErpInManager.GetRows();
|
if (list.length == 0) {
|
$.jBox.tip("请选择要编辑的项", "warn");
|
return false;
|
}
|
|
var item = list[0];
|
if (item.Statu == "等待执行" || item.Statu == "正在执行") {
|
ErpInDetail.AddProduct(item.OrdNo, item.LingNo, item.Statu, item.Demo);
|
} else {
|
$.jBox.tip("该订单不能编辑", "warn");
|
}
|
break;
|
case "Delete":
|
var submit = function (v, h, f) {
|
if (v == "ok") {
|
var list = ErpInManager.GetRows();
|
|
if (list.length == 0) {
|
$.jBox.tip("请选择要删除的项", "warn");
|
return false;
|
}
|
var item = list[0];
|
|
if (item.Statu == "正在执行" || item.Statu == "执行完成") {
|
//$.jBox.confirm("该订单数据正在执行,不可删除!", "提示");
|
$.jBox.tip("该订单数据正在执行或执行完成,不可删除!", "warn");
|
return false;
|
}
|
|
var param = {};
|
param["list"] = JSON.stringify(list);
|
var Server = ErpInManager.Server();
|
Server.Delete(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
ErpInManager.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
}
|
$.jBox.confirm("该操作将删除该订单所有数据,确定要删除吗?", "提示", submit);
|
break;
|
case "Close":
|
var list1 = ErpInManager.GetRows();
|
if (list1.length == 0) {
|
$.jBox.tip("请选择要关单的项", "warn");
|
return false;
|
}
|
var item = list1[0];
|
if (item.Statu == "正在执行") {
|
var submit = function (v, h, f) {
|
if (v == "ok") {
|
var param = {};
|
param["list"] = item.OrdNo;
|
var Server = ErpInManager.Server();
|
Server.Close(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
ErpInManager.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
}
|
$.jBox.confirm("该操作将关闭该订单,确定要关单吗?", "提示", submit);
|
} else {
|
$.jBox.tip("该订单状态不可执行关单。", "warn");
|
}
|
break;
|
case "Input":
|
$('#excelFile').click();
|
break;
|
case "Excel":
|
var Server = ErpInManager.Server();
|
var search = ErpInManager.GetSearch();
|
Server.ToExcel(search, function (result) {
|
|
if (result.Code == 1000) {
|
var path = unescape(result.Message);
|
window.location.href = path;
|
} else {
|
$.jBox.info(result.Message, "提示");
|
}
|
});
|
break;
|
case "Refresh": // 刷新
|
break;
|
case "CloseBill":
|
ErpInManager.Close();
|
break;
|
case "#":
|
break;
|
default: break;
|
}
|
|
});
|
|
//搜索 高级搜索按钮
|
var searchBar = $("div[data-condition='search']");
|
searchBar.find("a[data-command='search']").click(function () {
|
ErpInManager.PageClick(1, 50);
|
});
|
searchBar.find("a[data-command='ImportExcel']").click(function () {
|
ErpInProduct.ImportExcel();
|
});
|
|
$('#excelFile').on('change', function () {
|
ErpInManager.ImportExcel();
|
});
|
|
//窗体加载获得焦点
|
searchBar.find("input[name='OrdNo']").focus();
|
|
//加载默认数据
|
ErpInManager.PageClick(1, 50);
|
},
|
ImportExcel: function () {
|
var formData = new FormData();
|
var filename = $('#excelFile').val();
|
if (filename == null || filename == "" || filename == "undefined") {
|
$.jBox.tip("请选择文件", "warning");
|
return;
|
} else {
|
formData.append('file', $("#excelFile")[0].files[0]); //将文件转成二进制形式
|
$.ajax({
|
type: "post",
|
url: "/Business/ErpIn/ExcelToUpload",//"/文件名/控制器名/控制器内方法"
|
async: false,
|
contentType: false, //这个一定要写
|
processData: false, //这个也一定要写,不然会报错
|
data: formData,
|
dataType: 'json', //返回类型
|
success: function (data) {
|
if (data == "导入失败,请检查匹配") {
|
var submit = function (v, h, f) {
|
window.location.href = "/Business/ErpIn/Index";
|
}
|
$.jBox.confirm(data, "提示", submit);
|
} else {
|
var submit = function (v, h, f) {
|
window.location.href = "/Business/ErpIn/Index";
|
}
|
$.jBox.confirm(data, "提示", submit);
|
}
|
}
|
})
|
}
|
},
|
}
|
|
|
|
var ErpInProduct = {
|
Init: function (staut) {
|
|
//初始化绑定事件
|
$("div.formbtn").find("button.btn").click(function (event) {
|
var command = $(this).attr("data-command");
|
if (command == "Add") {
|
ErpInProduct.AddProduct("", "", "", staut);
|
}
|
else if (command == "Save") {
|
var param = ErpInProduct.GetModel();
|
if (!param) {
|
return false;
|
}
|
var Server = ErpInManager.Server();
|
Server.Add(param, function (result) {
|
if (result.Code == 1) {
|
window.location.href = "/Business/ErpIn/Index";
|
} else {
|
$.jBox.tip(result.Message);
|
}
|
});
|
|
}
|
else if (command == "Cancel") {
|
window.location.href = "/Business/ErpIn/Index";
|
}
|
});
|
|
ErpInProduct.PageClick(1, 5, staut);
|
},
|
PageClick: function (PageIndex, PageSize, staut) {
|
var Server = ErpInManager.Server();
|
var search = {};
|
search["PageIndex"] = PageIndex;
|
search["PageSize"] = PageSize;
|
Server.LoadDetail(search, function (result) {
|
ErpInProduct.SetTable(result, staut);
|
});
|
},
|
SetTable: function (result, staut) {
|
|
var cols = [
|
{
|
title: '操作', name: 'Operation', width: 120, align: 'left', lockWidth: false, renderer: function (data, item, rowIndex) {
|
var html = "";
|
|
if (staut == "正在执行") {
|
html += '<a class="edit" href="javascript:void(0)">编辑</a> ';
|
} else {
|
html += '<a class="edit" href="javascript:void(0)">编辑</a> ';
|
html += '<a class="delete" href="javascript:void(0)">删除</a> ';
|
}
|
|
return html;
|
}
|
},
|
{
|
title: '物料编码', name: 'MatNo', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '物料名称', name: 'MatName', width: 160, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '规格型号', name: 'PackFormat', width: 260, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '单位', name: 'UnitFrist', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '货位地址', name: 'addreNo', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '托盘', name: 'Palno', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '入库数量', name: 'PlanQuant', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '实入数量', name: 'CurQuant', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '图号', name: 'TuNo', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '序号', name: 'PageNo', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '备注', name: 'Demo', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
|
];
|
// debugger
|
if (this.TabGrid == undefined) {
|
var ht = masterUI.MMGridHeight();
|
this.TabGrid = $("#tabList").mmGrid({
|
cols: cols,
|
items: result.Result.List,
|
checkCol: true,
|
nowrap: true,
|
height: ht
|
});
|
ErpInProduct.BindTableEvent(staut);
|
} else {
|
this.TabGrid.load(result.Result.List);
|
}
|
|
var pageInfo = result.PageInfo;
|
if (pageInfo != undefined) {
|
$("#mypager").pager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: ErpInProduct.PageClick });
|
}
|
|
},
|
BindTableEvent: function (staut) {
|
this.TabGrid.off("cellSelected").on("cellSelected", function (e, item, rowIndex, colIndex) {
|
if ($(e.target).is("a.delete")) {
|
var MatNo = item.MatNo;
|
var submit = function (v, h, f) {
|
if (v == "ok") {
|
var param = {};
|
param["MatNo"] = MatNo;
|
var Server = ErpInManager.Server();
|
Server.DelProduct(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
ErpInProduct.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
}
|
$.jBox.confirm("确定要删除吗?", "提示", submit);
|
}
|
else if ($(e.target).is("a.edit")) {
|
var OrdNo = item.OrdNo;
|
var LingNo = item.LingNo;
|
var staut = item.Statu;
|
|
// debugger
|
ErpInProduct.AddProduct(OrdNo, LingNo, staut);
|
}
|
});
|
},
|
AddProduct: function (OrdNo, LingNo, Status) {
|
// debugger
|
var submit = function (v, h, f) {
|
|
if (v) {
|
// debugger
|
//var entity = ErpInProduct.GetModel();
|
var entity = {};
|
entity["OrdNo"] = OrdNo;
|
entity["LingNo"] = LingNo;
|
entity["Statu"] = Status;
|
var Server = ErpInManager.Server();
|
Server.Add(entity, function (result) {
|
if (result.Code == 1) {
|
ErpInManager.PageClick(1, 5);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
}
|
|
//对话框加载之后回调事件
|
var load = function (h) {
|
|
|
if (OrdNo != null) {
|
// debugger
|
$("input[name='OrdNo']").val(OrdNo);
|
$("input[name='LingNo']").val(LingNo);
|
|
var param = {};
|
param["OrdNo"] = OrdNo;
|
ErpInManager.Server().GetDetail(param, function (result) {
|
$.jBox.closeTip();
|
if (result.Code == 1) {
|
ErpInDetail.SetTable(result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
}
|
);
|
}
|
|
}
|
var para = {};
|
para["OrdNo"] = OrdNo;
|
ErpInManager.Server().CheckOrdStatus(para, function (result) {
|
if (result.Code == 1) {
|
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
return;
|
}
|
});
|
// debugger
|
if (git.IsEmpty(OrdNo)) {
|
//debugger
|
$.jBox.open("get:/Business/ErpIn/AddProduct", "新增产品", 800, 500, { buttons: { "确定": true, "关闭": false }, submit: submit, loaded: load });
|
} else {
|
$.jBox.open("get:/Business/ErpIn/AddProduct?OrdNo=" + OrdNo, "编辑产品", 800, 500, { buttons: { "确定": true, "关闭": false }, submit: submit, loaded: load });
|
}
|
},
|
|
GetModel: function () {
|
var OrdNo = $("input[name='OrdNo']").val();
|
var LingNo = $("input[name='LingNo']").val();
|
var Demo = $("input[name='Demo']").val();
|
|
if (git.IsEmpty(LingNo)) {
|
$.jBox.tip("请输入生产令号", "warn");
|
return false;
|
}
|
|
var param = {};
|
|
param["OrdNo"] = OrdNo;
|
param["LingNo"] = LingNo;
|
param["Demo"] = Demo;
|
|
var entity = {};
|
|
entity["Entity"] = JSON.stringify(param);
|
|
return entity;
|
},
|
//导入excel
|
ImportExcel: function () {
|
|
var formData = new FormData();
|
var filename = $("#excelFile")[0].files[0];
|
if (filename == null || filename == "" || filename == "undefined") {
|
$.jBox.tip("请选择文件", "warn");
|
return;
|
} else {
|
formData.append('file', $("#excelFile")[0].files[0]); //将文件转成二进制形式
|
$.ajax({
|
type: "post",
|
url: "/Business/ErpIn/ExcelToUpload",//"/文件名/控制器名/控制器内方法"
|
async: false,
|
contentType: false, //这个一定要写
|
processData: false, //这个也一定要写,不然会报错
|
data: formData,
|
dataType: 'json', //返回类型
|
success: function (data) {
|
var submit = function () {
|
window.location.href = "/Business/ErpIn/Index";
|
}
|
$.jBox.confirm(data, "提示", submit);
|
},
|
})
|
}
|
},
|
|
}
|
|
|
var ErpInDetail = {
|
Servers: function (URL, data, callback) {
|
$.gitAjax({
|
url: URL,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
callback(result);
|
}
|
});
|
},
|
BindTable: undefined,
|
BindTableEvent: function (staut) {
|
ErpInDetail.BindTable.off("cellSelected").on("cellSelected", function (e, item, rowIndex, colIndex) {
|
if ($(e.target).is("a.delete")) {
|
var MatGuid = item.MatGuid;
|
var submit = function (v, h, f) {
|
if (v == "ok") {
|
var param = {};
|
param["MatGuid"] = MatGuid;
|
|
ErpInManager.DataInteractWay("/Business/ErpInAjax/DelProduct",
|
{ ajaxdata: JSON.stringify(param) },
|
function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
ErpInDetail.SetTable(result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
})
|
}
|
}
|
$.jBox.confirm("确定要删除吗?", "提示", submit);
|
}
|
else if ($(e.target).is("a.edit")) {
|
$('div.controls').find("#MatGuid").val(item.MatGuid);
|
$('div.controls').find("#MatNo").val(item.MatNo);
|
$('div.controls').find("#MatName").val(item.MatName);
|
$('div.controls').find("#PageNo").val(item.PageNo);
|
$('div.controls').find("#MatType").val(item.MatType);
|
$('div.controls').find("#CurQuant").val(item.CurQuant);
|
$('div.controls').find("#PlanQuant").val(item.PlanQuant);
|
$('div.controls').find("#DetailDemo").val(item.DetailDemo);
|
|
// 若属性没值不清空文本框
|
if (!git.IsEmpty(item.TuNo)) {
|
$('div.controls').find("#TuNo").val(item.TuNo);
|
}
|
if (!git.IsEmpty(item.Certificate)) {
|
$('div.controls').find("#Certificate").val(item.Certificate);
|
}
|
if (!git.IsEmpty(item.LingNo)) {
|
$('div.controls').find("#LingNo").val(item.LingNo);
|
}
|
}
|
});
|
},
|
SetTable: function (result) {
|
ErpInDetail.BindTable.load(result.Result.List);
|
ErpInDetail.BindTableEvent();
|
},
|
InitTable: function () {
|
var cols = [
|
{
|
title: '操作', name: 'Operator', width: 60, align: 'left', lockWidth: false, renderer: function (data, item, rowIndex) {
|
var html = "";
|
html += '<a class="edit " href="javascript:void(0)">编辑 </a>';
|
html += '<a class="delete " href="javascript:void(0)">删除 </a>';
|
//html += '<a class="view" href="javascript:void(0)">查看</a> ';
|
return html;
|
}
|
},
|
{
|
title: '生产令号', name: 'LingNo', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '图号', name: 'TuNo', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '序号', name: 'PageNo', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '合格证', name: 'Certificate', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '物料编码', name: 'MatNo', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '物料名称', name: 'MatName', width: 160, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '总数', name: 'CurQuant', width: 50, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '单数', name: 'PlanQuant', width: 50, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '批次号', name: 'BatchNo', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '批次描述', name: 'BatchDemo', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '类型', name: 'MatType', width: 50, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '备 注', name: 'DetailDemo', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
];
|
{
|
ErpInDetail.BindTable = $("#tabList1").mmGrid({
|
cols: cols,
|
items: null,
|
indexCol: true,
|
checkCol: false,
|
nowrap: true,
|
height: 240
|
});
|
//绑定编辑 删除事件
|
ErpInDetail.BindTableEvent();
|
}
|
},
|
EventBind: function () {
|
$('div.controls').find("#btnBind").click(function () {
|
// 物料编码验证
|
if (git.IsEmpty($('div.controls').find("#LingNo").val())) {
|
$.jBox.tip("生产令号不能为空", "warn");
|
return false;
|
}
|
if (git.IsEmpty($('div.controls').find("#MatNo").val()) ||
|
git.IsEmpty($('div.controls').find("#MatGuid").val())) {
|
$.jBox.tip("物料编码不能为空", "warn");
|
return false;
|
}
|
if (!git.checkInteger($('div.controls').find("#CurQuant").val())) {
|
$.jBox.tip("总数必须为数字", "warn");
|
return false;
|
}
|
if (git.IsEmpty($('div.controls').find("#CurQuant").val())) {
|
$.jBox.tip("总数不允许为空", "warn");
|
return false;
|
}
|
|
var param = {};
|
param["MatGuid"] = $('div.controls').find("#MatGuid").val();
|
param["MatName"] = $('div.controls').find("#MatName").val();
|
param["MatNo"] = $('div.controls').find("#MatNo").val();
|
param["LingNo"] = $('div.controls').find("#LingNo").val();
|
param["TuNo"] = $('div.controls').find("#TuNo").val();
|
param["PageNo"] = $('div.controls').find("#PageNo").val();
|
param["CurQuant"] = $('div.controls').find("#CurQuant").val();
|
param["PlanQuant"] = $('div.controls').find("#PlanQuant").val();
|
param["BatchNo"] = $('div.controls').find("#BatchNo").val();
|
param["BatchDemo"] = $('div.controls').find("#BatchDemo").val();
|
param["MatType"] = $('div.controls').find("#MatType").val();
|
param["Certificate"] = $('div.controls').find("#Certificate").val();
|
param["DetailDemo"] = $('div.controls').find("#DetailDemo").val();
|
|
// 判断物料是否存在
|
var MatGuid = $('div.controls').find("#MatGuid").val();
|
ErpInDetail.Servers("/Business/ErpInAjax/IsCheckMatNo",
|
{ aaa: MatGuid }, function (result) {
|
if (result == null) {
|
$.jBox.tip("物料编码不存在,请核实!", "warn");
|
return false;
|
}
|
else {
|
ErpInManager.DataInteractWay("/Business/ErpInAjax/AddMat",
|
{ ajaxdata: JSON.stringify(param) },
|
function (result) {
|
if (result.Code == 1) {
|
ErpInDetail.SetTable(result);
|
$('div.controls').find("#MatGuid").val("");
|
$('div.controls').find("#MatName").val("");
|
$('div.controls').find("#MatType").val("");
|
$('div.controls').find("#MatNo").val("");
|
$('div.controls').find("#PageNo").val("");
|
$('div.controls').find("#CurQuant").val("");
|
$('div.controls').find("#PlanQuant").val("");
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
})
|
}
|
});
|
});
|
ErpInDetail.InitTable();
|
ErpInManager.Server().Init(function (result) {
|
$.jBox.closeTip();
|
if (result.Code == 1) {
|
ErpInDetail.SetTable(result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
},
|
AddProduct: function (OrdNo, LingNo, Status, demo) {
|
|
var submit = function (v, h, f) {
|
if (v) {
|
var bl = true;
|
var data = {};
|
data["OrdNo"] = OrdNo;
|
data["Statu"] = Status;
|
data["BatchNo"] = $('div.controls').find("#BatchNo").val();
|
data["BatchDemo"] = $('div.controls').find("#BatchDemo").val();
|
data["Demo"] = $('div.controls').find("#Demo").val();
|
|
$.gitAjax({
|
async: false,
|
url: "/Business/ErpInAjax/Add",
|
data: { entity: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (result.Code == 1) {
|
// 刷新主页面
|
ErpInManager.PageClick(1, 15);
|
}
|
else {
|
bl = false;
|
$.jBox.tip(result.Message, "warn");
|
}
|
}
|
});
|
|
return bl;
|
}
|
}
|
|
//对话框加载之后回调事件
|
var load = function (h) {
|
|
if (OrdNo != null) {
|
var entity = {};
|
entity["OrdNo"] = OrdNo;
|
ErpInManager.DataInteractWay("/Business/ErpInAjax/GetDetail",
|
{ ajaxdata: JSON.stringify(entity) },
|
function (result) {
|
if (result.Code == 1) {
|
// debugger
|
$('div.controls').find("#OrdNo").val(OrdNo);
|
$('div.controls').find("#Demo").val(result.Result.List[0].Demo);
|
$('div.controls').find("#BatchNo").val(result.Result.List[0].BatchNo);
|
$('div.controls').find("#BatchDemo").val(result.Result.List[0].BatchDemo);
|
|
ErpInDetail.SetTable(result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
|
// 加载已选物料
|
h.find("input[name='MatNo']").PurchaseDialog({
|
Mult: false,
|
callBack: function () {
|
console.log("测试是否触发获取");
|
ErpInDetail.Servers("/Business/ErpInAjax/GetMatNos",
|
{ ajaxdata: "" }, function (result) {
|
if (result != null) {
|
if (result.Code == 1) {
|
// 查询成功,绑定Table
|
ErpInDetail.SetTable(result);
|
}
|
else {
|
$.jBox.tip("请选择物料!", "warn");
|
}
|
}
|
});
|
}
|
});
|
|
h.find("input[name='MatNo']").keydown(function (event) {
|
if (event.keyCode == 13) {
|
var value = $(this).val();
|
if (!git.IsEmpty(value)) {
|
//liudl 此处获取物料编码 10-04号
|
ErpInManager.DataInteractWay("/Business/ErpInAjax/GetMatNo",
|
{ aaa: value },
|
function (result) {
|
if (result != null) {
|
$('div.controls').find("#MatGuid").val(result.Result.Mat[0].MatGuid);
|
$('div.controls').find("#MatNo").val(result.Result.Mat[0].MatNo);
|
$('div.controls').find("#MatName").val(result.Result.Mat[0].MatName);
|
$('div.controls').find("#MatType").val(result.Result.Mat[0].MatType);
|
} else {
|
$('div.controls').find("#MatGuid").val("");
|
$('div.controls').find("#MatName").val("");
|
$('div.controls').find("#MatType").val("");
|
$.jBox.tip("物料编码不存在!", "warn");
|
}
|
});
|
|
h.find("input[name='LingNo']").focus();
|
}
|
}
|
});
|
|
}
|
//debugger
|
|
if (git.IsEmpty(OrdNo)) {
|
|
$.jBox.open("get:/Business/ErpIn/AddProduct", "新增产品", 800, 590, { buttons: { "确定": true, "关闭": false }, top: '6%', submit: submit, loaded: load });
|
}
|
else {
|
var para = {};
|
para["OrdNo"] = OrdNo;
|
ErpInManager.DataInteractWay("/Business/ErpInAjax/CheckOrdStatus",
|
{ ajaxdata: JSON.stringify(para) },
|
function (result) {
|
if (result.Code == 1) {
|
$.jBox.open("get:/Business/ErpIn/AddProduct?OrdNo=" + OrdNo, "编辑产品", 800, 590, { buttons: { "确定": true, "关闭": false }, top: '6%', submit: submit, loaded: load });
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
return false;
|
}
|
});
|
}
|
|
},
|
}
|