$(document).ready(function () {
masterUI.ToggleMenu();
masterUI.resizeU();
masterUI.Ad();
//masterUI.ChangeStorage();
});
/********************************************左侧菜单***********************************************/
var masterUI = {
ToggleMenu: function () {
//用于左侧菜单展开以及显示
$(".sidebar-toggler").click(function () {
var MenuStatus = "open";
if (!$("#container").hasClass("sidebar-closed")) {
$("#container").addClass("sidebar-closed");
MenuStatus = "close";
} else {
$("#container").removeClass("sidebar-closed");
MenuStatus = "open";
}
var param = {};
param["MenuStatus"] = MenuStatus;
$.gitAjax({
url: "/Common/SetMenuStatus", type: "post", data: param, success: function (result) {
}
});
});
//右侧菜单点击操作
$("#sidebar ul .has-sub").click(function () {
var index = $("#sidebar ul .has-sub").index($(this));
$("#sidebar ul .has-sub").each(function (i, item) {
if (index == i) {
$(this).children(".sub").slideDown(500, function () {
if (!$(item).hasClass("active")) {
$(item).children("a").children(".arrow").addClass("open");
$(item).addClass("active");
}
});
} else {
$(item).children(".sub").slideUp(500, function () {
if ($(item).hasClass("active")) {
$(item).removeClass("active");
$(item).children("a").children(".arrow").removeClass("open");
}
});
}
});
});
},
Ad: function () {
//$.jBox.messager("
", " 系统动态:新增Android版本手持机支持 ", 10000, {
// width: 350, showType: 'fade', buttons: { '关闭': true }, submit: function (v, h, f) {
// //window.open("http://www.jooshow.com/");
// return true;
// }
//});
},
ChangeStorage: function () {
//切换仓库
$("li.storage_item").click(function () {
var StorageNum = $(this).attr("data-StorageNum");
var param = {};
param["StorageNum"] = StorageNum;
$.gitAjax({
url: "/Common/ChangeStorage", type: "post", data: param, success: function (result) {
window.location.reload();
}
});
});
},
tableTopHeight: function () {
var bodyheight = $("#body").height();
var Span12ht = $(".breadcrumb").height();
var titleHt = $(".widget-title").height() + 21;
var formHt = $(".widget-body").children(".row-fluid").height();
var footHt = 92;
var hh = bodyheight - Span12ht - titleHt - formHt - footHt + 8;//liudl Edit- 20;
return hh * 0.6;
},
tableBomHeight: function () {
var bodyheight = $("#body").height();
var Span12ht = $(".breadcrumb").height();
var titleHt = $(".widget-title").height() + 21;
var formHt = $(".widget-body").children(".row-fluid").height();
var footHt = 92;
var hh = bodyheight - Span12ht - titleHt - formHt - footHt + 8;//liudl Edit- 20;
return hh * 0.4;
},
MMGridHeight: function () {
var bodyheight = $("#body").height();
var Span12ht = $(".breadcrumb").height();
var titleHt = $(".widget-title").height() + 21;
var formHt = $(".widget-body").children(".row-fluid").height();
var footHt = 45;
var hh = bodyheight - Span12ht - titleHt - formHt - footHt + 8;//liudl Edit- 20;
return hh;
},
EMMGridHeight: function () {
var bodyheight = $("#body").height();
var Span12ht = $(".breadcrumb").height();
var titleHt = $(".widget-title").height() + 21;
var formHt = $(".widget-body").children(".row-fluid").height();
var footHt = 46;
var hh = bodyheight - Span12ht - titleHt - formHt - footHt - 20;
return hh;
},
DMMGridHeight: function () {
var bodyheight = $("#body").height();
var Span12ht = $(".breadcrumb").height();
var titleHt = $(".widget-title").height() + 21;
var formHt = $(".widget-body").children(".row-fluid").height();
var footHt = 46;
var hh = bodyheight - Span12ht - titleHt - formHt - footHt - 20;
return hh;
},
resizeU: function () {
var height = $(document).height();
height = parseInt(height) - 10;// - 83; // liudl Edit
$("#body").css("height", height);
},
ChangePwd: function (UserCode) {
var DataServer = {
Server: function () {
var config = (function () {
var URL_ChangePwd = "/UserAjax/UserChangePass";
return {
URL_ChangePwd: URL_ChangePwd
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var ChangePwd = function (data, callback) {
$.gitAjax({
url: config.URL_ChangePwd,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
ChangePwd: ChangePwd
}
})($, config);
return dataServer;
},
}
var submit = function (v, h, f) {
if (v) {
var CurrentPass = h.find('input[name="CurrentPass"]').val();
var NewPass = h.find('input[name="NewPass"]').val();
var ConfirmPass = h.find('input[name="ConfirmPass"]').val();
if (git.IsEmpty(CurrentPass)) {
$.jBox.tip("请输入原始密码", "warn");
return false;
}
if (git.IsEmpty(NewPass)) {
$.jBox.tip("请输入新密码", "warn");
return false;
}
if (NewPass != ConfirmPass) {
$.jBox.tip("确认密码必须和密码一致", "warn");
return false;
}
//var param = {};
var Deskey = CryptoDes.uuid(8, 20);
var param = {};
param["Deskey"] = Deskey;
//param["UserCode"] = CryptoDes.encryptByDES(UserCode, Deskey);
//param["CurrentPass"] = CryptoDes.encryptByDES(CurrentPass, Deskey);;
//param["NewPass"] = CryptoDes.encryptByDES(NewPass, Deskey);;
//param["ConfirmPass"] = CryptoDes.encryptByDES(ConfirmPass, Deskey);;
param["UserCode"] = UserCode;
param["Pwd"] = CurrentPass;
param["NewPass"] = NewPass;
param["ConfirmPass"] = ConfirmPass;
var Server = DataServer.Server();
Server.ChangePwd(param, function (result) {
if (result.Code == 1) {
$.jBox.tip(result.Message, "success");
} else {
$.jBox.tip(result.Message, "warn");
}
});
}
}
$.jBox.open("get:/Home/ChangePass?UserCode=" + UserCode, "修改密码", 330, 220, { buttons: { "确定": true, "关闭": false }, submit: submit });
}
};
/**************************************控制按钮权限****************************************** *///
var LoadBtn = {
SetBtn: function () {
var UserCode = $("div.top-nav").find("a[name='UserCode']").text();
var title = $("div.widget-title").find("h5[name='titles']").text();
var title2 = $("div.widget-title").find("h5[name='titles2']").text();
var param = {};
param["UserCode"] = UserCode;
param["Title"] = title;
param["Title2"] = title2;
$.gitAjax({
url: "/Home/GetBtn", type: "post", data: param, success: function (result) {
var btn = $("div.mmGrid")
var json = result.List;
for (var i = 0; i < json.length; i++) {
var bt = json[i];
if (bt.Css == "") {
btn.find("a." + bt.Name).removeClass("dis");
}
}
}
});
}
}
/********************************************选择库位***********************************************/
; (function ($) {
$.fn.LocalDialog = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
GetList
var URL_GetList = "/BasicInfo/GoodsPosAjax/";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Addre = current.find("input[name='Addre']").val();
var pai = current.find("input[name='pai']").val();
var lie = current.find("input[name='lie']").val();
var ceng = current.find("input[name='ceng']").val();
var search = defaultOption.data || {};
if (search.ListLocalType == undefined) {
search.ListLocalType = JSON.stringify([]);
}
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["Addre"] = Addre;
search["pai"] = pai;
search["lie"] = lie;
search["ceng"] = ceng;
search["Statu"] = "N"; // 只能选择 空货位 未锁状态
search["ALock"] = "N";
var Server = DataServer.Server();
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '库区', name: 'Area', width: 90, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '货位地址', name: 'Addre', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '排', name: 'pai', width: 70, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '列', name: 'lie', width: 70, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '层', name: 'ceng', width: 70, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '货位属性', name: 'property', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '货位状态', name: 'statu', width: 80, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '锁定状态', name: 'ALock', width: 80, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '备注', name: 'Demo', width: 90, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
}
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
//DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
// defaultOption.callBack(item);
// $.jBox.close();
//});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
return $(this).each(function (index, el) {
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择库位", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack.call(el, list);
} else {
defaultOption.callBack.call(el, list[0]);
}
}
}
};
$(el).bind(defaultOption.EventName, function () {
$.jBox.open("get:/BasicInfo/GoodsPos/Dialog", "选择货位", 850, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
});
};
})(jQuery);
/********************************************选择产品信息***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.ProductDialog = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/MatAjax/GetMatList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var search = defaultOption.data || {};
var MatNo = current.find('input[name="MatNo"]').val();
var MatName = current.find('input[name="MatName"]').val();
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["MatNo"] = MatNo;
search["MatName"] = MatName;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '物料编码', name: 'MatNo', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '物料名称', name: 'MatName', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '规格型号', name: 'PackFormat', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '计量单位', name: 'UnitFrist', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '品牌', name: 'Demo1', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '备注', name: 'Display', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 355,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
defaultOption.callBack(item);
$.jBox.close();
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择产品", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/BasicInfo/Mat/Dialog", "选择产品", 850, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/********************************************选择产品信息***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.StoreDialog = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/StoreAjax/GetBasicList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var search = defaultOption.data || {};
var MatNo = current.find('input[name="MatNo"]').val();
var MatName = current.find('input[name="MatName"]').val();
var ItemNo = current.find('input[name="ItemNo"]').val();
var ItemName = current.find('input[name="ItemName"]').val();
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["MatNo"] = MatNo;
search["MatName"] = MatName;
search["ItemNo"] = ItemNo;
search["ItemName"] = ItemName;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '物料编码', name: 'MatNo', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '物料名称', name: 'MatName', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '规格型号', name: 'PackFormat', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '计量单位', name: 'Unit', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
//{
// title: '品牌', name: 'Demo_21', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
// return data;
// }
//},
{
title: '托盘号', name: 'Palno', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库位地址', name: 'Addre', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库存数量', name: 'LQuant', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
//{
// title: '项目号', name: 'ItemNo', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
// return data;
// }
//},
//{
// title: '项目名称', name: 'ItemName', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
// return data;
// }
//},
//{
// title: '备注', name: 'Demo', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
// return data;
// }
//},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
defaultOption.callBack(item);
$.jBox.close();
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择产品", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Data/Store/Dialog", "选择产品", 850, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/**
* 出库单选择物料信息
**/
; (function ($) {
$.fn.LogStore = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/StoreAjax/GetLogStore";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var search = defaultOption.data || {};
var MatNo = current.find('input[name="MatNo"]').val();
var MatName = current.find('input[name="MatName"]').val();
var Ling_No = current.find('input[name="Ling_No"]').val();
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["MatNo"] = MatNo;
search["Ling_No"] = Ling_No;
search["MatName"] = MatName;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '生产令号', name: 'Ling_No', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '图号', name: 'Tu_No', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '序号', name: 'Ye_No', 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: 'PackFormat', width: 260, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库存数量', name: 'Quant', width: 80, 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: 'Unit', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库位地址', name: 'Addre', width: 100, 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;
}
}
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
defaultOption.callBack(item);
$.jBox.close();
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择产品", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Data/Store/Dialog", "选择产品", 750, 500, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/**
* 托盘出库单选择物料信息
**/
; (function ($) {
$.fn.PalletStore = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/StoreAjax/GetPalletStore";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var search = defaultOption.data || {};
// var PackFormat = current.find('input[name="PackFormat"]').val();
var PackFormat = $("#PackFormat").find("option:selected").val();
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["PackFormat"] = PackFormat;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '托盘号', name: 'Palno', width: 110, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
//{
// title: '规格型号', name: 'PackFormat', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
// return data;
// }
//},
//{
// title: '品牌', name: 'Demo_21', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
// return data;
// }
//},
{
title: '货位地址', name: 'Addre', width: 225, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库存数量', name: 'Quant', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
}
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
defaultOption.callBack(item);
$.jBox.close();
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择产品", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Data/Store/Dialog?type=2", "选择产品", 750, 500, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/*****************************************采购订单--选择产品******************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
* 产品的基本信息,包含数量数据库
**/
; (function ($) {
$.fn.ErpDetailDialog = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/ErpInAjax/GetErpInDetail";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var search = defaultOption.data || {};
var PurchaseNo = current.find('input[name="PurchaseNo"]').val();
var ItemNo = current.find('input[name="ItemNo"]').val();
var ItemName = current.find('input[name="ItemName"]').val();
var MatNo = current.find('input[name="MatNo"]').val();
var MatName = current.find('input[name="MatName"]').val();
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["PurchaseNo"] = PurchaseNo;
search["ItemNo"] = ItemNo;
search["ItemName"] = ItemName;
search["MatNo"] = MatNo;
search["MatName"] = MatName;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '物料编码', name: 'MatNo', width: 85, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '物料名称', name: 'MatName', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '规格型号', name: 'PackFormat', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '计量单位', name: 'Unit', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '品牌', name: 'Demo_21', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '单台数量', name: 'Quant_Unit', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '总数量', name: 'Quant_Total', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '采购数量', name: 'Quant_Buy', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '采购单号', name: 'PurchaseNo', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '项目号', name: 'ItemNo', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '项目名称', name: 'ItemName', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '备注', name: 'Display', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
defaultOption.callBack(item);
$.jBox.close();
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择项目", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Business/Purchase/Dialog", "采购订单-选择项目", 1280, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/******************************************采购订单--选择产品*******************************************/
/******************************************入库单--选择产品-liudl Edit*******************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
* 产品的基本信息,包含数量数据库
**/
; (function ($) {
$.fn.PurchaseDialog = function (options) {
console.log(options);
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/PurchaseAjax/GetPurchaseDetail";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
DataInteractWay: function (bl = true, URL, data, callback) {
$.gitAjax({
url: URL,
data: data,
type: "post",
dataType: "json",
async: bl, // 执行方式 ture异步调用 false顺序调用
success: function (result) {
callback(result);
}
});
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var search = defaultOption.data || {};
var PurchaseNo = current.find('input[name="PurchaseNo"]').val();
var ItemNo = current.find('input[name="ItemNo"]').val();
var ItemName = current.find('input[name="ItemName"]').val();
var MatNo = current.find('input[name="MatNo"]').val();
var MatName = current.find('input[name="MatName"]').val();
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["PurchaseNo"] = PurchaseNo;
search["ItemNo"] = ItemNo;
search["ItemName"] = ItemName;
search["MatNo"] = MatNo;
search["MatName"] = MatName;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '操作', name: 'guid', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
var html = "";
html += '添加 ';
return html;
}
},
{
title: '物料编码', name: 'MatNo', width: 85, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '物料名称', name: 'MatName', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '规格型号', name: 'PackFormat', width: 200, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '类 型', name: 'MatType', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '计量单位', name: 'Unit', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '备注', name: 'Display', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
fullWidthRows: true,
multiSelect: true
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
DataServer.DataInteractWay(false,
"/Business/ErpInAjax/SelMatNos",
{ aaa: item.guid },
function (result) {
console.log("aaaa");
if (result != null) {
// 后期增加提示
}
});
var list = DataServer.GetSelect();
defaultOption.callBack(list[0]);
$.jBox.close();
});
DataServer.TabGrid.off("cellSelected").on("cellSelected", function (e, item, rowIndex) {
if ($(e.target).is("a.add")) {
DataServer.DataInteractWay(false,
"/Business/ErpInAjax/SelMatNos",
{ aaa: item.guid },
function (result) {
if (result != null) {
// 后期增加提示
}
});
}
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list != undefined && list.length > 0) {
list.forEach(function (item, index) {
DataServer.DataInteractWay(false,
"/Business/ErpInAjax/SelMatNos",
{ aaa: item.guid },
function (result) {
if (result != null) {
// 后期增加提示
}
});
});
}
defaultOption.callBack(list[0]);
}
if (v == 2) {
DataServer.DataInteractWay(false,
"/Business/ErpInAjax/EmptySession",
"",
function (result) {
if (result != null) {
// 后期增加提示
}
});
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Business/Purchase/Dialog", "选择物料", 800, 500, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/******************************************出库单--选择产品-liudl add******************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
* 产品的基本信息,包含数量数据库
**/
; (function ($) {
$.fn.SelMatDialog = function (options) {
var selMatDialog = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
selMatDialog = $.extend(selMatDialog, options);
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/PurchaseAjax/GetMatDetial";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
DataInteractWay: function (bl = true, URL, data, callback) {
$.gitAjax({
url: URL,
data: data,
type: "post",
dataType: "json",
async: bl, // 执行方式 ture异步调用 false顺序调用
success: function (result) {
callback(result);
}
});
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var search = selMatDialog.data || {};
var MatNo = current.find('input[name="MatNo"]').val();
var MatName = current.find('input[name="MatName"]').val();
var BatchNo = current.find('input[name="BatchNo"]').val();
var LingNo = current.find('input[name="LingNo"]').val();
search["MatNo"] = MatNo;
search["MatName"] = MatName;
search["BatchNo"] = BatchNo;
search["LingNo"] = LingNo;
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '操作', name: 'MatGuid', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
var html = "";
html += '添加 ';
return html;
}
},
{
title: '物料编码', name: 'MatNo', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '物料名称', name: 'MatName', width: 180, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '总数量', name: 'Quant', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '待出数量', name: 'CQuant', width: 60, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '生产令号', name: 'LingNo', width: 80, 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: 'BatchName', 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: 'Palno', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库位地址', name: 'LocationCode', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
fullWidthRows: true,
multiSelect: true
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("cellSelected").on("cellSelected", function (e, item, rowIndex) {
var list = DataServer.GetSelect();
if ($(e.target).is("a.add")) {
DataServer.DataInteractWay(false,
"/Business/ErpOutAjax/SelMatNos",
{ aaa: item.StoreGuid },
function (result) {
if (result != null) {
// 后期增加提示
}
});
selMatDialog.callBack(list[0]);
//$.jBox.close();
}
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
var list = DataServer.GetSelect();
if (!$(e.target).is("a.add")) {
DataServer.DataInteractWay(false,
"/Business/ErpOutAjax/SelMatNos",
{ aaa: item.StoreGuid },
function (result) {
if (result != null) {
// 后期增加提示
}
});
selMatDialog.callBack(list[0]);
$.jBox.close();
}
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list != undefined && list.length > 0) {
list.forEach(function (item, index) {
DataServer.DataInteractWay(false,
"/Business/ErpOutAjax/SelMatNos",
{ aaa: item.StoreGuid },
function (result) {
if (result != null) {
// 后期增加提示
}
});
});
}
selMatDialog.callBack(list[0]);
}
if (v == 2) {
}
};
$(this).bind(selMatDialog.EventName, function () {
$.jBox.open("get:/Business/Purchase/SelMatDialog", "选择物料", 800, 500, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/*******************************************销售订单选择产品***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
* 销售订单选择产品: 产品信息,正式库位(待入库未)库存总和,输入数量框
**/
; (function ($) {
$.fn.SaleProduct = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/Storage/StockAjax/GetLocalProduct";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: data,
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var ProductName = current.find('input[name="ProductName"]').val();
var BarCode = current.find('input[name="BarCode"]').val();
var Server = DataServer.Server();
var search = {};
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["ProductName"] = ProductName;
search["BarCode"] = BarCode;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '产品编码', name: 'BarCode', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '产品名称', name: 'ProductName', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '规格', name: 'Size', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '类别', name: 'CateName', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '存储单位', name: 'UnitName', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '单价', name: 'OutPrice', width: 55, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库存数', name: 'Num', width: 55, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '数量', name: 'Qty', width: 50, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return '';
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
},
GetSelect: function () {
var list = [];
current.find('#tabInfo').find('tr').each(function (index, el) {
var flag = $(el).find('input.mmg-check').attr("checked");
if (flag) {
var Qty = $(el).find("input[name='Qty']").val();
if (!isNaN(Qty) && parseFloat(Qty) > 0) {
var item = DataServer.TabGrid.row(index);
item["Qty"] = Qty;
list.push(item);
}
}
});
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择产品", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Storage/Product/Product", "销售订单-选择产品", 850, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/********************************************选择出库单产品***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
* 用于出库单的选择,自建出库单需要显示产品库位等信息
**/
; (function ($) {
$.fn.LocalProduct = function (options) {
var defaultOption = {
title: "选择库存产品",
data: {},
Mult: true,
EventName: "click",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/Storage/StockAjax/GetOutAbleList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: data,
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var BarCode = current.find("input[name='BarCode']").val();
var ProductName = current.find("input[name='ProductName']").val();
var LocalNum = current.find("select[name='LocalNum']").val();
var search = {};
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["BarCode"] = BarCode;
search["ProductName"] = ProductName;
search["LocalNum"] = LocalNum;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '产品编号', name: 'BarCode', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '产品名称', name: 'ProductName', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '产品批次', name: 'BatchNum', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库位', name: 'LocalName', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库存数', name: 'Num', width: 85, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '数量', name: 'Qty', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return '';
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
} else {
this.TabGrid.load(result.Result);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
GetSelect: function () {
var list = [];
current.find('#tabInfo').find('tr').each(function (index, el) {
var flag = $(el).find('input.mmg-check').attr("checked");
if (flag) {
var Qty = $(el).find("input[name='Qty']").val();
if (!isNaN(Qty) && parseFloat(Qty) > 0) {
var item = DataServer.TabGrid.row(index);
item["Qty"] = Qty;
list.push(item);
}
}
});
return list;
},
Init: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').click(function (event) {
DataServer.PageClick(1, 10);
});
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list.length == 0) {
$.jBox.tip("请选择产品信息");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Order/OutStorage/AddProduct", defaultOption.title, 850, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
DataServer.Init();
}
});
});
};
})(jQuery);
/********************************************选择客户***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.CustomerDialog = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
CusGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/Client/CustomerAjax/GetAddressList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: data,
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var CusNum = current.find("input[name='CusNum']").val();
var CusName = current.find("input[name='CusName']").val();
var Address = current.find("input[name='Address']").val();
var search = {};
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["CusNum"] = CusNum;
search["CusName"] = CusName;
search["Address"] = Address;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '客户编号', name: 'CusNum', width: 90, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '客户名称', name: 'CusName', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '地址', name: 'Address', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '联系人', name: 'Contact', width: 90, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '电话', name: 'Phone', width: 70, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '备注', name: 'Remark', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '邮箱', name: 'Email', width: 70, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '传真', name: 'Fax', width: 70, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '创建时间', name: 'CreateTime', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return git.JsonToDateTime(data);
}
}
];
if (this.DataServer == undefined) {
this.CusGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result,
checkCol: true,
nowrap: true,
multiSelect: defaultOption.Mult,
height: 380
});
//绑定事件
DataServer.BindEvent();
} else {
this.CusGrid.load(result.Result);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
},
GetSelect: function () {
var list = [];
if (this.CusGrid != undefined) {
var rows = this.CusGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择客户", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Client/Customer/Dialog", "选择客户", 850, 580, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.CusGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/********************************************选择供应商***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.SupplierDialog = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/BasicInfo/CustomerAjax/GetCustomerList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var CusNum = current.find("input[name='CusNum']").val();
var CusName = current.find("input[name='CusName']").val();
var Address = current.find("input[name='Address']").val();
//var Phone = current.find("input[name='Phone']").val();
var search = {};
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["CusNum"] = CusNum;
search["CusName"] = CusName;
search["Address"] = Address;
//search["Phone"] = Phone;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '供应商编号', name: 'CusNum', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '供应商名称', name: 'CusName', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '电话', name: 'Phone', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '传真', name: 'Fax', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: 'Email', name: 'Email', width: 85, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '联系人', name: 'Contacts', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '地址', name: 'Address', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 345,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find('button[data-command="Search"]').click(function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
defaultOption.callBack(item);
$.jBox.close();
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择供应商", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/BasicInfo/Costomer/Dialog", "选择供应商", 850, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/********************************************选择员工***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.UserDialog = function (options) {
var defaultOption = {
data: {},
Mult: true,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var submit = function (v, h, f) {
if (v == 1) {
var result = undefined;
h.find("input[type='checkbox'][name='user_item']").each(function (i, item) {
var flag = $(item).attr("checked");
if (flag || flag == "checked") {
var data = $(item).attr("data-value");
if (!git.IsEmpty(data)) {
result = JSON.parse(unescape(data));
}
}
});
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
defaultOption.callBack(result);
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Home/Dialog", "选择用户", 850, 500, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
}
});
});
};
})(jQuery);
/********************************************选择移库产品***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.CheckProduct = function (options) {
var defaultOption = {
title: "选择移库产品",
data: {},
Mult: true,
EventName: "click",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/data/StoreAjax/GetList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var MatNo = current.find("input[name='MatNo']").val();
var Batch = current.find("input[name='Batch']").val();
var Addre = current.find("input[name='Addre']").val();
var search = {};
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["MatNo"] = MatNo;
search["Batch"] = Batch;
search["Addre"] = Addre;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '货位地址', name: 'Addre', width: 80, 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: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '包装规格', name: 'PackFormat', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '计量单位', name: 'UnitFrist', width: 55, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '批次', name: 'Batch', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '托盘码', name: 'Palno', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '数量', name: 'Quant', width: 50, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
//{
// title: '目标货位', name: 'StopAddre', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
// var html = '';
// html += '';
// return html;
// }
//},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
//DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
//BindEvent: function () {
// this.TabGrid.off("loadSuccess").on('loadSuccess', function (e, data) {
// //绑定选择库位事件
// current.find("#tabInfo").find("input[name='StopAddre']").LocalDialog({
// Mult: false, callBack: function (result) {
// $(this).val(result.Addre);
// }
// });
// });
//},
GetSelect: function () {
var list = [];
current.find('#tabInfo').find('tr').each(function (index, el) {
var flag = $(el).find('input.mmg-check').attr("checked");
if (flag) {
/*var StopAddre = $(el).find("input[name='StopAddre']").val();*/
var item = DataServer.TabGrid.row(index);
item["Addre"] = item.Addre;
item["MatNo"] = item.MatNo;
item["MatName"] = item.MatName;
item["Batch"] = item.Batch;
item["PackFormat"] = item.PackFormat;
item["UnitFrist"] = item.UnitFrist;
item["Quant"] = item.Quant;
item["Palno"] = item.Palno;
//item["StopAddre"] = StopAddre;
list.push(item);
}
});
return list;
},
Init: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
//if (list.RowCount > 1) { }
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Business/CheckData/AddPalno", defaultOption.title, 850, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.Init();
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/********************************************选择移库产品***********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.MoveProduct = function (options) {
var defaultOption = {
title: "选择移库产品",
data: {},
Mult: true,
EventName: "click",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/data/StoreAjax/GetList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var MatNo = current.find("input[name='MatNo']").val();
var Batch = current.find("input[name='Batch']").val();
var Addre = current.find("input[name='Addre']").val();
var search = {};
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["MatNo"] = MatNo;
search["Batch"] = Batch;
search["Addre"] = Addre;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '货位地址', name: 'Addre', width: 80, 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: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '包装规格', name: 'PackFormat', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '计量单位', name: 'UnitFrist', width: 55, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '批次', name: 'Batch', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '托盘码', name: 'Palno', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '数量', name: 'Quant', width: 50, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '目标货位', name: 'StopAddre', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
var html = '';
html += '';
return html;
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
this.TabGrid.off("loadSuccess").on('loadSuccess', function (e, data) {
//绑定选择库位事件
current.find("#tabInfo").find("input[name='StopAddre']").LocalDialog({
Mult: false, callBack: function (result) {
$(this).val(result.Addre);
}
});
});
},
GetSelect: function () {
var list = [];
current.find('#tabInfo').find('tr').each(function (index, el) {
var flag = $(el).find('input.mmg-check').attr("checked");
if (flag) {
var StopAddre = $(el).find("input[name='StopAddre']").val();
var item = DataServer.TabGrid.row(index);
item["StartAddre"] = item.Addre;
item["MatNo"] = item.MatNo;
item["MatName"] = item.MatName;
item["Batch"] = item.Batch;
item["PackFormat"] = item.PackFormat;
item["UnitFrist"] = item.UnitFrist;
item["Quant"] = item.Quant;
item["Palno"] = item.Palno;
item["StopAddre"] = StopAddre;
list.push(item);
}
});
return list;
},
Init: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
//if (list.RowCount > 1) { }
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Business/MovePos/AddPalno", defaultOption.title, 1000, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.Init();
DataServer.PageClick(1, 10);
}
});
});
};
})(jQuery);
/******************************************选择报损产品*********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.BadProduct = function (options) {
var defaultOption = {
title: "选择报损产品",
data: {},
Mult: true,
EventName: "click",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/Storage/StockAjax/GetBadAbleList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: data,
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var BarCode = current.find("input[name='BarCode']").val();
var ProductName = current.find("input[name='ProductName']").val();
var LocalNum = current.find("select[name='LocalNum']").val();
var search = {};
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["BarCode"] = BarCode;
search["ProductName"] = ProductName;
search["LocalNum"] = LocalNum;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '产品编码', name: 'BarCode', width: 65, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '产品名称', name: 'ProductName', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '批次', name: 'BatchNum', width: 80, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库位', name: 'LocalName', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库存数', name: 'Num', width: 55, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '数量', name: 'Qty', width: 50, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return '';
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
},
GetSelect: function () {
var list = [];
current.find('#tabInfo').find('tr').each(function (index, el) {
var flag = $(el).find('input.mmg-check').attr("checked");
if (flag) {
var Qty = $(el).find("input[name='Qty']").val();
if (!isNaN(Qty) && parseFloat(Qty) > 0) {
var item = DataServer.TabGrid.row(index);
item["Qty"] = Qty;
list.push(item);
}
}
});
return list;
},
Init: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Order/Bad/AddProduct", defaultOption.title, 850, 530, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
DataServer.Init();
}
});
});
};
})(jQuery);
/****************************************选择自定义报表格式********************************************/
/**
* data: 传入参数
* Mult:是否允许选择多个checkbox,默认是true
* callBack: 选择之后的回调函数
**/
; (function ($) {
$.fn.CusReportDialog = function (options) {
var defaultOption = {
title: "选择打印模板",
data: {},
Mult: false,
EventName: "click",
callBack: undefined,
ReportType: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var target = $(this);
var DataServer = {
Server: function () {
var config = (function () {
var URL_GetList = "/Report/ManagerAjax/GetList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: data,
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
SetTable: function (result) {
current.find("#tabInfo").DataTable({
destroy: true,
data: result.Result,
paging: false,
searching: false,
scrollX: false,
bAutoWidth: true,
bInfo: false,
ordering: false,
columns: [
{
data: 'SnNum', render: function (data, type, full, meta) {
return "";
}
},
{ data: 'ReportNum' },
{ data: 'ReportName' },
{ data: 'Remark' }
],
aoColumnDefs: [
{ "sWidth": "15px", "aTargets": [0] }
],
oLanguage: {
sEmptyTable: "没有查询到任何数据"
}
});
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
DataServer.BindEvent();
},
BindEvent: function () {
if (defaultOption.Mult) {
current.find("#tabInfo").find("input[name='item_all']").click(function (event) {
var flag = $(this).attr("checked");
if (flag) {
current.find("#tabInfo").find("input[name='item_report']").attr("checked", true);
} else {
current.find("#tabInfo").find("input[name='item_report']").attr("checked", false);
}
});
}
else {
current.find("#tabInfo").find("input[name='item_all']").hide();
current.find("#tabInfo").find("input[name='item_report']").click(function (event) {
current.find("#tabInfo").find("input[name='item_report']").attr('checked', false);
$(this).attr("checked", true);
});
}
},
GetSelect: function () {
var list = [];
current.find("#tabInfo").find("input[name='item_report']").each(function (i, item) {
var flag = $(item).attr("checked");
if (flag) {
var value = $(item).attr("data-full");
var item = JSON.parse(value);
list.push(item);
}
});
return list;
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack.call(target, list);
} else {
defaultOption.callBack.call(target, list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
var Server = DataServer.Server();
var search = {};
search["ReportType"] = defaultOption.ReportType;
Server.GetList(search, function (result) {
var data = result.Result;
if (data != undefined && data.length > 1) {
$.jBox.open("get:/Report/Manager/Dialog", defaultOption.title, 650, 400, {
buttons: { "选择": 1, "关闭": 2 }, submit: submit, loaded: function (h) {
current = h;
DataServer.SetTable(result);
}
});
} else {
defaultOption.callBack.call(target, data[0]);
}
});
});
};
})(jQuery);
/**********************************************账户设置************************************************/
var AccountSetting = {
Add: function () {
var submit = function (v, h, f) {
if (v == true) {
var userCode = h.find("#txtUserCode").val();
var userName = h.find("#txtUserName").val();
var realName = h.find("#txtRealName").val();
var email = h.find("#txtEmail").val();
var phone = h.find("#txtPhone").val();
var mobile = h.find("#txtMobile").val();
var roleNum = h.find("#ddlRole").val();
var departNum = h.find("#ddlDepart").val();
if (userName == undefined || userName == "") {
$.jBox.tip("请输入用户名", "warn");
return false;
}
var param = {};
param["UserCode"] = userCode;
param["UserName"] = userName;
param["RealName"] = realName;
param["Email"] = email;
param["Phone"] = phone;
param["Mobile"] = mobile;
param["RoleNum"] = roleNum;
param["DepartNum"] = departNum;
$.gitAjax({
url: "/UserAjax/AddUser", type: "post", data: { "entity": JSON.stringify(param) }, success: function (result) {
if (result.d == "success") {
$.jBox.tip("编辑成功", "success");
User.PageClick(1, 10);
} else {
$.jBox.tip("编辑失败", "error");
}
}
});
return true;
} else {
return true;
}
}
$.jBox.open("get:/Home/AccountSetting", "编辑用户", 500, 270, { buttons: { "确定": true, "关闭": false }, submit: submit });
},
Edit: function () {
var submit = function (v, h, f) {
if (v == true) {
var CurrentPass = h.find('input[name="CurrentPass"]').val();
var NewPass = h.find('input[name="NewPass"]').val();
var ConfirmPass = h.find('input[name="ConfirmPass"]').val();
var UserNum = h.find('input[name="UserNum"]').val();
if (git.IsEmpty(CurrentPass)) {
$.jBox.tip("请输入当前密码", "warn");
return false;
}
if (git.IsEmpty(NewPass)) {
$.jBox.tip("请输入密码", "warn");
return false;
}
if (git.IsEmpty(ConfirmPass)) {
$.jBox.tip("请输入确认密码", "warn");
return false;
}
if (NewPass != ConfirmPass) {
$.jBox.tip("密码和确认密码不一致", "warn");
return false;
}
if (git.IsEmpty(UserNum)) {
$.jBox.tip("该非法操作已经被禁止", "warn");
return false;
}
var param = {};
param["CurrentPass"] = CurrentPass;
param["NewPass"] = NewPass;
param["ConfirmPass"] = ConfirmPass;
param["UserNum"] = UserNum;
$.gitAjax({
url: "/UserAjax/ChangePass", type: "post", data: param, success: function (result) {
if (result.Code == 1) {
$.jBox.tip("修改成功,请重新登录", "success");
$.jBox.close();
} else {
$.jBox.tip(result.Message, "error");
}
}
});
return false;
} else {
return true;
}
}
$.jBox.open("get:/Home/EditPass", "修改密码", 350, 250, { buttons: { "确定": true, "关闭": false }, submit: submit });
}
};
/*********************************************选择盘库物料liudl****************************************/
; (function ($) {
$.fn.CDProduct = function (options) {
var defaultOption = {
title: "选择盘库产品",
data: {},
Mult: true,
EventName: "click",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/Business/CheckAjax/GetMaterial";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Server = DataServer.Server();
var MatNo = current.find("input[name='MatNo']").val();
var MatName = current.find("input[name='MatName']").val();
var LingNo = current.find("input[name='LingNo']").val();
var LocationCode = current.find("input[name='LocationCode']").val();
var BatchNo = current.find("input[name='BatchNo']").val();
var search = {};
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
search["MatNo"] = MatNo;
search["MatName"] = MatName;
search["LingNo"] = LingNo;
search["LocationCode"] = LocationCode;
search["BatchNo"] = BatchNo;
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '生产令号', name: 'LingNo', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '批次号', name: 'BatchNo', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '批次描述', name: 'BatchName', width: 120, 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: 'PackFormat', width: 260, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '数量', name: 'Quant', width: 60, 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: 'LocationCode', 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;
}
}
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
fullWidthRows: true,
height: 415,
nowrap: true,
multiSelect: defaultOption.Mult
});
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
GetSelect: function () {
var list = [];
current.find('#tabInfo').find('tr').each(function (index, el) {
var flag = $(el).find('input.mmg-check').attr("checked");
if (flag) {
/*var StopAddre = $(el).find("input[name='StopAddre']").val();*/
var item = DataServer.TabGrid.row(index);
item["LocationCode"] = item.LocationCode;
item["MatNo"] = item.MatNo;
item["MatName"] = item.MatName;
item["LingNo"] = item.LingNo;
item["PackFormat"] = item.PackFormat;
item["UnitFrist"] = item.UnitFrist;
item["Quant"] = item.Quant;
item["Palno"] = item.Palno;
list.push(item);
}
});
return list;
},
Init: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 15);
});
}
}
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
//if (list.RowCount > 1) { }
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack(list);
} else {
defaultOption.callBack(list[0]);
}
}
}
};
$(this).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Business/CheckData/AddPalno", defaultOption.title, 1000, 530, {
buttons: { "选择": 1, "关闭": 2 }, top: '5%', submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.Init();
DataServer.PageClick(1, 15);
}
});
});
};
})(jQuery);
/********************************************组盘选择库位地址liudl*************************************/
; (function ($) {
$.fn.SelAddre = function (options) {
var defaultOption = {
data: {},
Mult: false,
EventName: "dblclick",
callBack: undefined
};
defaultOption = $.extend(defaultOption, options);
var current = undefined;
var DataServer = {
TabGrid: undefined,
Server: function () {
var config = (function () {
var URL_GetList = "/Business/IPalletBindAjax/GetAddreList";
return {
URL_GetList: URL_GetList
};
})();
//数据操作服务
var dataServer = (function ($, config) {
//查询分页列表
var GetList = function (data, callback) {
$.gitAjax({
url: config.URL_GetList,
data: { ajaxdata: JSON.stringify(data) },
type: "post",
dataType: "json",
success: function (result) {
if (callback != undefined && typeof callback == "function") {
callback(result);
}
}
});
}
return {
GetList: GetList
}
})($, config);
return dataServer;
},
PageClick: function (PageIndex, PageSize) {
$.jBox.tip("正在努力加载数据...", "loading");
var Addre = current.find("input[name='Addre']").val();
var pai = current.find("input[name='pai']").val();
var lie = current.find("input[name='lie']").val();
var ceng = current.find("input[name='ceng']").val();
var type = current.find("select[name='Type']").val();
var search = defaultOption.data || {};
if (search.ListLocalType == undefined) {
search.ListLocalType = JSON.stringify([]);
}
search["LRow"] = 0;
if (pai.length > 0) {
search["LRow"] = pai;
}
search["LColumn"] = 0;
if (lie.length > 0) {
search["LColumn"] = lie;
}
search["LLayer"] = 0;
if (ceng.length > 0) {
search["LLayer"] = ceng;
}
search["LocationCode"] = Addre;
search["PropertyID"] = '03';
search["TurnoverDemandID"] = '01';
search["TypeID"] = type;
search["PageIndex"] = PageIndex;
search["PageSize"] = PageSize;
var Server = DataServer.Server();
Server.GetList(search, function (result) {
DataServer.SetTable(result);
$.jBox.closeTip();
});
},
SetTable: function (result) {
var cols = [
{
title: '库位地址', name: 'LocationCode', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库位属性', name: 'Property', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库位状态', name: 'TurnoverDemand', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库位类型', name: 'Type', width: 100, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
}, {
title: '库排', name: 'LRow', width: 70, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库列', name: 'LColumn', width: 70, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
{
title: '库层', name: 'LLayer', width: 70, align: 'center', lockWidth: false, sortable: true, renderer: function (data, item, rowIndex) {
return data;
}
},
];
if (this.TabGrid == undefined) {
this.TabGrid = current.find("#tabInfo").mmGrid({
cols: cols,
items: result.Result.List,
checkCol: true,
nowrap: true,
height: 335,
nowrap: true,
multiSelect: defaultOption.Mult
});
//绑定事件
DataServer.BindEvent();
} else {
this.TabGrid.load(result.Result.List);
}
var pageInfo = result.PageInfo;
if (pageInfo != undefined) {
current.find("#myMinPager").minpager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: DataServer.PageClick });
}
},
BindEvent: function () {
//搜索
current.find(".search").find('button[data-command="Search"]').unbind("click").bind("click", function (event) {
DataServer.PageClick(1, 10);
});
DataServer.TabGrid.off("rowDblclick").on("rowDblclick", function (e, item, rowIndex) {
defaultOption.callBack(item);
$.jBox.close();
});
},
GetSelect: function () {
var list = [];
if (this.TabGrid != undefined) {
var rows = this.TabGrid.selectedRows();
if (rows != undefined && rows.length > 0) {
for (var i = 0; i < rows.length; i++) {
list.push(rows[i]);
}
}
}
return list;
}
}
return $(this).each(function (index, el) {
var submit = function (v, h, f) {
if (v == 1) {
var list = DataServer.GetSelect();
if (list == undefined || list.length == 0) {
$.jBox.tip("请选择库位", "warn");
return false;
}
if (defaultOption.callBack != undefined && typeof (defaultOption.callBack) == "function") {
if (defaultOption.Mult) {
defaultOption.callBack.call(el, list);
} else {
defaultOption.callBack.call(el, list[0]);
}
}
}
};
$(el).bind(defaultOption.EventName, function () {
$.jBox.open("get:/Business/IPalletBind/SelAddre", "指定库位", 760, 500, {
buttons: { "选择": 1, "关闭": 2 }, top: '10%', submit: submit, loaded: function (h) {
current = h;
DataServer.TabGrid = undefined;
DataServer.PageClick(1, 10);
}
});
});
});
};
})(jQuery);