|
var MovePosManager = {
|
InTable: undefined,
|
Server: function () {
|
var config = (function () {
|
var URL_AddPalno = "/Business/MovePosAjax/AddPalno";
|
var URL_DeletePalno = "/Business/MovePosAjax/DelPalno";
|
var URL_LoadPalno = "/Business/MovePosAjax/LoadPalno";
|
var URL_GetList = "/Business/MovePosAjax/GetList";
|
var URL_Add = "/Business/MovePosAjax/Add";
|
|
var URL_Delete = "/Business/MovePosAjax/Delete";
|
var URL_GetPalno = "/Business/MovePosAjax/GetPalno";
|
var URL_Audit = "/Business/MovePosAjax/Audit";
|
var URL_Send = "/Business/MovePosAjax/Send";
|
var URL_Close = "/Business/MovePosAjax/Close";
|
return {
|
URL_AddPalno,
|
URL_DeletePalno,
|
URL_LoadPalno,
|
URL_GetList: URL_GetList,
|
URL_Add: URL_Add,
|
|
URL_Delete,
|
URL_GetPalno,
|
URL_Audit,
|
URL_Send,
|
URL_Close,
|
};
|
})();
|
|
//数据操作服务
|
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);
|
}
|
}
|
});
|
}
|
//添加
|
var Add = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_Add,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
}
|
var AddPalno = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_AddPalno,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
|
}
|
|
var DeletePalno = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_DeletePalno,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
|
}
|
|
var LoadPalno = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_LoadPalno,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
|
}
|
|
|
|
var Delete = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_Delete,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
|
}
|
|
var GetPalno = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_GetPalno,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
|
}
|
|
var Audit = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_Audit,
|
data: { ajaxdata: JSON.stringify(data) },
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
|
}
|
|
var Send = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_Send,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
|
}
|
var Close = function (data, callback) {
|
$.gitAjax({
|
url: config.URL_Close,
|
data: data,
|
type: "post",
|
dataType: "json",
|
success: function (result) {
|
if (callback != undefined && typeof callback == "function") {
|
callback(result);
|
}
|
}
|
});
|
|
}
|
return {
|
GetList: GetList,
|
Add: Add,
|
AddPalno,
|
DeletePalno,
|
LoadPalno,
|
Close,
|
Delete,
|
GetPalno,
|
Send,
|
Audit,
|
}
|
|
})($, config);
|
return dataServer;
|
},
|
|
PageClick: function (PageIndex, PageSize) {
|
$.jBox.tip("正在努力加载数据...", "loading");
|
var Server = MovePosManager.Server();
|
var search = MovePosManager.GetSearch();
|
search["PageIndex"] = PageIndex;
|
search["PageSize"] = PageSize;
|
|
Server.GetList(search, function (result) {
|
$.jBox.closeTip();
|
if (result.Code == 1) {
|
MovePosManager.SetTable(result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
},
|
Refresh: function () {
|
var PageSize = $("#mypager").pager("GetPageSize");
|
var PageIndex = $("#mypager").pager("GetCurrent");
|
$.jBox.tip("正在努力加载数据...", "loading");
|
var Server = MovePosManager.Server();
|
var search = MovePosManager.GetSearch();
|
search["PageIndex"] = PageIndex;
|
search["PageSize"] = PageSize;
|
Server.GetList(search, function (result) {
|
$.jBox.closeTip();
|
if (result.Code == 1) {
|
MovePosManager.SetTable(result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
},
|
SetTable: function (result) {
|
var cols = [
|
{
|
title: '操作', name: 'OrdNo', width: 150, align: 'left', lockWidth: false, renderer: function (data, item, rowIndex) {
|
var html = "";
|
if (item.Statu == "等待下发") {
|
html += '<a class="edit dis" href="javascript:void(0)">编辑 </a>';
|
html += '<a class="audit dis" href="javascript:void(0)">审核 </a>';
|
html += '<a class="delete dis" href="javascript:void(0)">删除 </a>';
|
}
|
html += '<a class="view" href="javascript:void(0)">查看 </a>';
|
//html += '<a class="print" href="javascript:void(0)">打印</a> ';
|
|
return html;
|
}
|
},
|
{
|
title: '单据编号', name: 'MDNo', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '状态', name: 'Statu', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '制单人', name: 'CreateUser', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '制单时间', name: 'CreateTime', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return git.JsonToDateTime(data);
|
}
|
},
|
{
|
title: '审核人', name: 'AuditUser', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '审核时间', name: 'AuditTime', width: 120, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return git.JsonToDateTime(data);;
|
}
|
},
|
{
|
title: '审核状态', name: 'AuditStatu', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '完成时间', name: 'COMDDAT', width: 100, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return git.JsonToDateTime(data);
|
}
|
},
|
];
|
|
if (this.InTable == undefined) {
|
|
var ht = masterUI.MMGridHeight();
|
this.InTable = $("#tabList").mmGrid({
|
cols: cols,
|
items: result.Result.List,
|
checkCol: true,
|
nowrap: true,
|
height: ht
|
});
|
//绑定编辑 删除事件
|
MovePosManager.BindEvent();
|
} else {
|
this.InTable.load(result.Result.List);
|
}
|
|
|
var pageInfo = result.PageInfo;
|
if (pageInfo != undefined) {
|
$("#mypager").pager({ pagenumber: pageInfo.PageIndex, recordCount: pageInfo.RowCount, pageSize: pageInfo.PageSize, buttonClickCallback: MovePosManager.PageClick });
|
}
|
},
|
|
BindEvent: function () {
|
|
|
|
|
this.InTable.off("cellSelected").on("cellSelected", function (e, item, rowIndex, colIndex) {
|
|
if ($(e.target).is("a.edit")) {
|
if (item.Statu == "等待下发") {
|
var SN = item.MDNo;
|
window.location.href = "/Business/MovePos/Add?MDNo=" + SN;
|
} else {
|
$.jBox.tip("该订单不能编辑", "warn");
|
}
|
} else if ($(e.target).is("a.audit")) {
|
if (item.Statu == "等待下发" && item.AuditStatu =="未审核") {
|
var SN = item.MDNo;
|
MovePosManager.Detail(SN, "Audit");
|
}
|
} else if ($(e.target).is("a.view")) {
|
var SN = item.MDNo;
|
MovePosManager.Detail(SN, "View");
|
} else if ($(e.target).is("a.delete")) {
|
if (item.Statu == "等待下发") {
|
var SN = item.MDNo;
|
var submit = function (v, h, f) {
|
if (v == "ok") {
|
var list = [];
|
list.push(SN);
|
var param = {};
|
param["list"] = JSON.stringify(list);
|
var Server = MovePosManager.Server();
|
Server.Delete(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
MovePosManager.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "success");
|
}
|
});
|
}
|
}
|
$.jBox.confirm("该操作将删除该订单所有数据,确定要删除吗?", "提示", submit);
|
}
|
}
|
});
|
|
this.InTable.on('loadSuccess', function (e, data) {
|
|
LoadBtn.SetBtn();
|
|
$('#tabList').find('a.print').each(function (i, item) {
|
$(item).CusReportDialog({
|
ReportType: 1,
|
callBack: function (result) {
|
if (result != undefined) {
|
var SN = data[i].OrdNo;
|
//var SnNum = result.SnNum;
|
var url = "/Report/Manager/Show?OrdNo=" + SN;
|
window.location.href = url;
|
}
|
}
|
});
|
});
|
});
|
|
},
|
|
GetSelect: function () {
|
var list = [];
|
if (this.InTable != undefined) {
|
var rows = this.InTable.selectedRows();
|
if (rows != undefined && rows.length > 0) {
|
for (var i = 0; i < rows.length; i++) {
|
list.push(rows[i].MDNo);
|
}
|
}
|
}
|
return list;
|
},
|
GetRows: function () {
|
var list = [];
|
if (this.InTable != undefined) {
|
var rows = this.InTable.selectedRows();
|
if (rows != undefined && rows.length > 0) {
|
for (var i = 0; i < rows.length; i++) {
|
list.push(rows[i]);
|
}
|
}
|
}
|
return list;
|
},
|
GetSearch: function () {
|
var searchBar = $("div[data-condition='search']");
|
var MDNo = searchBar.find("input[name='MDNo']").val();
|
|
var search = {};
|
search["MDNo"] = MDNo;
|
|
return search;
|
},
|
|
Detail: function (MDNo, Command) {
|
|
var submit = function (v, h, f) {
|
if (v == "1") {;
|
var param = {};
|
param["MDNo"] = MDNo;
|
param["AuditStatu"] = "AD02"; //审核通过
|
//param["Reason"] = Reason;
|
var Server = MovePosManager.Server();
|
Server.Audit(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
MovePosManager.PageClick(1, pageSize);
|
$.jBox.close();
|
} else {
|
$.jBox.tip(result.Message, "info");
|
}
|
});
|
} else if (v == "2") {
|
var param = {};
|
param["MDNo"] = MDNo;
|
param["AuditStatu"] = "AD03"; //审核不通过
|
//param["Reason"] = Reason;
|
var Server = MovePosManager.Server();
|
Server.Audit(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
MovePosManager.PageClick(1, pageSize);
|
$.jBox.close();
|
} else {
|
$.jBox.tip(result.Message, "success");
|
}
|
});
|
} else if (v == "3") {
|
//打印
|
} else if (v == "4") {
|
$.jBox.close();
|
}
|
return false;
|
}
|
|
var TabGrid = undefined;
|
var SetTable = function (h, result) {
|
var cols = [
|
{
|
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: 120, 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: 'Quant', width: 55, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '批次', name: 'Batch', width: 70, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '原货位', name: 'StartAddre', width: 90, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
{
|
title: '目标货位', name: 'StopAddre', width: 90, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
return data;
|
}
|
},
|
];
|
|
if (TabGrid == undefined) {
|
TabGrid = h.find('#tabDetail').mmGrid({
|
cols: cols,
|
items: result.Result.List,
|
checkCol: false,
|
nowrap: true,
|
height: 200
|
});
|
} else {
|
TabGrid.load(result.Result.List);
|
}
|
|
}
|
|
var load = function (h) {
|
var param = {};
|
param["MDNo"] = MDNo;
|
var Server = MovePosManager.Server();
|
Server.GetPalno(param, function (result) {
|
if (result.Code == 1) {
|
SetTable(h, result);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
|
if (Command == "View")
|
{
|
$.jBox.open("get:/Business/MovePos/Detail?MDNo=" + MDNo, "移库单详细", 850, 480, {
|
buttons: { "关闭": 4 }, submit: submit, loaded: function (h) {
|
load(h);
|
}
|
});
|
} else if (Command == "Audit") {
|
$.jBox.open("get:/Business/MovePos/Detail?MDNo=" + MDNo, "移库单审核", 850, 480, {
|
buttons: { "审核通过": 1, "审核不通过": 2, "打印": 3, "关闭": 4 }, submit: submit, loaded: function (h) {
|
load(h);
|
}
|
});
|
}
|
},
|
|
ToolBar: function () {
|
//工具栏按钮点击事件
|
$("div.toolbar").find("a.btn").click(function () {
|
var command = $(this).attr("data-command");
|
|
if (command == "Add") {
|
window.location.href = "/Business/MovePos/Add";
|
} else if (command == "Edit") {
|
var list = MovePosManager.GetRows();
|
if (list.length == 0) {
|
$.jBox.tip("请选择要编辑的项", "warn");
|
return false;
|
}
|
var item = list[0];
|
if (item.Statu == "等待下发") {
|
var SN = item.OrdNo;
|
window.location.href = "/Business/MovePos/Add?MDNo=" + SN;
|
} else {
|
$.jBox.tip("该订单不能编辑", "warn");
|
}
|
} else if (command == "Delete") {
|
var list = MovePosManager.GetRows();
|
if (list.length == 0) {
|
$.jBox.tip("请选择要删除的项", "warn");
|
return false;
|
}
|
var item = list[0];
|
if (item.Statu == "等待下发") {
|
var submit = function (v, h, f) {
|
if (v == "ok") {
|
var list = MovePosManager.GetSelect();
|
if (list.length == 0) {
|
$.jBox.tip("请选择要删除的项", "warn");
|
return false;
|
}
|
var param = {};
|
param["list"] = JSON.stringify(list);
|
var Server = MovePosManager.Server();
|
Server.Delete(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
MovePosManager.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
|
}
|
$.jBox.confirm("该操作将删除该订单所有数据,确定要删除吗?", "提示", submit);
|
}
|
} else if (command == "Excel") {
|
var Server = MovePosManager.Server();
|
var search = MovePosManager.GetSearch();
|
Server.ToExcel(search, function (result) {
|
|
if (result.Code == 1000) {
|
var path = unescape(result.Message);
|
window.location.href = path;
|
} else {
|
$.jBox.info(result.Message, "提示");
|
}
|
});
|
} else if (command == "Refresh") {
|
MovePosManager.Refresh();
|
} else if (command == "Send") {
|
var list = MovePosManager.GetRows();
|
var para = [];
|
for (var i = 0; i < list.RowCount; i++)
|
{
|
if (list[i].AuditStatu != "已审核") {
|
$.jBox.tip("订单" + list[i].MDNo + "还未通过审核", "warn");
|
return false;
|
}
|
|
if (list[i].Statu != "等待下发") {
|
$.jBox.tip("订单" + list[i].MDNo + "还已下发执行", "warn");
|
return false;
|
}
|
para.push(list[i].MDNo);
|
|
}
|
var submit = function (v, h, f) {
|
|
var param = {}
|
param["Entity"] = JSON.stringify(para);
|
var Server = MovePosManager.Server();
|
Server.Send(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
MovePosManager.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
$.jBox.confirm("该操作下发选中订单所有数据,确定要下单吗?", "提示", submit);
|
} else if (command == "Close") {
|
var list = MovePosManager.GetRows();
|
var para = [];
|
for (var i = 0; i < list.RowCount; i++) {
|
|
if (list[i].Statu != "正在执行") {
|
$.jBox.tip("订单" + list[i].MDNo + "还已下发执行", "warn");
|
return false;
|
}
|
para.push(list[i].MDNo);
|
|
}
|
var submit = function (v, h, f) {
|
|
var param = {}
|
param["Entity"] = JSON.stringify(para);
|
var Server = MovePosManager.Server();
|
Server.Close(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
MovePosManager.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
$.jBox.confirm("该操作将会选中订单所有数据关单,确定要关单吗?", "提示", submit);
|
}
|
});
|
|
//搜索 高级搜索按钮
|
var searchBar = $("div[data-condition='search']");
|
searchBar.find("a[data-command='search']").click(function () {
|
MovePosManager.PageClick(1, 10);
|
});
|
|
|
//监听回车事件,用于扫描
|
searchBar.find("input[name='MDNo']").keydown(function (event) {
|
if (event.keyCode == 13) {
|
var value = $(this).val();
|
if (!git.IsEmpty(value)) {
|
MovePosManager.PageClick(1, 10);
|
setTimeout(function () {
|
searchBar.find("input[name='MDNo']").val("");
|
searchBar.find("input[name='MDNo']").focus();
|
}, 300);
|
}
|
}
|
});
|
|
//窗体加载获得焦点
|
searchBar.find("input[name='MDNo']").focus();
|
//加载默认数据
|
MovePosManager.PageClick(1, 10);
|
}
|
|
|
}
|
|
var MovePalno = {
|
Init: function () {
|
|
//初始化绑定事件
|
$("div.formbtn").find("button.btn").click(function (event) {
|
var command = $(this).attr("data-command");
|
if (command == "Save") {
|
var param = MovePalno.GetModel();
|
if (!param) {
|
return false;
|
}
|
var Server = MovePosManager.Server();
|
Server.Add(param, function (result) {
|
if (result.Code == 1) {
|
window.location.href = "/Business/MovePos/Index";
|
} else {
|
$.jBox.tip(result.Message);
|
}
|
});
|
|
} else if (command == "Cancel") {
|
window.location.href = "/Business/MovePos/Index";
|
}
|
});
|
MovePalno.AddProduct();
|
MovePalno.PageClick(1, 10);
|
},
|
PageClick: function (PageIndex, PageSize) {
|
var Server = MovePosManager.Server();
|
var search = MovePosManager.GetSearch();
|
search["PageIndex"] = PageIndex;
|
search["PageSize"] = PageSize;
|
Server.LoadPalno(search, function (result) {
|
MovePalno.SetTable(result);
|
});
|
},
|
SetTable: function (result) {
|
var cols = [
|
{
|
title: '物料编码', name: 'MatNo', width: 120, 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: 55, 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: 'Batch', 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;
|
}
|
},
|
{
|
title: '原货位', name: 'StartAddre', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
//var html = '';
|
//html += '<input type="text" name="StartAddre" class="m-wrap input-small" value="">';
|
//return html;
|
return data;
|
}
|
},
|
{
|
title: '目标货位', name: 'StopAddre', width: 150, align: 'center', lockWidth: false, renderer: function (data, item, rowIndex) {
|
//var html = '';
|
//html += '<input type="text" name="StopAddre" class="m-wrap input-small" value="">';
|
//return html;
|
return data;
|
}
|
},
|
{
|
title: '操作', name: 'Operation', width: 120, align: 'left', lockWidth: false, renderer: function (data, item, rowIndex) {
|
var html = "";
|
html += '<a class="delete" href="javascript:void(0)">删除</a> ';
|
return html;
|
}
|
},
|
];
|
|
if (this.TabGrid == undefined) {
|
this.TabGrid = $("#tabList").mmGrid({
|
cols: cols,
|
items: result.Result.List,
|
checkCol: true,
|
nowrap: true,
|
height: 250
|
});
|
MovePalno.BindTableEvent();
|
} else {
|
this.TabGrid.load(result.Result.List);
|
}
|
},
|
BindTableEvent: function () {
|
this.TabGrid.off("cellSelected").on("cellSelected", function (e, item, rowIndex, colIndex) {
|
if ($(e.target).is("a.delete")) {
|
var Palno = item.Palno;
|
var submit = function (v, h, f) {
|
if (v == "ok") {
|
var param = {};
|
param["Palno"] = Palno;
|
var Server = MovePosManager.Server();
|
Server.DeletePalno(param, function (result) {
|
if (result.Code == 1) {
|
var pageSize = $("#mypager").pager("GetPageSize");
|
MovePalno.PageClick(1, pageSize);
|
} else {
|
$.jBox.tip(result.Message, "warn");
|
}
|
});
|
}
|
}
|
$.jBox.confirm("确定要删除吗?", "提示", submit);
|
} else if ($(e.target).is("a.edit")) {
|
var MatNo = item.MatNo;
|
MovePalno.AddProduct(MatNo);
|
}
|
});
|
},
|
|
AddProduct: function (Addre) {
|
$("div.formbtn").find("button.btn[data-command='Add']").MoveProduct({
|
Mult: true,
|
TargetStore: $('select[name="StorageNum"]'),
|
TargetSup: $('input[name="SupNum"]'),
|
callBack: function (result) {
|
if (result != undefined && result.length > 0) {
|
var list = [];
|
for (var i = 0; i < result.length; i++) {
|
var item = {};
|
item["MDNo"] = "";
|
item["MatNo"] = result[i].MatNo;
|
item["MatName"] = result[i].MatName;
|
item["PackFormat"] = result[i].PackFormat;
|
item["UnitFrist"] = result[i].UnitFrist;
|
item["Quant"] = result[i].Quant;
|
item["Batch"] = result[i].Batch;
|
item["Palno"] = result[i].Palno;
|
|
item["StopAddre"] = result[i].StopAddre;
|
item["StartAddre"] = result[i].StartAddre;
|
|
|
list.push(JSON.stringify(item))
|
}
|
var param = {};
|
param["Entity"] = JSON.stringify(list);
|
var Server = MovePosManager.Server();
|
Server.AddPalno(param, function (msg) {
|
MovePalno.PageClick(1, 10);
|
});
|
}
|
}
|
});
|
},
|
GetModel: function () {
|
|
|
var MDNo = $("input[name='MDNo']").val();
|
var param = {};
|
|
param["MDNo"] = MDNo;
|
|
var entity = {};
|
|
entity["Entity"] = JSON.stringify(param);
|
|
return entity;
|
}
|
|
}
|