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.

534 lines
19 KiB
Plaintext

2 months ago
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DD_Addrlist.aspx.cs" Inherits="TradeManageNew.DingDan.DD_Addrlist" %>
<!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?a=1" />
<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?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>
<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 type="text/javascript">
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
var WindowLoadModel = new WindowLoad();
var Target = "";
var Id = 0;
$(document).ready(function () {
WindowLoadModel.ApplicationPath = "../";
WindowLoadModel.ControlID = "WindowLoad";
WindowLoadModel.Isbgiframe = true;
WindowLoadModel.Load();
ajaxInit(WindowLoadModel);
CreateDataGrid();
ReadData();
$("#" + datagrid1.TableID + " a[CommandName='cmdLook']").live("click", function () {
var RowIndex = $(this).parentsUntil("tr").parent().attr("index");
var model = datagrid1.Get_Model(RowIndex);
// window.location = "DD_OrderLook.aspx?OrderId=" + model.OrderId;
//window.parent.addTab("订单查看", "DingDan/DD_OrderLook.aspx?Title=订单查询&OrderId=" + model.OrderId, true);
if (Target == "")
window.parent.addTab("订单修改", "DingDan/DD_OrderGoodsMateForTM.aspx?DSF=1&Title=订单查询&OrderId=" + model.OrderId, true);
else
window.open("DD_OrderGoodsMateForTM.aspx?DSF=1&Title=订单查询&OrderId=" + model.OrderId);
});
$("#btn_sch").bind("click", function () {
ReadData();
});
});
function fopen() {
$.fancybox({
'width': '40%',
'height': '40%',
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'href': '#test',
'onComplete': function () {
}
});
}
//#region 初始化DataGrid
function CreateDataGrid() {
var col = new nblf.ui.DataGridColumn();
col.HeaderText = "收件人";
col.CellTemplate = "<span>{Bind name}</span>";
col.SortExpression = "name";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "国家";
col.CellTemplate = "<span>{Bind country}</span>";
col.SortExpression = "country";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "省,州";
//CommandName='cmdLook'
col.CellTemplate = "<a>{Bind provice}</a>";
col.SortExpression = "provice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "城市";
col.CellTemplate = "<div>{Bind city}</div>";
col.Width = "200px";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "地址详情";
col.CellTemplate = "<div>{Bind addr}</div>";
col.Width = "200px";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "邮编";
col.CellTemplate = "<div>{Bind postcode}</div>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "电话/手机";
col.CellTemplate = "<div>{Bind phone}/{Bind mobile}</div>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "购买订单数";
col.SortExpression = "CountryName";
col.CellTemplate = "<span>{Bind ordernum}</span>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "购买总金额";
col.CellTemplate = "<span>{Bind orderprice}</span>";
col.SortExpression = "orderprice";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "地址加入时间";
col.CellTemplate = "<a>{Bind indate,yyyy-MM-dd}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "最近一次下单时间";
col.CellTemplate = "<a>{Bind lastdate,yyyy-MM-dd}</a>";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "寄信次数";
col.CellTemplate = "<a>{Bind mailcount}</a>";
col.Width = "200px";
Array.add(datagrid1.Columns, col);
col = new nblf.ui.DataGridColumn();
col.HeaderText = "最近一次寄信时间";
col.CellTemplate = "<a >{Bind maildate,yyyy-MM-dd}</a>";
Array.add(datagrid1.Columns, col);
//col = new nblf.ui.DataGridColumn();
//col.HeaderText = "操作";
//col.Width = "100px";
//col.CellTemplate = "<input CommandName='cmdCF' class='btnClass dgbtnEdit' type='button' value='订单重发'></input> ";
//Array.add(datagrid1.Columns, col);
datagrid1.SetPageSize(50);
datagrid1.SetPageIndex(1);
datagrid1.SortExpression = "provice,city,addr";
datagrid1.ViewSortDirection = "desc";
datagrid1.IsFixHeader = false;
datagrid1.ShowIndexColumn = false;
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(); });
}
var PState = 0;
//#endregion
//#region 读取数据
function ReadData() {
var param = new Object();
param.name = $("#txt_name").val();
param.addr = $("#txt_addr").val();
param.jxcs = $("#select_mailcount").val();
param.snum = null;
param.endnum=null;
if ($("#txt_snum").val()!="")
param.snum = $("#txt_snum").val();
if ($("#txt_enum").val()!="")
param.endnum = $("#txt_enum").val();
param.sprice = null;
param.eprice=null;
if ($("#txt_sprice").val()!="")
param.sprice = $("#txt_sprice").val();
if ($("#txt_eprice").val()!="")
param.eprice = $("#txt_eprice").val();
param.StartDate = null;
if ($("#txt_StartDate").val() != "")
param.StartDate = $("#txt_StartDate").val();
param.StopDate = null;
if ($("#txtStopDate").val() != "")
param.StopDate = $("#txt_StopDate").val();
param.StartDate2 = null;
if ($("#txt_StartDate2").val() != "")
param.StartDate2 = $("#txt_StartDate2").val();
param.StopDate2 = null;
if ($("#txtStopDate2").val() != "")
param.StopDate2 = $("#txt_StopDate2").val();
param.StartDate3 = null;
if ($("#txt_StartDate3").val() != "")
param.StartDate = $("#txt_StartDate3").val();
param.StopDate3 = null;
if ($("#txtStopDate3").val() != "")
param.StopDate3 = $("#txt_StopDate3").val();
//string name, string addr, int jxcs, int? snum, int? endnum, decimal? sprice, decimal? eprice, DateTime? StartDate, DateTime? StopDate, DateTime? StartDate2, DateTime? StopDate2, DateTime? StartDate3, DateTime? StopDate3,string sort
param.PageSize = datagrid1.Get_PageSize();
param.PageIndex = datagrid1.Get_PageIndex();
param.Sort = datagrid1.SortExpression + " " + datagrid1.ViewSortDirection;
WindowLoadModel.Show();
$.ajax({
url: "../DD_OrderServiceNew.asmx/GetListAddr",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
success: function (data) {
WindowLoadModel.Hide();
datagrid1.Set_RowCount(data.d.RowCount);
datagrid1.DataBind(data.d.DataSource);
}
});
}
function GetTimediff(date1)
{
// var date1= '2015/05/01 00:00:00'; //开始时间
var date2 = new Date(); //结束时间
var date3 =new Date(date1).getTime()-date2.getTime(); //时间差的毫秒数
//计算出相差天数
if(date3<=0)
return "0";
var days=Math.floor(date3/(24*3600*1000))
//计算出小时数
var leave1=date3%(24*3600*1000) //计算天数后剩余的毫秒数
var hours=Math.floor(leave1/(3600*1000))
return days+"天 "+hours+"小时";
}
function GetExcelData() {
var param = new Object();
param.IsDetail = 0;
if ($("#chk_pp").is(':checked') == true)
param.IsDetail = 1;
if ($("#select_plat").find("option").length > 0)
param.PlatType = $("#select_plat").val();
else
param.PlatType = 0;
if ($("#select_shop").find("option").length > 0)
param.ShopId = $("#select_shop").val();
else
param.ShopId = 0;
if ($("#txt_days").val() != "")
param.OutDays = $("#txt_days").val();
else
param.OutDays = 0;
param.DateType = $("#select_rqlx").val();
param.SDate = null;
if ($("#txt_SDate").val() != "")
param.SDate = $("#txt_SDate").val();
param.EDate = null;
if ($("#txt_EDate").val() != "")
param.EDate = $("#txt_EDate").val();
param.TjType = $("#select_tj").val();
param.Name = $("#txt_Name").val();
param.MateState = $("#select_ppstate").val();
param.State = $("#select_fhstate").val();
param.PrintState = $("#select_printstate").val();
param.IsSku = 0;
param.MoneyState = $("#select_moneystate").val();
if ($("#chk_sku").is(':checked') == true)
param.IsSku = 1;
param.IsError = 0;
if ($("#chk_yc").is(':checked') == true)
param.IsError = 1;
param.HBOrder = 0;
if ($("#chk_hb").is(':checked') == true)
param.HBOrder = 1;
var fname = "订单导出.xls";
WindowLoadModel.Show();
$.ajax({
url: "DD_OrderService.asmx/ExcelOrderData",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
async: false,
success: function (data) {
WindowLoadModel.Hide();
params = { FilePath: data.d, FileName: fname };
window.location = "../GlobalAshx/DownFile.ashx?" + jQuery.param(params);
}
});
}
//#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);
if (model.State == 2) {
alert("该订单已经结束,无法删除");
return;
}
param.OrderId = model.OrderId;
$.ajax({
url: "DD_OrderService.asmx/DeleteOrder",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("删除成功");
}
});
datagrid1.Del_Row(rowindex);
}
function SaveMail() {
var selectlist = datagrid1.GetSelectListModel();
if (selectlist == null || selectlist.length == 0) {
alert("请选择要生成寄信的地址");
return;
}
var param = new Object();
param.list = selectlist;
$.ajax({
url: "../DD_OrderServiceNew.asmx/Save_AddrMail",
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
dataType: "json",
success: function (data) {
alert("生成完成");
}
});
}
</script>
</head>
<body class="headbody">
<div class="title_ico">
地址查询
</div>
<div style="display: none">
<div id="test" title="货物图片" style="width: 230px; height: 200px;">
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
<tr>
<td align="center">
<img src="../attached/images/1.jpg" width="180px" height="150px" id="img_1" />
<br/>
<a id='a_img' href='' target='_Blank'>图片地址</a>
</td>
</tr>
</table>
</div>
</div>
<table id="tb1" class="tableAll" style="width: 100%;">
<tr>
<td class="f1" width="10%">寄信次数:</td>
<td width="18%">
<select id="select_mailcount" class="selectClass" name="D19"
style="width: 120px">
<option value="-1">全部</option>
<option value="0">0次</option>
<option value="1">1次</option>
<option value="2">2次</option>
<option value="3">3次</option>
<option value="4">4次</option>
<option value="5">5次</option>
<option value="6">大于5次</option>
</select></td>
<td style="width: 12%;" class="f1" align="center">&nbsp;</td>
<td width="15%">
&nbsp;</td>
<td class="f1" style="width: 10%;">
新入地址日期:</td>
<td width="22%">
<input id="txt_StartDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />-<input id="txt_StopDate" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" /></td><td></td>
</tr>
<tr>
<td class="f1" width="13%">出单量:</td>
<td>
<input id="txt_snum" class="editTextbox" style="width: 50px;" type="text" />--<input
id="txt_enum" class="editTextbox" style="width: 50px;" type="text" /></td>
<td class="f1" style="width: 10%; height: 15px;">销售额:</td>
<td>
<input id="txt_sprice" class="editTextbox" style="width: 50px;" type="text" />--<input
id="txt_eprice" class="editTextbox" style="width: 50px;" type="text" /></td>
<td class="f1" style="width: 10%;">最近出单日期:</td>
<td width="22%">
<input id="txt_StartDate2" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />-<input id="txt_StopDate2" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" /></td>
<td></td>
</tr>
<tr>
<td class="f1" width="10%">收件人:</td>
<td width="18%">
<input id="txt_name" class="editTextbox" style="width: 120px;" type="text" /></td>
<td class="f1" width="12%">收件地址:</td>
<td width="18%">
<select id="select_dept" class="selectClass" style="width: 90px;display:none" name="D8">
</select><input id="txt_addr" class="editTextbox" style="width: 120px;"
type="text" /></td>
<td class="f1" style="width: 10%;">
最近寄信日期:</td>
<td width="22%">
<input id="txt_StartDate3" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" />-<input id="txt_StopDate3" class="editTextbox" onfocus="WdatePicker()" style="width: 120px;" type="text" /></td>
<td>
<input id="btn_sch" class="btnClass btnClassFind" type="button" value="查询" /></td>
</tr>
<tr>
<td valign="top" colspan="7">
<input id="btn_add" class="btnClass btnClassAdd" type="button" value="生成寄信地址" onclick="SaveMail();"/></td>
</tr>
<tr>
<td valign="top" colspan="7">
<div id="DataGrid1" class="DataGridStyle"></div>
</td>
</tr>
</table>
</body>
</html>