|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderReturnBarcode.aspx.cs" Inherits="TradeManageNew.OrderPost.OrderReturnBarcode" %>
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
<title> Order Return Barcode</title>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css?a=1" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
|
|
|
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
|
|
|
|
|
<script type="text/javascript" src="../Scripts/jquery-2.1.3.min.js"></script>
|
|
|
|
|
<script src="../Scripts/jquery.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/DataGrid.js?a=3445" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.bgiframe.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/Global.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.url.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/WindowLoad.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.cookies.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/ajaxfileupload.js" type="text/javascript"></script>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox2.1/source/jquery.fancybox.css?v=2.1.5"
|
|
|
|
|
media="screen" />
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox2.1/lib/jquery.mousewheel-3.0.6.pack.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox2.1/source/jquery.fancybox.js?v=2.1.5"></script>
|
|
|
|
|
|
|
|
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
|
|
<script type="text/javascript" src="../Scripts/highcharts.js"></script>
|
|
|
|
|
<script src="../Scripts/kindeditor/kindeditor-min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/jquery.qrcode.min.js" type="text/javascript"></script>
|
|
|
|
|
<script src="../Scripts/print.js" type="text/javascript"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Id = 0;
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
|
|
WindowLoadModel.Load();
|
|
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
CreateDataGrid();
|
|
|
|
|
ReadData();
|
|
|
|
|
|
|
|
|
|
var myCallBack = function (id) {
|
|
|
|
|
console.log('printing complete - first callback:' + id);
|
|
|
|
|
UpdateBarCode(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#btn_sch").bind("click", function () {
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [CommandName='cmdPrint']").live("click", function () {
|
|
|
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.code = model.Barcode;
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../PostGoodServiceNew.asmx/GetOrderReturnBarcodeImg",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
var byteArray = data.d;
|
|
|
|
|
if (byteArray == null) {
|
|
|
|
|
alert("Failed to generate barcode");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// 将字节数组转换为 Base64 编码的字符串
|
|
|
|
|
var base64String = btoa(String.fromCharCode.apply(null, byteArray));
|
|
|
|
|
// 创建一个 <img> 元素并设置其 src 属性为 Base64 编码的 Data URL
|
|
|
|
|
var img = document.createElement('img');
|
|
|
|
|
img.src = 'data:image/png;base64,' + base64String;
|
|
|
|
|
fopen2();
|
|
|
|
|
$('#itemSKU').text("ITEM NO: " + model.SKUAndQty);
|
|
|
|
|
$('#itemLocation').text("Location: " + model.LocationCode);
|
|
|
|
|
$('#returnBarCode').html(img);
|
|
|
|
|
$('#printCode').print({ deferred: $.Deferred().done(myCallBack(model.ID)) });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#" + datagrid1.TableID + " [CommandName='cmdEdit']").live("click", function () {
|
|
|
|
|
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
|
|
|
|
|
var model = datagrid1.Get_Model(RowIndex);
|
|
|
|
|
Id = model.ID;
|
|
|
|
|
$("#add_trackingCode").val(model.TrackingCode);
|
|
|
|
|
$("#add_trackingCode2").val(model.TrackingCode2);
|
|
|
|
|
$("#add_sku").val(model.SKUAndQty);
|
|
|
|
|
$("#add_location").val(model.LocationCode);
|
|
|
|
|
fopen();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function fopen() {
|
|
|
|
|
|
|
|
|
|
$.fancybox({
|
|
|
|
|
'width': '40%',
|
|
|
|
|
'height': '40%',
|
|
|
|
|
'autoScale': false,
|
|
|
|
|
'transitionIn': 'elastic',
|
|
|
|
|
'transitionOut': 'elastic',
|
|
|
|
|
'href': '#test',
|
|
|
|
|
'onComplete': function () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function fopen2() {
|
|
|
|
|
|
|
|
|
|
$.fancybox({
|
|
|
|
|
'width': '40%',
|
|
|
|
|
'height': '40%',
|
|
|
|
|
'autoScale': false,
|
|
|
|
|
'transitionIn': 'elastic',
|
|
|
|
|
'transitionOut': 'elastic',
|
|
|
|
|
'href': '#printCode',
|
|
|
|
|
'onComplete': function () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#region 初始化DataGrid
|
|
|
|
|
function CreateDataGrid() {
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "TrackingCode";
|
|
|
|
|
col.CellTemplate = "<span>{Bind TrackingCode}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "TrackingCode2";
|
|
|
|
|
col.CellTemplate = "<span>{Bind TrackingCode2}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "SKU";
|
|
|
|
|
col.CellTemplate = "<a>{Bind SKUAndQty}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "LocationCode";
|
|
|
|
|
col.CellTemplate = "<a>{Bind LocationCode}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "Barcode";
|
|
|
|
|
col.CellTemplate = "<a>{Bind Barcode}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "Scan User";
|
|
|
|
|
col.CellTemplate = "<a>{Bind UserName}</a>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "PrintState";
|
|
|
|
|
col.CellTemplate = "<span>{Bind PrintState}</span>";
|
|
|
|
|
col.CellFormatter = function (value) {
|
|
|
|
|
switch (value) {
|
|
|
|
|
case 0: return "No Print";
|
|
|
|
|
case 1: return "Printed";
|
|
|
|
|
default: return "No Print";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "CreateTime";
|
|
|
|
|
col.CellTemplate = "<span>{Bind CreateTime,yyyy-MM-dd HH:mm:ss}</span>";
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
col.HeaderText = "Options";
|
|
|
|
|
col.Width = "150px";
|
|
|
|
|
col.CellTemplate = "<input CommandName='cmdEdit' class='btnClass dgbtnEdit' type='button' value='Edit'>  <input CommandName='cmdPrint' class='btnClass dgbtnEdit' type='button' value='Print'>  <input onclick='DelCol(this)' class='btnClass dgbtnDel' type='button' value='Delete'></input>";
|
|
|
|
|
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
datagrid1.SetPageSize(200);
|
|
|
|
|
datagrid1.SetPageIndex(1);
|
|
|
|
|
|
|
|
|
|
datagrid1.SortExpression = "Id ";
|
|
|
|
|
datagrid1.ViewSortDirection = "desc";
|
|
|
|
|
datagrid1.IsFixHeader = true;
|
|
|
|
|
datagrid1.ShowIndexColumn = true;
|
|
|
|
|
datagrid1.AllowPaging = true;
|
|
|
|
|
datagrid1.AllowPaging2 = true;
|
|
|
|
|
datagrid1.ShowIndexColumn = true;
|
|
|
|
|
datagrid1.Width = "100%";
|
|
|
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
|
|
|
|
|
datagrid1.Init();
|
|
|
|
|
datagrid1.Sorting(function () {
|
|
|
|
|
|
|
|
|
|
ReadData();
|
|
|
|
|
});
|
|
|
|
|
datagrid1.add_PageIndexChanged(function () { ReadData(); });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
//#region 读取数据
|
|
|
|
|
function ReadData() {
|
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.search = $("#searchTxt").val();
|
|
|
|
|
param.searchType = $("#select-searchType").val();
|
|
|
|
|
param.printState = $("#select-state").val();
|
|
|
|
|
|
|
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../PostGoodServiceNew.asmx/GetOrderReturnBarcodeDatas",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
|
|
|
datagrid1.DataBind(data.d.DataSource);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
function Save() {
|
|
|
|
|
var md = new Object();
|
|
|
|
|
var param = new Object();
|
|
|
|
|
md.ID = Id;
|
|
|
|
|
if ($("#add_trackingCode").val() == "") {
|
|
|
|
|
alert("TrackingCode can not empty");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
md.TrackingCode = $("#add_trackingCode").val();
|
|
|
|
|
|
|
|
|
|
if ($("#add_trackingCode2").val() == "") {
|
|
|
|
|
alert("TrackingCode2 can not empty");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
md.TrackingCode2 = $("#add_trackingCode2").val();
|
|
|
|
|
|
|
|
|
|
if ($("#add_sku").val() == "") {
|
|
|
|
|
alert("SKU can not empty");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
md.SKUAndQty = $("#add_sku").val();
|
|
|
|
|
|
|
|
|
|
if ($("#add_location").val() == "") {
|
|
|
|
|
alert("LocationCode can not empty");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
md.LocationCode = $("#add_location").val();
|
|
|
|
|
|
|
|
|
|
param.md = md;
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../PostGoodServiceNew.asmx/SaveOrderReturnBarcode",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
if (data.d.Code == 0) {
|
|
|
|
|
alert(data.d.Message);
|
|
|
|
|
} else {
|
|
|
|
|
ReadData();
|
|
|
|
|
$.fancybox.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function DelCol(obj) {
|
|
|
|
|
if (window.confirm('Are you sure to delete it ?') == false) return;
|
|
|
|
|
var rowindex = $(obj).parent().parent().attr("index");
|
|
|
|
|
var param = new Object();
|
|
|
|
|
var model = datagrid1.Get_Model(rowindex);
|
|
|
|
|
|
|
|
|
|
param.id = model.ID;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../PostGoodServiceNew.asmx/DeleteOrderReturnBarcode",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d.Code == 0) {
|
|
|
|
|
alert(data.d.Message);
|
|
|
|
|
} else {
|
|
|
|
|
ReadData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function UpdateBarCode(id) {
|
|
|
|
|
var param = new Object();
|
|
|
|
|
param.id = id;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "../PostGoodServiceNew.asmx/UpdateOrderReturnBarcodePrint",
|
|
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data.d.Code == 0) {
|
|
|
|
|
alert(data.d.Message);
|
|
|
|
|
} else {
|
|
|
|
|
ReadData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<body class="headbody">
|
|
|
|
|
<div class="title_ico">
|
|
|
|
|
Ship Orders</div>
|
|
|
|
|
<div style="display: none">
|
|
|
|
|
|
|
|
|
|
<div id="test" title="BarCode" style="width:600px; height:400px;">
|
|
|
|
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>TrackingCode:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="add_trackingCode" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" />
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>TrackingCode2:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="add_trackingCode2" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>SKU:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="add_sku" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" />
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
|
|
<font color="red" style="font-weight: bolder">*</font>LocationCode:
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<input id="add_location" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="center" colspan="2">
|
|
|
|
|
<input
|
|
|
|
|
id="btn_Save" type="button" class="btnClass btnClassSave" value="Save" onclick="Save();" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="printCode" style="margin-top:15px;margin-left:5px;">
|
|
|
|
|
<div id="itemSKU" style="width:300px;line-height:12px; text-align:center; margin-bottom:2px;"></div>
|
|
|
|
|
<div id="returnBarCode" style="width:300px;height:100px;"></div>
|
|
|
|
|
<div id="itemLocation" style="width:300px;line-height:12px; text-align:center;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="imgcode"></div>
|
|
|
|
|
<table id="tb1" class="tableAll" style="width: 100%;">
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="f1" width="10%"><select id="select-searchType"><option value="1" selected>TrackingCode</option><option value="2">TrackingCode2</option><option value="3">SKU</option><option value="4">LocationCode</option><option value="5">Barcode</option></select></td>
|
|
|
|
|
<td><input id="searchTxt" class="editTextbox" style="width: 120px;" type="text" autocomplete="off" /></td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td class="f1" width="10%">PrintState:</td>
|
|
|
|
|
<td><select id="select-state"><option value="-1" selected>All</option><option value="0">No Print</option><option value="1">Printed</option></select></td>
|
|
|
|
|
<td><input id="btn_sch" class="btnClass btnClassFind" type="button" value="Search" /></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td valign="top" colspan="7">
|
|
|
|
|
|
|
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|