|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DD_OrderSpare.aspx.cs" Inherits="TradeManage.DingDan.DD_OrderSpare" %>
|
|
|
|
|
|
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
<head id="Head1">
|
|
|
<title>订单新增</title>
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/New.css" />
|
|
|
<link href="../themes/default/easyui.css" rel="stylesheet" type="text/css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/icon.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.css" />
|
|
|
<link rel="stylesheet" type="text/css" href="../themes/uploadify.css" />
|
|
|
<script src="../Scripts/MicrosoftAjax.js" type="text/javascript"></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" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DataPager.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DateBox.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 type="text/javascript" src="../Scripts/uploadify/jquery.uploadify.js"></script>
|
|
|
<script src="../Scripts/ajaxfileupload.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/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css"
|
|
|
media="screen" />
|
|
|
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
<script type="text/javascript" src="../Scripts/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
|
|
|
|
|
|
<script type="text/javascript" src="../Scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
|
|
|
<script src="../Scripts/Global.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/JSLINQ.js" type="text/javascript"></script>
|
|
|
<script type="text/javascript">
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
|
|
|
var OrderId = 0;
|
|
|
var Index = 0;
|
|
|
var Title = "发货扫描";
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
$(document).ready(function () {
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
WindowLoadModel.Load();
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
// CheckIsInstall();
|
|
|
OrderId = $.url.param("OrderId");
|
|
|
if (OrderId == undefined) {
|
|
|
OrderId = 0;
|
|
|
}
|
|
|
Title = $.url.param("Title");
|
|
|
if (Title == undefined) {
|
|
|
Title = "发货扫描";
|
|
|
}
|
|
|
CreateDataGrid1();
|
|
|
GetExpressType();
|
|
|
$("#btn_Cancel").bind("click", $.fancybox.close);
|
|
|
$("#selectwl").bind("change", function () {
|
|
|
|
|
|
GetExpress();
|
|
|
|
|
|
});
|
|
|
$("#txtNum").MaskedTextBox();
|
|
|
GetExpress();
|
|
|
$(".addopen").live("click", function () {
|
|
|
Index = $(this).attr("no");
|
|
|
fopen();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
$(".a_code").live("click", function () {
|
|
|
Index = $(this).attr("no");
|
|
|
GetOrderTrackCode();
|
|
|
});
|
|
|
if (OrderId > 0) {
|
|
|
GetOrderModel();
|
|
|
|
|
|
}
|
|
|
$("#cmdBack").bind("click", function () {
|
|
|
//history.back(-1);
|
|
|
//window.parent.addTab("11111", "DingDan/DD_OrderLook.aspx", true);
|
|
|
window.parent.CloseTab("订单查看", Title);
|
|
|
});
|
|
|
});
|
|
|
function Print() {
|
|
|
var param = new Object();
|
|
|
param.OrderId = OrderId;
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/GetOrderPrintModel",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
LODOP.PRINT_INIT("ExpressOrder");
|
|
|
LODOP.SET_PRINT_PAGESIZE(1, "100mm", "100mm", "CreateCustomPage");
|
|
|
|
|
|
$(data.d).each(function (i) {
|
|
|
var Model = this;
|
|
|
if (i > 0) LODOP.NewPage();
|
|
|
if (Model.ExpressType == 1) {
|
|
|
//EUB
|
|
|
Print_EUB(Model, Model.ExpressService, Model.ListPrintTemplate[0]);
|
|
|
LODOP.NewPage();
|
|
|
Print_EUB2(Model, Model.ExpressService + "_Index_1", Model.ListPrintTemplate[1]);
|
|
|
}
|
|
|
if (Model.ExpressType == 2) {
|
|
|
//宁波小包
|
|
|
Print_NB(Model, Model.ExpressService, Model.ListPrintTemplate[0]);
|
|
|
}
|
|
|
if (Model.ExpressType == 3) {
|
|
|
//甬沪小包
|
|
|
Print_YH(Model, Model.ExpressService, Model.ListPrintTemplate[0]);
|
|
|
}
|
|
|
if (Model.ExpressType == 4) {
|
|
|
//上海小包
|
|
|
Print_SH(Model, Model.ExpressService, Model.ListPrintTemplate[0]);
|
|
|
}
|
|
|
if (Model.ExpressType == 5) {
|
|
|
//上海平邮
|
|
|
}
|
|
|
if (Model.ExpressType == 6) {
|
|
|
//俄邮宝
|
|
|
Print_eEUB(Model, Model.ExpressService, Model.ListPrintTemplate[0]);
|
|
|
LODOP.NewPage();
|
|
|
Print_eEUB2(Model, Model.ExpressService + "_Index_1", Model.ListPrintTemplate[1]);
|
|
|
}
|
|
|
if (Model.ExpressType == 7) {
|
|
|
//顺风
|
|
|
Print_SF(Model, Model.ExpressService, Model.ListPrintTemplate[0]);
|
|
|
}
|
|
|
if (Model.ExpressType == 8) {
|
|
|
//比利时邮政
|
|
|
Print_BLSYZ(Model, Model.ExpressService, Model.ListPrintTemplate[0]);
|
|
|
}
|
|
|
if (Model.ExpressType == 9) {
|
|
|
//宁波平邮
|
|
|
Print_NBPY(Model, Model.ExpressService, Model.ListPrintTemplate[0]);
|
|
|
}
|
|
|
});
|
|
|
LODOP.PREVIEWB();
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//#region 检测是否安装过打印机控件
|
|
|
function CheckIsInstall() {
|
|
|
try {
|
|
|
LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
|
|
|
if (LODOP != null) { return true; }
|
|
|
else { return false; }
|
|
|
} catch (err) {
|
|
|
//alert("Error:本机未安装或需要升级!");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
//#region 读取打印模板
|
|
|
function ReadPrintTemplate(name, fileName) {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
url: "../PrintTemplate/" + fileName,
|
|
|
contentType: "",
|
|
|
dataType: "",
|
|
|
async: false,
|
|
|
dataFilter: function (data, dataType) {
|
|
|
return data;
|
|
|
},
|
|
|
success: function (data) {
|
|
|
$("#DataGrid1").data(name, data);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 获取模板
|
|
|
function GetTemplate(name, fileName) {
|
|
|
var Template2 = $("#DataGrid1").data(name);
|
|
|
if (Template2 == undefined) {
|
|
|
ReadPrintTemplate(name, fileName);
|
|
|
Template2 = $("#DataGrid1").data(name);
|
|
|
}
|
|
|
var Template = $(Template2).clone();
|
|
|
ReplaceImg(Template);
|
|
|
return Template;
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 替换图片
|
|
|
function ReplaceImg(Template) {
|
|
|
|
|
|
}
|
|
|
//#region EUB打印
|
|
|
function Print_EUB(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtAreaSerial", Template).html(model.AreaSerial);
|
|
|
$("#txtSendPerson", Template).html("FROM:" + model.SendPerson);
|
|
|
$("#txtSendAddress", Template).html(model.SendAddress);
|
|
|
$("#txtSendPhone", Template).html("PHONE:" + model.SendPhone);
|
|
|
$("#txtRevPerson", Template).html("SHIP TO:" + model.RevPerson);
|
|
|
$("#txtRevAddress", Template).html(model.RevAddress);
|
|
|
$("#txtRevPhone", Template).html("PHONE:" + model.RevPhone);
|
|
|
$("#txtCountGoodsNum", Template).html(model.CountGoodsNum);
|
|
|
$("#txtCountGoodsWeight", Template).html(model.CountGoodsWeight);
|
|
|
$("#txtCountGoodsPrice", Template).html(model.CountGoodsPrice);
|
|
|
var html = new Sys.StringBuilder();
|
|
|
$(model.ListModel).each(function (ii) {
|
|
|
if (ii == 7) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:15px;'>" + (ii + 1) + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:28px;' >...</td>");
|
|
|
html.append("<td style='text-align:left;vertical-align:top;width:163px;' >...</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:32px;' >...</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:42px;' >...</td>");
|
|
|
html.append("<td style='text-align:left;vertical-align:top;width:65px;' >...</td>");
|
|
|
html.append("</tr>");
|
|
|
}
|
|
|
else if (ii < 7) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:15px;'>" + (ii + 1) + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:28px;' >" + this.GoodsNum + "</td>");
|
|
|
html.append("<td style='text-align:left;vertical-align:top;width:163px;' >" + this.GoodsName + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:32px;' >" + this.GoodsWeight + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:42px;' >" + this.GoodsPrice + "</td>");
|
|
|
html.append("<td style='text-align:left;vertical-align:top;width:65px;' >" + this.GoodsOrigin + "</td>");
|
|
|
html.append("</tr>");
|
|
|
}
|
|
|
});
|
|
|
$("#tb_Detail", Template).html(html.toString());
|
|
|
//$("#div1").html(Template.prop("outerHTML"));
|
|
|
|
|
|
//LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);//缩放模式
|
|
|
ReplaceImg(Template);
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_LINE(169, 10, 170, 177, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(180, 10, 181, 177, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(337, 29, 190, 30, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(189, 52, 336, 53, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(191, 230, 336, 231, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(191, 258, 336, 259, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(191, 299, 336, 300, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(85, 179, 86, 359, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(189, 178, 84, 179, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(191, 10, 190, 390, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(204, 10, 205, 390, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(320, 10, 319, 390, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(337, 10, 336, 390, 0, 1);
|
|
|
LODOP.ADD_PRINT_RECT(51, 137, 29, 30, 0, 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(6, 23, 100, 30, "<img src='../PrintImage/logo.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);// 1可变形缩放2不可变形缩放
|
|
|
LODOP.ADD_PRINT_BARCODE(9, 170, 197, 60, "128Auto", model.BarCode);
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region EUB2打印
|
|
|
function Print_EUB2(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtAreaSerial", Template).html(model.AreaSerial);
|
|
|
$("#txtSendPerson", Template).html(model.SendPerson);
|
|
|
$("#txtSendAddress", Template).html(model.SendAddress);
|
|
|
$("#txtRevPerson", Template).html(model.RevPerson);
|
|
|
$("#txtRevAddress", Template).html(model.RevAddress);
|
|
|
|
|
|
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_LINE(117, 26, 116, 366, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(197, 26, 196, 366, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(270, 26, 271, 366, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(50, 118, 49, 238, 0, 1);
|
|
|
LODOP.ADD_PRINT_RECT(37, 264, 66, 43, 0, 1);
|
|
|
LODOP.ADD_PRINT_RECT(38, 25, 57, 64, 0, 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(19, 126, 100, 30, "<img src='../PrintImage/logo.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(52, 110, 126, 38, "<img src='../PrintImage/logo2.jpg' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(278, 270, 15, 15, "<img src='../PrintImage/R.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(129, 221, 110, 54, "<img src='" + model.RevZipBarCode + "' />");
|
|
|
//LODOP.SET_PRINT_STYLEA(0, "Stretch", 2);//(可变形)扩展缩放模式
|
|
|
LODOP.ADD_PRINT_BARCODE(298, 38, 299, 66, "128Auto", model.BarCode);
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 宁波小包打印
|
|
|
function Print_NB(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtAreaSerial", Template).html(model.AreaSerial);
|
|
|
$("#txtSendPerson", Template).html("FROM:" + model.SendPerson);
|
|
|
$("#txtSendAddress", Template).html(model.SendAddress);
|
|
|
$("#txtSendPhone", Template).html("PHONE:" + model.SendPhone);
|
|
|
$("#txtOrderCode", Template).html("Fancy:" + model.OrderCode);
|
|
|
$("#txtRevPerson", Template).html("SHIP TO:" + model.RevPerson);
|
|
|
$("#txtRevAddress", Template).html(model.RevAddress);
|
|
|
$("#txtRevPhone", Template).html("PHONE:" + model.RevPhone);
|
|
|
$("#txtCountry", Template).html(model.CountryCode);
|
|
|
$("#txtRevCountry", Template).html(model.CountryName);
|
|
|
$("#txtRevZip", Template).html("zip:" + model.RevZip);
|
|
|
$("#txtCountGoodsNum", Template).html(model.CountGoodsNum);
|
|
|
$("#txtCountGoodsWeight", Template).html(model.CountGoodsWeight);
|
|
|
$("#txtCountGoodsPrice", Template).html(model.CountGoodsPrice);
|
|
|
$("#txtShopName", Template).html(model.ShopName);
|
|
|
var html = new Sys.StringBuilder();
|
|
|
$(model.ListModel).each(function (ii) {
|
|
|
if (ii == 7) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 218px;height: 17px;' >...</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 50px;height: 17px;' >...</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;height: 17px;' >...</td>");
|
|
|
html.append("</tr>");
|
|
|
}
|
|
|
else if (ii < 7) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 218px;height: 17px;' >" + this.GoodsSimpleName + "【" + this.GoodsNum + "件】</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 50px;height: 17px;' >" + this.GoodsWeight + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;height: 17px;' >" + this.GoodsPrice + "</td>");
|
|
|
html.append("</tr>");
|
|
|
}
|
|
|
});
|
|
|
$("#tb_Detail", Template).html(html.toString());
|
|
|
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_BARCODE(10, 155, 210, 60, "128Auto", model.BarCode);
|
|
|
LODOP.ADD_PRINT_IMAGE(5, 30, 100, 30, "<img src='../PrintImage/logo.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_LINE(79, 150, 78, 365, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(149, 149, 78, 150, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(150, 10, 149, 149, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(170, 10, 169, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(184, 10, 183, 345, 0, 1);
|
|
|
|
|
|
LODOP.ADD_PRINT_LINE(316, 10, 315, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(335, 10, 334, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(334, 228, 169, 229, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(334, 288, 169, 289, 0, 1);
|
|
|
LODOP.ADD_PRINT_TEXT(243, 375, 51, 30, "宁波");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontName", "Arial");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Angle", 270);
|
|
|
LODOP.ADD_PRINT_LINE(238, 352, 237, 377, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(292, 352, 291, 377, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(237, 351, 292, 352, 0, 1);
|
|
|
LODOP.ADD_PRINT_RECT(42, 72, 30, 20, 0, 1);
|
|
|
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 甬沪小包打印
|
|
|
function Print_YH(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtAreaSerial", Template).html(model.AreaSerial);
|
|
|
$("#txtSendPerson", Template).html("FROM:" + model.SendPerson);
|
|
|
$("#txtSendAddress", Template).html(model.SendAddress);
|
|
|
$("#txtSendPhone", Template).html("PHONE:" + model.SendPhone);
|
|
|
$("#txtOrderCode", Template).html("Fancy:" + model.OrderCode);
|
|
|
$("#txtRevPerson", Template).html("SHIP TO:" + model.RevPerson);
|
|
|
$("#txtRevAddress", Template).html(model.RevAddress);
|
|
|
$("#txtRevPhone", Template).html("PHONE:" + model.RevPhone);
|
|
|
$("#txtCountry", Template).html(model.CountryCode);
|
|
|
$("#txtRevCountry", Template).html(model.CountryName);
|
|
|
$("#txtRevZip", Template).html("zip:" + model.RevZip);
|
|
|
$("#txtCountGoodsNum", Template).html(model.CountGoodsNum);
|
|
|
$("#txtCountGoodsWeight", Template).html(model.CountGoodsWeight);
|
|
|
$("#txtShopName", Template).html(model.ShopName);
|
|
|
$("#txtRevZip", Template).html("zip:" + model.RevZip);
|
|
|
var html = new Sys.StringBuilder();
|
|
|
$(model.ListModel).each(function (ii) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 218px;' >" + this.GoodsSimpleName + "【" + this.GoodsNum + "件】</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 50px;' >" + this.GoodsWeight + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;' >" + this.GoodsPrice + "</td>");
|
|
|
html.append("</tr>");
|
|
|
|
|
|
});
|
|
|
$("#tb_Detail", Template).html(html.toString());
|
|
|
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_BARCODE(10, 155, 210, 60, "128Auto", model.BarCode);
|
|
|
LODOP.ADD_PRINT_IMAGE(5, 30, 100, 30, "<img src='../PrintImage/logo.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_LINE(79, 150, 78, 365, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(149, 149, 78, 150, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(150, 10, 149, 149, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(170, 10, 169, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(184, 10, 183, 345, 0, 1);
|
|
|
|
|
|
LODOP.ADD_PRINT_LINE(316, 10, 315, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(335, 10, 334, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(334, 228, 169, 229, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(334, 288, 169, 289, 0, 1);
|
|
|
LODOP.ADD_PRINT_TEXT(243, 375, 51, 30, "甬沪");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontName", "Arial");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Angle", 270);
|
|
|
LODOP.ADD_PRINT_LINE(238, 352, 237, 377, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(292, 352, 291, 377, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(237, 351, 292, 352, 0, 1);
|
|
|
LODOP.ADD_PRINT_RECT(42, 72, 30, 20, 0, 1);
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 上海小包打印
|
|
|
function Print_SH(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtAreaSerial", Template).html(model.AreaSerial);
|
|
|
$("#txtSendPerson", Template).html("FROM:" + model.SendPerson);
|
|
|
$("#txtSendAddress", Template).html(model.SendAddress);
|
|
|
$("#txtSendPhone", Template).html("PHONE:" + model.SendPhone);
|
|
|
$("#txtOrderCode", Template).html("Fancy:" + model.OrderCode);
|
|
|
$("#txtRevPerson", Template).html("SHIP TO:" + model.RevPerson);
|
|
|
$("#txtRevAddress", Template).html(model.RevAddress);
|
|
|
$("#txtRevPhone", Template).html("PHONE:" + model.RevPhone);
|
|
|
$("#txtCountry", Template).html(model.CountryCode);
|
|
|
$("#txtRevCountry", Template).html(model.CountryName);
|
|
|
$("#txtRevZip", Template).html("zip:" + model.RevZip);
|
|
|
$("#txtCountGoodsNum", Template).html(model.CountGoodsNum);
|
|
|
$("#txtCountGoodsWeight", Template).html(model.CountGoodsWeight);
|
|
|
$("#txtCountGoodsPrice", Template).html(model.CountGoodsPrice);
|
|
|
$("#txtShopName", Template).html(model.ShopName);
|
|
|
var html = new Sys.StringBuilder();
|
|
|
$(model.ListModel).each(function (ii) {
|
|
|
if (ii == 7) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 218px;height: 17px;' >...</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 50px;height: 17px;' >...</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;height: 17px;' >...</td>");
|
|
|
html.append("</tr>");
|
|
|
}
|
|
|
else if (ii < 7) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 218px;height: 17px;' >" + this.GoodsSimpleName + "【" + this.GoodsNum + "件】</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;width: 50px;height: 17px;' >" + this.GoodsWeight + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:middle;height: 17px;' >" + this.GoodsPrice + "</td>");
|
|
|
html.append("</tr>");
|
|
|
}
|
|
|
});
|
|
|
$("#tb_Detail", Template).html(html.toString());
|
|
|
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_BARCODE(10, 155, 210, 60, "128Auto", model.BarCode);
|
|
|
LODOP.ADD_PRINT_IMAGE(5, 30, 100, 30, "<img src='../PrintImage/logo.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_LINE(79, 150, 78, 365, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(149, 149, 78, 150, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(150, 10, 149, 149, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(170, 10, 169, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(184, 10, 183, 345, 0, 1);
|
|
|
|
|
|
LODOP.ADD_PRINT_LINE(316, 10, 315, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(335, 10, 334, 345, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(334, 228, 169, 229, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(334, 288, 169, 289, 0, 1);
|
|
|
LODOP.ADD_PRINT_TEXT(243, 375, 51, 30, "上海");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontName", "Arial");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Angle", 270);
|
|
|
LODOP.ADD_PRINT_LINE(238, 352, 237, 377, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(292, 352, 291, 377, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(237, 351, 292, 352, 0, 1);
|
|
|
LODOP.ADD_PRINT_RECT(42, 72, 30, 20, 0, 1);
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 俄邮宝打印
|
|
|
function Print_eEUB(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtAreaSerial", Template).html(model.AreaSerial);
|
|
|
$("#txtSendPerson", Template).html("FROM:" + model.SendPerson);
|
|
|
$("#txtSendAddress", Template).html(model.SendAddress);
|
|
|
$("#txtSendPhone", Template).html("PHONE:" + model.SendPhone);
|
|
|
$("#txtSendZip", Template).html("CHINA:" + model.SendZip);
|
|
|
$("#txtRevPerson", Template).html("SHIP TO:" + model.RevPerson);
|
|
|
$("#txtRevAddress", Template).html(model.RevAddress);
|
|
|
$("#txtRevPhone", Template).html("PHONE:" + model.RevPhone);
|
|
|
$("#txtRevCountry", Template).html(model.RevCountry);
|
|
|
$("#txtRevZip", Template).html("zip:" + model.RevZip);
|
|
|
$("#txtCountGoodsNum", Template).html(model.CountGoodsNum);
|
|
|
$("#txtCountGoodsWeight", Template).html(model.CountGoodsWeight);
|
|
|
$("#txtCountGoodsPrice", Template).html(model.CountGoodsPrice);
|
|
|
var html = new Sys.StringBuilder();
|
|
|
$(model.ListModel).each(function (ii) {
|
|
|
if (ii == 7) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:15px;'>" + (ii + 1) + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:28px;' >...</td>");
|
|
|
html.append("<td style='text-align:left;vertical-align:top;width:163px;' >...</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:32px;' >...</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:42px;' >...</td>");
|
|
|
html.append("<td style='text-align:left;vertical-align:top;width:65px;' >...</td>");
|
|
|
html.append("</tr>");
|
|
|
}
|
|
|
else if (ii < 7) {
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:15px;'>" + (ii + 1) + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:28px;' >" + this.GoodsNum + "</td>");
|
|
|
html.append("<td style='text-align:left;vertical-align:top;width:163px;' >" + this.GoodsName + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:32px;' >" + this.GoodsWeight + "</td>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:42px;' >" + this.GoodsPrice + "</td>");
|
|
|
html.append("<td style='text-align:left;vertical-align:top;width:65px;' >" + this.GoodsOrigin + "</td>");
|
|
|
html.append("</tr>");
|
|
|
}
|
|
|
});
|
|
|
$("#tb_Detail", Template).html(html.toString());
|
|
|
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_BARCODE(9, 170, 197, 60, "128Auto", model.BarCode);
|
|
|
LODOP.ADD_PRINT_IMAGE(19, 30, 100, 30, "<img src='../PrintImage/logo.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_LINE(79, 178, 78, 368, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(193, 177, 78, 178, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(170, 10, 169, 177, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(181, 10, 180, 177, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(194, 10, 193, 370, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(207, 10, 206, 370, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(322, 10, 321, 370, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(338, 10, 337, 370, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(337, 222, 193, 223, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(337, 259, 193, 260, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(337, 301, 193, 302, 0, 1);
|
|
|
LODOP.ADD_PRINT_RECT(45, 93, 59, 23, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(67, 122, 45, 123, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(337, 55, 193, 56, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(337, 32, 193, 33, 0, 1);
|
|
|
|
|
|
//LODOP.ADD_PRINT_TEXT(46, 96, 21, 20, "RU");
|
|
|
//LODOP.ADD_PRINT_TEXT(47, 123, 27, 20, "5");
|
|
|
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 俄邮宝2打印
|
|
|
function Print_eEUB2(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtAreaSerial", Template).html(model.AreaSerial);
|
|
|
$("#txtSendPerson", Template).html(model.SendPerson);
|
|
|
$("#txtSendAddress", Template).html(model.SendAddress);
|
|
|
$("#txtSendZip", Template).html("CHINA:" + model.SendZip);
|
|
|
$("#txtRevPerson", Template).html(model.RevPerson);
|
|
|
$("#txtRevAddress", Template).html(model.RevAddress);
|
|
|
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_BARCODE(298, 83, 230, 66, "128Auto", model.BarCode);
|
|
|
LODOP.ADD_PRINT_IMAGE(64, 153, 100, 30, "<img src='../PrintImage/logo.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(124, 292, 65, 70, "<img src='../PrintImage/logo4.jpg' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(297, 316, 48, 65, "<img src='../PrintImage/logo5.jpg' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(293, 20, 48, 70, "<img src='../PrintImage/logo6.jpg' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
|
|
|
LODOP.ADD_PRINT_RECT(24, 31, 100, 60, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(119, 10, 118, 370, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(201, 10, 200, 370, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(277, 10, 276, 370, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(62, 155, 61, 255, 0, 1);
|
|
|
}
|
|
|
function Print_NBPY(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
|
|
|
$("#txtCountry", Template).html(model.CountryCode);
|
|
|
$("#txtAreaSerial", Template).html(model.CountryName + " " + model.AreaSerial);
|
|
|
$("#txtSendPerson", Template).html("FROM:" + model.SendPerson);
|
|
|
$("#txtSendAddress", Template).html(model.SendAddress);
|
|
|
$("#txtSendPhone", Template).html("Tel:" + model.SendPhone);
|
|
|
$("#txtRevPerson", Template).html("PHONE:" + model.SendPhone + " Tel:" + model.RevMobile + " zip:" + model.SendZip);
|
|
|
$("#txtRevAddress", Template).html("SHIP TO:" + model.RevPerson);
|
|
|
// $("#txtRevPhone", Template).html("PHONE:" + model.RevPhone);
|
|
|
$("#txtCountGoodsNum", Template).html(model.CountGoodsNum);
|
|
|
$("#txtCountGoodsWeight", Template).html(model.CountGoodsWeight);
|
|
|
$("#txtCountGoodsWeight1", Template).html(model.CountGoodsWeight);
|
|
|
$("#txtCountGoodsPrice", Template).html(model.CountGoodsPrice);
|
|
|
$("#txtCountGoodsPrice1", Template).html(model.CountGoodsPrice);
|
|
|
var html = new Sys.StringBuilder();
|
|
|
html.append("<tr>");
|
|
|
html.append("<td style='text-align:center;vertical-align:top;width:350px;'>");
|
|
|
$(model.ListModel).each(function (ii) {
|
|
|
|
|
|
html.append("" + this.GoodsName + "【" + this.GoodsNum + "件】<br/>");
|
|
|
|
|
|
|
|
|
});
|
|
|
html.append("</td></tr>");
|
|
|
$("#tb_Detail", Template).html(html.toString());
|
|
|
//$("#div1").html(Template.prop("outerHTML"));
|
|
|
|
|
|
//LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);//缩放模式
|
|
|
ReplaceImg(Template);
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_LINE(23, 145, 22, 350, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(101, 143, 23, 144, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(70, 10, 69, 140, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(85, 10, 84, 140, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(104, 10, 103, 360, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(166, 10, 165, 360, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(182, 10, 181, 360, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(196, 10, 195, 360, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(323, 10, 322, 360, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(338, 10, 337, 360, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(196, 232, 164, 233, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(196, 278, 164, 279, 0, 1);
|
|
|
LODOP.ADD_PRINT_BARCODE(107, 183, 200, 55, "128Auto", model.BarCode);
|
|
|
LODOP.ADD_PRINT_IMAGE(6, 23, 100, 30, "<img src='../PrintImage/logo.png' />");
|
|
|
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);// 1可变形缩放2不可变形缩放
|
|
|
//LODOP.ADD_PRINT_BARCODE(9, 170, 197, 60, "128Auto", model.BarCode);
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 顺丰打印
|
|
|
function Print_SF(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtSendPerson", Template).html(model.SendPerson);
|
|
|
var CurrentDate = new Date();
|
|
|
$("#txtSendDate", Template).text(CurrentDate.localeFormat("yyyy-MM-dd"));
|
|
|
$("#txtCountGoodsNum", Template).html(model.CountGoodsNum);
|
|
|
$("#txtCountGoodsWeight", Template).html(model.CountGoodsWeight);
|
|
|
$("#txtCountGoodsPrice", Template).html(model.CountGoodsPrice);
|
|
|
$("#txtGoodsWeight", Template).html(model.ListModel[0].GoodsWeight);
|
|
|
$("#txtGoodsPrice", Template).html(model.ListModel[0].GoodsPrice);
|
|
|
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_BARCODE(314, 14, 190, 49, "128Auto", model.BarCode);
|
|
|
LODOP.ADD_PRINT_LINE(47, 5, 46, 375, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(65, 5, 64, 375, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(102, 5, 101, 375, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(168, 5, 167, 375, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(230, 5, 229, 375, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(309, 5, 308, 375, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(101, 5, 64, 6, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(102, 30, 64, 31, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(102, 139, 64, 140, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(102, 163, 64, 164, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(84, 6, 83, 30, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(84, 140, 83, 163, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(229, 229, 102, 230, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(229, 315, 102, 316, 0, 1);
|
|
|
LODOP.ADD_PRINT_LINE(388, 300, 308, 301, 0, 1);
|
|
|
|
|
|
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 比利时邮政打印
|
|
|
function Print_BLSYZ(model, name, fileName) {
|
|
|
var Template = GetTemplate(name, fileName);
|
|
|
$("#txtOrderCode", Template).html("Order Number:" + model.OrderCode);
|
|
|
$("#txtGoodsSku", Template).html("SKU:" + model.ListModel[0].GoodsSku);
|
|
|
$("#txtSendAddress", Template).html("FROM:" + model.SendAddress);
|
|
|
$("#txtRevPerson", Template).html(model.RevPerson);
|
|
|
$("#txtRevAddress", Template).html(model.RevAddress);
|
|
|
$("#txtRevPhone", Template).html(model.RevPhone);
|
|
|
|
|
|
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", Template.prop("outerHTML"));
|
|
|
LODOP.ADD_PRINT_BARCODE(252, 47, 282, 66, "128Auto", model.BarCode);
|
|
|
// LODOP.ADD_PRINT_BARCODE(252, 47, 282, 66, "128Auto", "LN729029398CN");
|
|
|
LODOP.ADD_PRINT_RECT(31, 165, 206, 80, 0, 1);
|
|
|
LODOP.ADD_PRINT_IMAGE(32, 174, 85, 27, "<img src='../PrintImage/logo7.png' />");
|
|
|
LODOP.ADD_PRINT_IMAGE(32, 290, 80, 27, "<img src='../PrintImage/logo8.png' />");
|
|
|
}
|
|
|
//#endregion
|
|
|
|
|
|
var SpareList = new Array();
|
|
|
function AddBGGoods()
|
|
|
{
|
|
|
datagrid1.UpdateDataSource();
|
|
|
var selectlist = datagrid1.GetSelectListModel();
|
|
|
if (selectlist == null || selectlist.length == 0) {
|
|
|
alert("请选择货物");
|
|
|
return;
|
|
|
}
|
|
|
var error = "";
|
|
|
|
|
|
$(selectlist).each(function () {
|
|
|
if(this.SpareNum==null||this.SpareNum==0)
|
|
|
{
|
|
|
error += this.GoodsSKU + "拆分数量没填";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
if (error!="") {
|
|
|
alert(error);
|
|
|
return;
|
|
|
}
|
|
|
$(selectlist).each(function () {
|
|
|
var did = this.DetailId;
|
|
|
var flag = false;
|
|
|
var snum=this.SpareNum;
|
|
|
$(SpareList).each(function () {
|
|
|
if (this.Index==Index&&did == this.DetailId) {
|
|
|
flag = true;
|
|
|
this.GoodsNum = parseInt(this.GoodsNum) + parseInt(snum);
|
|
|
this.SpareNum = this.GoodsNum;
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
if (flag == false)
|
|
|
{
|
|
|
var md = new Object();
|
|
|
md.Id = this.Id;
|
|
|
md.DetailId = this.DetailId;
|
|
|
md.GoodsName = this.GoodsName;
|
|
|
md.GoodsSKU = this.GoodsSKU;
|
|
|
md.GoodsNum = this.SpareNum;
|
|
|
md.Index = Index;
|
|
|
md.SpareNum = this.SpareNum;
|
|
|
Array.add(SpareList, md);
|
|
|
}
|
|
|
|
|
|
if (this.SpareNum == this.GoodsNum) {
|
|
|
Array.remove(GoodsList, this);
|
|
|
}
|
|
|
else {
|
|
|
this.GoodsNum =parseInt(this.GoodsNum) - parseInt(snum);
|
|
|
this.SpareNum = this.GoodsNum;
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
BindBg();
|
|
|
$.fancybox.close();
|
|
|
}
|
|
|
function BindBg()
|
|
|
{
|
|
|
$("#tbhw" + Index).html("<tr class='HeaderStyle'><th width='25%'>货物名称</th><th width='25%'>SKU</th><th width='25%'>数量</th><th width='25%'>操作</th></tr>");
|
|
|
$(SpareList).each(function ()
|
|
|
{
|
|
|
if (this.Index == Index)
|
|
|
{
|
|
|
$("#tbhw" + Index).append("<tr class='DataGridRowStyle'><td>" + this.GoodsName + "</td><td>" + this.GoodsSKU + "</td><td>" + this.GoodsNum + "</td><td><input onclick='DelCol(" + this.Index + "," + this.DetailId + ");' class='btnClass dgbtnDel' type='button' value='删除'></input></td></tr>");
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
function DelCol(Idx, Id)
|
|
|
{
|
|
|
Index = Idx;
|
|
|
var Md = new Object;
|
|
|
$(SpareList).each(function ()
|
|
|
{
|
|
|
if (this.Index == Idx&&this.DetailId==Id)
|
|
|
{
|
|
|
Md = this;
|
|
|
Array.remove(SpareList,this);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
BindBg();
|
|
|
var flag = false;
|
|
|
$(GoodsList).each(function () {
|
|
|
if (this.DetailId == Id) {
|
|
|
flag = true;
|
|
|
this.GoodsNum = parseInt(this.GoodsNum) + parseInt(Md.GoodsNum);
|
|
|
this.SpareNum = this.GoodsNum;
|
|
|
}
|
|
|
|
|
|
});
|
|
|
if (flag == false) {
|
|
|
|
|
|
Array.add(GoodsList, Md);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
var TrackCode1;
|
|
|
function GetOrderModel() {
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
param.OrderId = OrderId;
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/GetOrderModel",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
if (data.d.IsSpare == 1)
|
|
|
{
|
|
|
|
|
|
alert("该订单已经拆分过了");
|
|
|
window.location.href("DD_DoneOrderList.aspx");
|
|
|
|
|
|
}
|
|
|
$("#txtPlatOrderCode").html(data.d.PlatOrderCode);
|
|
|
$("#txtPost").val(data.d.Post);
|
|
|
|
|
|
|
|
|
|
|
|
TrackCode1=data.d.TrackCode;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
var GoodsList = new Array();
|
|
|
function GetOrderGoods() {
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
param.OrderId = OrderId;
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/GetOrderGoodsDetail",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
GoodsList = data.d;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function fopen() {
|
|
|
|
|
|
$.fancybox({
|
|
|
'width': '40%',
|
|
|
'height': '40%',
|
|
|
'autoScale': false,
|
|
|
'transitionIn': 'elastic',
|
|
|
'transitionOut': 'elastic',
|
|
|
'href': '#test',
|
|
|
'onComplete': function () {
|
|
|
|
|
|
datagrid1.DataBind(GoodsList);
|
|
|
$("input[ColName='SpareNum']").MaskedTextBox();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
function AddBG() {
|
|
|
if ($("#txtNum").val() == "") {
|
|
|
alert("请填写分拆包裹数量");
|
|
|
return;
|
|
|
}
|
|
|
if ( parseInt($("#txtNum").val())<=1) {
|
|
|
alert("请填写分拆包裹数量必须大于1");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#a_num").html() != "" && $("#a_num").html() != $("#txtNum").val())
|
|
|
{
|
|
|
if (window.confirm('分拆包裹数量改变,重新选择分配货物,确定要改变吗?') == false) return;
|
|
|
|
|
|
}
|
|
|
GetOrderGoods();
|
|
|
SpareList = new Array();
|
|
|
$("#a_num").html($("#txtNum").val());
|
|
|
|
|
|
|
|
|
var Num = parseInt($("#txtNum").val());
|
|
|
var shtml=new Sys.StringBuilder();
|
|
|
for (var i = 0; i < Num; i++) {
|
|
|
var idindex=(i+1).toString();
|
|
|
shtml.append("<table width='100%' id='tb" + idindex + "'><tr><td align='left' colspan='4'>包裹" + idindex + ": 跟踪码:<input id='txtTrackCode" + idindex + "' tno='" + idindex + "' type='text' style='width: 200px;' class='editTextbox' /><a class='a_code' no='" + idindex + "' style='cursor: pointer; text-decoration: underline; color: blue;'>获取跟踪码</a></td></tr>");
|
|
|
shtml.append("<tr><td align='left' colspan='4'><a class='addopen' no='" + idindex + "' style='cursor: pointer; text-decoration: underline; color: blue;'><img alt='' src='../images/add.ico' />选择货物</a> </td></tr>");
|
|
|
shtml.append("<tr><td align='left' colspan='4'><div id='div" + idindex + "'><table width='80%' class='DataGridTableStyle' id='tbhw" + idindex + "'><tr class='HeaderStyle'><th width='25%'>货物名称</th><th width='25%'>SKU</th><th width='25%'>数量</th><th width='25%'>操作</th></tr></table></div></td></tr></table>");
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#div_bg").html(shtml.toString());
|
|
|
if (TrackCode1 != null && TrackCode1 != "") {
|
|
|
$("#txtTrackCode1").val(TrackCode1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function GetExpressType() {
|
|
|
|
|
|
$("#selectwl").append("<option value='0'>全部</option>");
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../SysManage/SysManageService.asmx/GetExpressTypeList",
|
|
|
// data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function () {
|
|
|
$("#selectwl").append("<option value='" + this.LogisticsId + "'>" + this.LogisticsName + "</option>");
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function GetOrderTrackCode() {
|
|
|
if ($("#txtPost").val() == "0") {
|
|
|
alert("请先选择物流方式");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
var param = new Object();
|
|
|
var md = new Object();
|
|
|
md.OrderId = OrderId;
|
|
|
md.Post = $("#txtPost").val();
|
|
|
md.PlatOrderCode = $("#txtPlatOrderCode").html();
|
|
|
|
|
|
|
|
|
param.model = md;
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/GetOrderTrackCodeModel",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.d != null && data.d.Error != "") {
|
|
|
alert(data.d.Error);
|
|
|
|
|
|
}
|
|
|
else if (data.d != null) {
|
|
|
alert("获取完成");
|
|
|
$("#txtTrackCode"+Index).val(data.d.TrackCode);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
function GetExpress() {
|
|
|
$("#txtPost").empty();
|
|
|
$("#txtPost").append("<option value='0'>-选择-</option>");
|
|
|
|
|
|
//$("#div_postinfo").empty();
|
|
|
var param = new Object();
|
|
|
param.LogisticsId = $("#selectwl").val();
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../BaseData.asmx/GetExpressPostList",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function () {
|
|
|
$("#txtPost").append("<option value='" + this.ExpressID + "'>" + this.Name + "</option>");
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function CreateDataGrid1() {
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "货物名称";
|
|
|
|
|
|
col.CellTemplate = "<a>{Bind GoodsName}</a>";
|
|
|
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "货物SKU";
|
|
|
col.CellTemplate = "<a>{Bind GoodsSKU}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "数量";
|
|
|
col.Width = "60px";
|
|
|
col.CellTemplate = "<a>{Bind GoodsNum}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "拆分数量";
|
|
|
col.CellTemplate = "<input type='text' min='0' max='{Bind GoodsNum}' precision='0' style='width:50px;' class='editTextbox' ColName='SpareNum' value='{Bind SpareNum}'/>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
|
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
datagrid1.ShowIndexColumn = false;
|
|
|
datagrid1.AllowPaging = false;
|
|
|
//datagrid1.Height = "260px";
|
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.CheckBox;
|
|
|
datagrid1.Init();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
function Save() {
|
|
|
if (GoodsList.length>0) {
|
|
|
|
|
|
alert("还有货物没有分配到包裹中");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#txtPost").val() == "0") {
|
|
|
alert("请先物流方式");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var param = new Object();
|
|
|
|
|
|
param.OrderId = OrderId;
|
|
|
|
|
|
var list = new Array();
|
|
|
$("input[tno]").each(function () {
|
|
|
var idx = $(this).attr("tno");
|
|
|
var md = new Object();
|
|
|
md.Post = $("#txtPost").val();
|
|
|
md.OrderId = OrderId;
|
|
|
md.OrderCode = "X" + idx+"-"+$("#txtPlatOrderCode").html();
|
|
|
md.TrackCode = $(this).val();
|
|
|
md.PostState = 0;
|
|
|
md.PrintState = 0;
|
|
|
md.BGIndex = idx;
|
|
|
if ($("#tbhw" + idx + " tr").length > 1)
|
|
|
Array.add(list, md);
|
|
|
});
|
|
|
param.list1 = list;
|
|
|
var list2 = new Array();
|
|
|
$(SpareList).each(function () {
|
|
|
|
|
|
var md1 = new Object();
|
|
|
md1.SpareId =0;
|
|
|
md1.OrderDetailId = this.Id;
|
|
|
md1.DetailId = this.DetailId;
|
|
|
md1.GoodsNum = this.GoodsNum;
|
|
|
md1.BGIndex = this.Index;
|
|
|
Array.add(list2, md1);
|
|
|
});
|
|
|
param.list2 = list2;
|
|
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/SaveSpare",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
alert("保存成功");
|
|
|
window.parent.CloseTab("拆分发包", Title);
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
<body class="headbody">
|
|
|
<div style="display: none">
|
|
|
<div id="test" title="货物" style="width: 680px; height: 350px;">
|
|
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td align="left" colspan="5">
|
|
|
<div style="height: 280px; overflow: auto">
|
|
|
<div id="DataGrid1"></div>
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td align="center" colspan="5">
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="添 加" onclick="AddBGGoods()" /> <input
|
|
|
id="btn_Cancel" type="button" class="btnClass btnClassClose" value="关 闭" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
<div class="title_ico">
|
|
|
订单拆分
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<table width="99%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">订单号:</td>
|
|
|
<td><a id="txtPlatOrderCode"></a></td>
|
|
|
<td style="width: 120px" class="f1">物流方式:</td>
|
|
|
<td>
|
|
|
<select id="selectwl" class="selectClass" style="width: 120px" name="D1">
|
|
|
</select><select id="txtPost" class="selectClass" style="width: 120px; top: 0px; left: -1px;" name="D1">
|
|
|
</select><a id="a_post" style="display: none"></a></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 150px" class="f1">拆分成几个包裹:</td>
|
|
|
<td colspan="3">
|
|
|
<input id="txtNum" type="text" style="width: 100px;" class="editTextbox" value="" /><a id="a_num" style="display:none"></a>个
|
|
|
<input id="btn_Sure" type="button" class="btnClass btnClassSave" value="确定" onclick="AddBG();" />
|
|
|
<input id="btn_print" type="button" class="btnClass btnClassEdit" value="打印面单" onclick="Print();" style="display:none"/></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td align="left" colspan="4">
|
|
|
<div id="div_bg">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td align="center" colspan="4">
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="保存" onclick="Save();" />
|
|
|
<input id="cmdBack" type="button" value="返 回" class="btnClass btnClassBack" /></td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|