|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DD_PostCodeExcelForTM.aspx.cs" Inherits="TradeManage.DingDan.DD_PostCodeExcelForTM" %>
|
|
|
|
|
|
<!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/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/ajaxfileupload.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/MaskedTextBox.js" type="text/javascript"></script>
|
|
|
<script src="../Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
WindowLoadModel.Load();
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
|
|
|
|
|
|
CreateDataGrid();
|
|
|
GetExpressType();
|
|
|
GetExpress();
|
|
|
var dd = new Date();
|
|
|
$("#txt_SDate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate() + " 7:00");
|
|
|
$("#txt_EDate").val(dd.getFullYear() + "-" + (dd.getMonth() + 1) + "-" + dd.getDate() + " " + dd.getHours() + ":" + dd.getMinutes());
|
|
|
|
|
|
// ReadData();
|
|
|
$("#select_wl").bind("change", function () {
|
|
|
|
|
|
GetExpress();
|
|
|
|
|
|
});
|
|
|
|
|
|
//$("#select_post").bind("change", function () {
|
|
|
// Ids = "";
|
|
|
// ReadData();
|
|
|
//});
|
|
|
|
|
|
|
|
|
$("#cmdSch").bind("click", function () {
|
|
|
Ids = "";
|
|
|
ReadData();
|
|
|
});
|
|
|
|
|
|
});
|
|
|
function GetExpressType() {
|
|
|
|
|
|
$("#select_wl").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 () {
|
|
|
$("#select_wl").append("<option value='" + this.LogisticsId + "'>" + this.LogisticsName + "</option>");
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//#region 导出
|
|
|
function ExportData() {
|
|
|
if (Ids==""&&$("#txt_SDate").val() == "")
|
|
|
{
|
|
|
alert("请输入发货开始时间");
|
|
|
$("#txt_SDate").focus();
|
|
|
return;
|
|
|
}
|
|
|
if ($("#select_post").val() == "0")
|
|
|
{
|
|
|
alert("请选择物流方式");
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
var param = new Object();
|
|
|
|
|
|
param.SDate = null;
|
|
|
if ($("#txt_SDate").val() != "")
|
|
|
param.SDate = $("#txt_SDate").val();
|
|
|
param.EDate = null;
|
|
|
if ($("#txt_EDate").val() != "")
|
|
|
param.EDate = $("#txt_EDate").val();
|
|
|
|
|
|
if ($("#select_post option").length == 0)
|
|
|
param.PostId = 0;
|
|
|
else
|
|
|
param.PostId = $("#select_post").val();
|
|
|
param.Ids = Ids;
|
|
|
var dd = new Date();
|
|
|
var fname = "邮局上报数据(" + dd.getFullYear() + "." + (dd.getMonth() + 1) + "." + dd.getDate() + ").xls";
|
|
|
if (param.PostId == 100)
|
|
|
fname = "5239429643_" + dd.getFullYear() + (dd.getMonth() + 1) + dd.getDate() + dd.getHours() + dd.getMinutes() + dd.getSeconds() + ".txt";
|
|
|
if (param.PostId == 147)
|
|
|
fname = "5239429643_" + dd.getFullYear() + (dd.getMonth() + 1) + dd.getDate() +dd.getHours()+dd.getMinutes()+dd.getSeconds()+ ".txt";
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/ExcelPostDataForTM",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
if (data.d == "" || data.d == "找不到该渠道的导出模板")
|
|
|
{
|
|
|
alert("找不到该渠道的导出模板");
|
|
|
return;
|
|
|
}
|
|
|
params = { FilePath: data.d, FileName: fname };
|
|
|
|
|
|
window.location = "../GlobalAshx/DownFile.ashx?" + jQuery.param(params);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function GetExpress() {
|
|
|
$("#select_post").empty();
|
|
|
|
|
|
$("#select_post").append("<option value='0'>-选择-</option>");
|
|
|
|
|
|
//$("#div_postinfo").empty();
|
|
|
var param = new Object();
|
|
|
param.LogisticsId = $("#select_wl").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 (i) {
|
|
|
$("#select_post").append("<option value='" + this.ExpressID + "'>" + this.Name + "</option>");
|
|
|
// $("#div_postinfo").append("<input id='rad_'" + i.toString() + " type='radio' name='wl' no='" + this.ExpressID + "' /><label for='rad_'" + i.toString() + ">" + this.Name + "</label><br/>");
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function GetBasePlat() {
|
|
|
|
|
|
$("#select_plat").append("<option value='0'>全部</option>");
|
|
|
var param = new Object();
|
|
|
param.CompanyID = 0;
|
|
|
param.KeyName = "ptlx";
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../UserService.asmx/GetPlatBaseCode",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function () {
|
|
|
$("#select_plat").append("<option value='" + this.SortNo + "'>" + this.Name + "</option>");
|
|
|
});
|
|
|
GetShopList();
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function GetShopList() {
|
|
|
$("#select_shop").empty();
|
|
|
$("#select_shop").append("<option value='0'>全部</option>");
|
|
|
var param = new Object();
|
|
|
|
|
|
param.PlatType = $("#select_plat").val();
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../BaseData.asmx/GetShopList",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function (i) {
|
|
|
$("#select_shop").append("<option value='" + this.ShopId + "'>" + this.ShopName + "</option>");
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function fopen() {
|
|
|
|
|
|
$.fancybox({
|
|
|
'width': '40%',
|
|
|
'height': '40%',
|
|
|
'autoScale': false,
|
|
|
'topRatio': 0,
|
|
|
'leftRatio': 0,
|
|
|
'transitionIn': 'elastic',
|
|
|
'transitionOut': 'elastic',
|
|
|
'href': '#test',
|
|
|
'onComplete': function () {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 初始化DataGrid
|
|
|
function CreateDataGrid() {
|
|
|
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "跟踪码";
|
|
|
col.CellTemplate = "<a>{Bind TrackCode}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "运输方式";
|
|
|
col.CellTemplate = "<a>{Bind PostName}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "订单号";
|
|
|
col.CellTemplate = "<a>{Bind PlatOrderCode}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "发货时间";
|
|
|
col.CellTemplate = "<span>{Bind InDate,yyyy-MM-dd HH:mm}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "国家";
|
|
|
col.CellTemplate = "<span>{Bind CountryName}</span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
datagrid1.SetPageSize(50);
|
|
|
datagrid1.SetPageIndex(1);
|
|
|
datagrid1.IsFixHeader = false;
|
|
|
datagrid1.ShowIndexColumn = false;
|
|
|
datagrid1.AllowPaging = true;
|
|
|
datagrid1.Width = "100%";
|
|
|
datagrid1.SelectMode = nblf.ui.SelectMode.None;
|
|
|
datagrid1.Init();
|
|
|
datagrid1.add_PageIndexChanged(function () { ReadData(); });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
//#region 读取数据
|
|
|
var Ids = "";
|
|
|
function ReadData() {
|
|
|
var param = new Object();
|
|
|
|
|
|
param.SDate = null;
|
|
|
if ($("#txt_SDate").val() != "")
|
|
|
param.SDate = $("#txt_SDate").val();
|
|
|
param.EDate = null;
|
|
|
if ($("#txt_EDate").val() != "")
|
|
|
param.EDate = $("#txt_EDate").val();
|
|
|
|
|
|
if ($("#select_post option").length == 0)
|
|
|
param.PostId = 0;
|
|
|
else
|
|
|
param.PostId = $("#select_post").val();
|
|
|
param.Ids = Ids;
|
|
|
param.PageSize = datagrid1.Get_PageSize();
|
|
|
param.PageIndex = datagrid1.Get_PageIndex();
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/GetListOrderPostInfoForTM",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
datagrid1.Set_RowCount(data.d.RowCount);
|
|
|
datagrid1.DataBind(data.d.DataSource);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//#endregion
|
|
|
//#region 删除
|
|
|
function DelCol(obj) {
|
|
|
if (window.confirm('确定要删除吗?') == 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: "YY_Service.asmx/DeleteFoodList",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
alert("删除成功");
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
ReadData();
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function ajaxFileUpload() {
|
|
|
|
|
|
var filename = $("#fileToUpload").val();
|
|
|
if (IsExcel(filename) == false) { alert("请选择excel文件"); return; }
|
|
|
$.ajaxFileUpload({
|
|
|
url: '../GlobalAshx/AjaxFileUpdate.ashx?DirectoryName=ServerCookies',
|
|
|
secureuri: false,
|
|
|
fileElementId: 'fileToUpload',
|
|
|
dataType: 'json',
|
|
|
success: function (data, status) {
|
|
|
ImportData("ServerCookies/" + data.FileName);
|
|
|
},
|
|
|
error: function (data, status, e) {
|
|
|
alert(e);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function ImportData(FileName) {
|
|
|
|
|
|
var param = new Object();
|
|
|
param.FileName = FileName;
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/ImportOrderTrackCode",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
if (data.d.Error != null && data.d.Error != "") {
|
|
|
alert(data.d.Error);
|
|
|
|
|
|
}
|
|
|
if(data.d.Ids!=null&&data.d.Ids!="")
|
|
|
{
|
|
|
Ids = data.d.Ids;
|
|
|
//$("#select_post").val("0");
|
|
|
ReadData();
|
|
|
}
|
|
|
|
|
|
},
|
|
|
error: function (xhr, status) {
|
|
|
if (status != "success") alert(xhr.responseText);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function ChangeExpress()
|
|
|
{
|
|
|
if ($("#div_postinfo input:checked").length == 0)
|
|
|
{
|
|
|
alert("请选择一个物流");
|
|
|
return;
|
|
|
}
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
param.list = selectlist;
|
|
|
param.PostId = $("#div_postinfo input:checked").first().attr("no");
|
|
|
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/SaveOrderPost",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.d != null && data.d != "")
|
|
|
{
|
|
|
alert(data.d);
|
|
|
|
|
|
}
|
|
|
else
|
|
|
alert("物流选择完成");
|
|
|
ReadData();
|
|
|
$.fancybox.close();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//#endregion
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
<body class="headbody">
|
|
|
<div class="title_ico">
|
|
|
邮局数据上报
|
|
|
</div>
|
|
|
|
|
|
<table id="tb1" class="tableAll" style="width:100%;" >
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td class="f1" width="13%">物流:</td>
|
|
|
<td width="28%"> <select id="select_wl" class="selectClass" style="width:130px" name="D8">
|
|
|
|
|
|
</select>
|
|
|
<select id="select_post" class="selectClass" style="width:130px" name="D2">
|
|
|
|
|
|
</select>
|
|
|
</td>
|
|
|
<td class="f1" width="10%">发货时间:</td> <td> <input id="txt_SDate" class="editTextbox" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" style="width: 150px;" type="text" />-<input id="txt_EDate" class="editTextbox" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" style="width: 150px;" type="text" /> <input id="cmdSch" class="btnClass btnClassFind" type="button" value="查询" />
|
|
|
<input id="cmdOut" class="btnClass btnClassExcelTemplate" onclick="ExportData();" type="button" value="导出数据" /></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
<td colspan="4"> <input id="fileToUpload" accept="excel/xls" name="fileToUpload" type="file" style="width:200px" /> <input class="btnClass btnClassImportExcel" type="button" value="跟踪码导入" id="btn_import" onclick="ajaxFileUpload();"/> </td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td valign="top" colspan="4">
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|