You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

658 lines
24 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DD_ScanOrder.aspx.cs" Inherits="TradeManage.DingDan.DD_ScanOrder" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>订单信息</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" />
<link rel="stylesheet" type="text/css" href="../themes/DataGrid.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 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>
<link rel="stylesheet" type="text/css" href="../Scripts/fancybox/jquery.fancybox-1.3.4.css"
media="screen" />
<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/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../Scripts/MaskedTextBox.js" type="text/javascript"></script>
<script type="text/javascript">
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var WindowLoadModel = new WindowLoad();
var OrderId = 0;
var IsSpare = 0;
var Id = 0;
var State = 0;
var PostId = 0;
var PostState = 0;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
$("#txtTotalWeight").focus();
$(document).keyup(function (event) {
if (event.keyCode == 13) {
if ($("#txtTotalWeight").is(":focus") == true)
{
$("#txt_OrderCode").focus();
}
else if ($("#txt_OrderCode").is(":focus") == true)
{
// if ($("#txtTotalWeight").val()!=""&&$("#txt_OrderCode").val() != "") {
savepost();
// }
}
}
});
//$("#txt_OrderCode").focus();
$("#btn_refresh").bind("click", function () {
window.location.reload();
});
$("#btn_tj2").bind("click", function () {
window.location.href = "DD_OrderSend.aspx";
});
$("#btn_sch").bind("click", function () {
if ($("#txt_OrderCode").val() == "") {
alert("请输入或扫描订单号或者跟踪码");
return;
}
savepost();
});
$("#txtTotalWeight,#txtPostFee").MaskedTextBox();
$("#a_fee").bind("click", function () {
fopen();
});
$("#btn_CF").bind("click", function () {
window.parent.addTab("订单拆分", "DingDan/DD_OrderSpare.aspx?Title=订单发货扫描&OrderId=" + OrderId, true);
});
$("#btn_close,#btn_close2").bind("click", $.fancybox.close);
});
function fopen() {
$.fancybox({
'width': '40%',
'height': '40%',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#test',
'onComplete': function () {
GetFeeModel();
}
});
}
function fopen2() {
$.fancybox({
'width': '40%',
'height': '40%',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#test2',
'onComplete': function () {
}
});
}
//#endregion
//#region 读取数据
function GetOrder() {
var param = new Object();
param.OrderCode = $("#txt_OrderCode").val();
WindowLoadModel.Show();
$.ajax({
url: "DD_OrderService.asmx/GetScanOrderModel",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
OrderId = data.d.OrderId;
State = data.d.State;
IsSpare = data.d.IsSpare;
Id = data.d.Id;
PostId=data.d.Post;
$("#a_PlatOrderCode").html(data.d.PlatOrderCode);
$("#a_TrackCode").html(data.d.TrackCode);
$("#a_RevName").html(data.d.RevName);
$("#a_RevCountry").html(data.d.RevCountry);
$("#a_RevAddr").html(data.d.RevAddr);
$("#a_RevPostCode").html(data.d.RevPostCode);
$("#a_RevPhone").html(data.d.RevPhone);
$("#a_PostInfo").html(data.d.PostInfo);
if (data.d.PostInfo == null || data.d.PostInfo == "")
$("#a_fee").hide();
else
$("#a_fee").show();
$("#tb1").show();
$("#txtTotalWeight").focus();
}
else {
alert("该订单号或者跟踪码不存在,或者该订单还不能发货");
}
}
});
}
function save() {
if ($("#txtTotalWeight").val() == "") {
alert("请填写重量");
return;
}
if ($("#txtPostFee").val() == "") {
alert("请填写运费");
return;
}
var param = new Object();
param.OrderId = OrderId;
param.IsSpare = IsSpare;
param.PostState = PostState;
param.State = State;
param.Id = Id;
param.Weight = $("#txtTotalWeight").val();
param.PostFee = $("#txtPostFee").val();
WindowLoadModel.Show();
$.ajax({
url: "DD_OrderService.asmx/UpdateOrderGoodsNew",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
WindowLoadModel.Hide();
$("#a_poststate").html("发货成功");
$("#txtTotalWeight").val("");
$("#txt_OrderCode").val("");
$("#txtTotalWeight").focus();
}
});
}
function savepost() {
$("#tr2").hide();
cancel();
if ($("#txtTotalWeight").val() == "") {
alert("请填写重量");
$("#txtTotalWeight").focus();
return;
}
if ($("#txt_OrderCode").val() == "") {
alert("请输入或扫描订单号或者跟踪码");
$("#txt_OrderCode").focus();
return;
}
$("#a_weight").html($("#txtTotalWeight").val());
var param = new Object();
param.Weight = $("#txtTotalWeight").val();
param.OrderCode = $("#txt_OrderCode").val();
WindowLoadModel.Show();
$.ajax({
url: "DD_OrderService.asmx/ScanOrderPostNew",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
OrderId = data.d.OrderId;
State = data.d.State;
IsSpare = data.d.IsSpare;
PostState = data.d.PostState;
Id = data.d.Id;
//$("#btn_CF").show();
if (data.d.PostError != null && data.d.PostError != "")
{
if (data.d.PostError == "超出重量限制")
{
$("#a_poststate").html("超出2000克重量限制请修改重量或者拆分订单后才能发货");
alert("超出2000克重量限制请修改重量或者拆分订单后才能发货");
return;
}
else if (data.d.PostError == "发票") {
$("#div_weighterror").html("该国家需要提供发票");
$("#a_poststate").html("该国家需要提供发票");
fopen2();
}
else
{
$("#div_weighterror").html(data.d.PostError);
$("#a_poststate").html(data.d.PostError);
fopen2();
}
}
else if (data.d.PostFee == null|| data.d.PostFee <= 0)
{
$("#a_poststate").html("未找到相关运费的计算标准");
alert("未找到相关运费的计算标准");
$("#tr2").show();
}
else if (data.d.PostState == 1) {
$("#a_poststate").html("发货成功");
$("#txtTotalWeight").val("");
$("#txt_OrderCode").val("");
$("#txtTotalWeight").focus();
}
// $("#tb1").show();
if (data.d.PostFee!= null&&data.d.PostFee>0)
$("#txtPostFee").val(data.d.PostFee);
$("#a_PlatOrderCode").html(data.d.PlatOrderCode);
$("#a_TrackCode").html(data.d.TrackCode);
$("#a_RevName").html(data.d.RevName);
$("#a_RevCountry").html(data.d.RevCountry);
$("#a_RevAddr").html(data.d.RevAddr);
$("#a_RevPostCode").html(data.d.RevPostCode);
$("#a_RevPhone").html(data.d.RevPhone);
$("#a_PostInfo").html(data.d.PostInfo);
}
else {
OrderId = 0;
$("#btn_CF").hide();
$("#txt_OrderCode").focus();
$("#a_poststate").html("该订单号或者跟踪码不存在,或者该订单还不能发货");
alert("该订单号或者跟踪码不存在,或者该订单还不能发货");
}
}
});
}
function savego() {
if ($("#txtTotalWeight").val() == "") {
alert("请填写重量");
return;
}
if ($("#txtPostFee").val() == "") {
alert("请填写运费");
return;
}
var param = new Object();
param.OrderId = OrderId;
param.IsSpare = IsSpare;
param.PostState = PostState;
param.State = State;
param.Id = Id;
param.Weight = $("#txtTotalWeight").val();
param.PostFee = $("#txtPostFee").val();
WindowLoadModel.Show();
$.ajax({
url: "DD_OrderService.asmx/UpdateOrderGoodsNew",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
WindowLoadModel.Hide();
$("#a_poststate").html("发货成功");
$("#txtTotalWeight").val("");
$("#txt_OrderCode").val("");
$("#txtTotalWeight").focus();
$.fancybox.close();
}
});
}
function cancel() {
//$("#tb1").hide();
OrderId = 0;
// $("#txtTotalWeight").val("");
//$("#txt_OrderCode").val("");
$("#txtPostFee").val("");
$("#a_TrackCode").html("");
$("#a_PlatOrderCode").html("");
$("#a_RevName").html("");
$("#a_RevCountry").html("");
$("#a_RevAddr").html("");
$("#a_RevPostCode").html("");
$("#a_RevPhone").html("");
$("#a_PostInfo").html("");
$("#a_poststate").html("");
}
function computerfee() {
if ($("#txtTotalWeight").val() == "") {
alert("请填写重量");
return;
}
if (PostId == 0) {
alert("该订单没有指定物流渠道,无法计算运费");
return;
}
var param = new Object();
param.PostId = PostId;
param.Weight = $("#txtTotalWeight").val();
param.Country = $("#a_RevCountry").val();
WindowLoadModel.Show();
$.ajax({
url: "DD_OrderService.asmx/GetPostFeeDetailList",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
WindowLoadModel.Hide();
if (data.d == "") {
alert("没有对应的运费规则");
}
else {
$("#txtPostFee").val(data.d);
}
}
});
}
function CreateDataGrid() {
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 = "对应本地sku";
col.CellTemplate = "<a>{Bind SKUState}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "匹配数量";
col.CellTemplate = "<a>{Bind LockNum}</a>";
Array.add(datagrid1.Columns, col);
datagrid1.IsFixHeader = false;
datagrid1.ShowIndexColumn = false;
datagrid1.AllowPaging = false;
//datagrid1.Height = "260px";
datagrid1.SelectMode = nblf.ui.SelectMode.None;
datagrid1.Init();
}
function GetFeeModel() {
var param = new Object();
param.PostId = PostId;
WindowLoadModel.Show();
$.ajax({
url: "DD_OrderService.asmx/GetPostFeeDesc",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
async: false,
success: function (data) {
WindowLoadModel.Hide();
if (data.d != null) {
$("#div_postfee").html(data.d.FeeDesc);
}
else
$("#div_postfee").html("");
}
});
}
</script>
</head>
<body class="headbody">
<div class="title_ico">
订单扫描信息
</div>
<div style="display: none">
<div id="test" title="运费参考" style="width: 600px; height: 420px;">
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
<tr>
<td colspan="2" align="center">运费参考
</td>
</tr>
<tr>
<td colspan="2">
<div id="div_postfee" style="width: 550px; height: 350px;overflow:auto">
</div>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input
id="btn_close" type="button" class="btnClass btnClassClose" value="关 闭" />
</td>
</tr>
</table>
</div>
<div id="test2" title="运费参考" style="width: 500px; height: 200px;">
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
<tr>
<td colspan="2" align="center">提示
</td>
</tr>
<tr>
<td colspan="2">
<div id="div_weighterror" style="color:red">
</div>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input id="btn_Save2" class="btnClass btnClassSave" type="button" value="我知道了,继续发货" onclick="savego();" /> <input
id="btn_close2" type="button" class="btnClass btnClassClose" value="取 消" />
</td>
</tr>
</table>
</div>
</div>
<table class="tableAll" style="width: 100%;">
<tr>
<td colspan="2">
<font color="red">有电子称的用户,只要把货物放到电子称上,下面会自动显示重量,没有的话请手动输入重量<br />然后扫描单上的跟踪码即可,如果该物流有运费标准的话会自动计算出运费,没有的话请手动输入运费,便于利润统计,运费折扣在利润报表统计时填入<br />
扫描后没有问题的话,订单会变成发货状态,并且扣除库存,清除采购参考那边的订单货物需求数
</font></td>
</tr>
<tr>
<td colspan="2">
<input id="btn_tj1" type="button" value="称重扫描发货" class="btnSelected"/> <input id="btn_tj2" class="btnUnSelected" type="button" value="手工一键发货" /></td>
</tr>
<tr>
<td class="f1" width="13%">称重:</td>
<td >
<input id="txtTotalWeight" class="editTextbox" style="width: 100px;" type="text" />克&nbsp;&nbsp; <font color="red">注:请先填写包裹重量,再扫描单号</font></td>
</tr>
<tr>
<td class="f1" width="13%">订单号/跟踪码:</td>
<td>
<input id="txt_OrderCode" class="editTextbox" style="width: 200px;" type="text" /> &nbsp;<input id="btn_sch" class="btnClass btnClassFind" type="button" value="确定" />&nbsp; <input id="btn_refresh" class="btnClass btnClassFind" type="button" value="重新扫描" /><input id="btn_CF" class="btnClass btnClassFind" type="button" value="拆分发包" style="display:none"/></td>
</tr>
<tr>
<td colspan="2">
<table id="tb1" class="tableAll" style="width: 95%;">
<tr>
<td colspan="4" align="center"><font style="font-weight: bolder; font-size: 18pt">订单信息 </font></td>
</tr>
<tr>
<td class="f1" width="13%">订单号:</td>
<td width="25%"><a id="a_PlatOrderCode"></a></td>
<td class="f1" width="13%">跟踪码:</td>
<td><a id="a_TrackCode"></a></td>
</tr>
<tr>
<td class="f1" width="13%">国家:</td>
<td><a id="a_RevCountry"></a></td>
<td class="f1" width="13%">收件人:</td>
<td><a id="a_RevName"></a></td>
</tr>
<tr>
<td class="f1" width="13%">收件地址:</td>
<td><a id="a_RevAddr"></a></td>
<td class="f1" width="13%">邮编:</td>
<td><a id="a_RevPostCode"></a></td>
</tr>
<tr>
<td class="f1" width="13%">电话:</td>
<td><a id="a_RevPhone"></a></td>
<td class="f1" width="13%">物流方式:</td>
<td>
<a id="a_PostInfo"></a>
<a id="a_fee" style="cursor: pointer; color: Blue;text-decoration:underline;display:none">运费参考</a></td>
</tr>
<tr>
<td class="f1" width="13%">重量:</td>
<td> <a id="a_weight"></a></td>
<td class="f1" width="13%">运费:</td>
<td>
<input id="txtPostFee" class="editTextbox" max="10000000" min="0" precision="1" style="width: 150px;" type="text" />元 &nbsp;<a id="a_jsfee" onclick="computerfee();" style="cursor: pointer; color: Blue;text-decoration:underline;display:none">自动计算</a></td>
</tr>
<tr style="display:none">
<td class="f1" width="13%">订单货物:</td>
<td colspan="3">
<div id="DataGrid1" class="DataGridStyle"></div></td>
</tr>
<tr>
<td class="f1" width="13%">发货状态:</td>
<td colspan="3">
<a id="a_poststate" style="cursor: pointer; color: Red;font-weight:bolder;font-size:larger"></a></td>
</tr>
<tr style="display:none" id="tr2">
<td colspan="4" align="center">
<input id="btn_Save" class="btnClass btnClassSave" type="button" value="确定发货" onclick="save();" />&nbsp;&nbsp;&nbsp;
<input id="btn_Cancel" class="btnClass btnClassClose" type="button" value="取消" onclick="cancel();" style="display:none"/></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>