|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DD_OrderAddForTM.aspx.cs" Inherits="TradeManage.DingDan.DD_OrderAddForTM" %>
|
|
|
|
|
|
|
|
|
<!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 type="text/javascript">
|
|
|
var datagrid1 = new nblf.ui.DataGrid("DataGrid1");
|
|
|
var datagrid5 = new nblf.ui.DataGrid("DataGrid5");
|
|
|
|
|
|
var name = "<%=Session["Name"]%>";
|
|
|
|
|
|
var index = -1;
|
|
|
var DetailId = 0;
|
|
|
var WindowLoadModel = new WindowLoad();
|
|
|
$(document).ready(function () {
|
|
|
WindowLoadModel.ApplicationPath = "../";
|
|
|
WindowLoadModel.ControlID = "WindowLoad";
|
|
|
WindowLoadModel.Isbgiframe = true;
|
|
|
WindowLoadModel.Load();
|
|
|
ajaxInit(WindowLoadModel);
|
|
|
GetExpressType();
|
|
|
$("#selectwl").bind("change", function () {
|
|
|
|
|
|
GetExpress();
|
|
|
|
|
|
});
|
|
|
GetBasePlat();
|
|
|
$("#select_plat").bind("change", function () {
|
|
|
GetShopList();
|
|
|
});
|
|
|
var dd = new Date();
|
|
|
|
|
|
$("#txtOrderDate").val(dd.getFullYear()+"-"+(dd.getMonth()+1)+"-"+dd.getDate());
|
|
|
GetMoneyCode();
|
|
|
GetExpress();
|
|
|
$("#txt_num").MaskedTextBox();
|
|
|
$("#btn_add").bind("click", function () {
|
|
|
|
|
|
fopen();
|
|
|
|
|
|
});
|
|
|
$("#btn_Save5").bind("click", function () {
|
|
|
AddBuy();
|
|
|
});
|
|
|
|
|
|
$("#btn_Cancel").bind("click", $.fancybox.close);
|
|
|
CreateDataGrid();
|
|
|
CreateDataGrid5();
|
|
|
|
|
|
$("#cmdBack").bind("click", function () {
|
|
|
window.close();
|
|
|
window.parent.CloseTab("订单新增", "订单信息");
|
|
|
});
|
|
|
$("#txtPost").bind("change", function () {
|
|
|
//ChangeExpress();
|
|
|
|
|
|
});
|
|
|
$("input[ColName='GoodsNum']").live("keyup", function () {
|
|
|
|
|
|
hesl();
|
|
|
heji();
|
|
|
});
|
|
|
$("input[ColName='GoodsPrice']").live("keyup", function () {
|
|
|
|
|
|
hesl();
|
|
|
heji();
|
|
|
});
|
|
|
|
|
|
});
|
|
|
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 heji() {
|
|
|
var je = 0;
|
|
|
$("input[ColName='GoodsPrice']").each(function () {
|
|
|
|
|
|
var obj1 = $(this).val();
|
|
|
var obj2 = $(this).parent().parent().find("input[ColName='GoodsNum']");
|
|
|
|
|
|
var xj = 0;
|
|
|
if (obj1 != null && $(obj1).val() != "" && obj2 != null && obj2.val() != "") {
|
|
|
xj = parseFloat(obj1) * parseFloat($(obj2).val());
|
|
|
|
|
|
}
|
|
|
if ($(this).val() != "") {
|
|
|
je += xj;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
$("#txtTotalPrice").val(je.toFixed(2));
|
|
|
|
|
|
}
|
|
|
function hesl() {
|
|
|
var sl = 0;
|
|
|
$("input[ColName='GoodsNum']").each(function () {
|
|
|
if ($(this).val() != "") {
|
|
|
sl += parseInt($(this).val());
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
$("#a_hjsl").html(sl);
|
|
|
|
|
|
}
|
|
|
function AddGoods() {
|
|
|
if ($("#txt_hwbhmc").val() == "") {
|
|
|
alert("请输入要查询的条件");
|
|
|
return;
|
|
|
}
|
|
|
ReadGoodsDetail();
|
|
|
}
|
|
|
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 GetMoneyCode() {
|
|
|
var param = new Object();
|
|
|
param.PlatId = 1;
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../SysManage/SysManageService.asmx/GetMoneyListForTM",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
if (data.d != null) {
|
|
|
$(data.d).each(function () {
|
|
|
if (this.MCode == "USD")
|
|
|
$("#txtMoneyCode").append("<option value='" + this.MCode + "' selected='selected'>" + this.MName + "</option>");
|
|
|
else
|
|
|
$("#txtMoneyCode").append("<option value='" + this.MCode + "'>" + this.MName + "</option>");
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function fopen() {
|
|
|
|
|
|
$.fancybox({
|
|
|
'width': '40%',
|
|
|
'height': '40%',
|
|
|
'autoScale': false,
|
|
|
'transitionIn': 'elastic',
|
|
|
'transitionOut': 'elastic',
|
|
|
'href': '#test3',
|
|
|
'onComplete': function () {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
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>");
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
var GoodsList = new Array();
|
|
|
function ReadGoodsDetail() {
|
|
|
|
|
|
var param = new Object();
|
|
|
param.IsLeft = 0;
|
|
|
param.GoodsCode = $("#txt_hwbhmc").val();
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "../CaiGou/CaiGouService.asmx/GetGoodsSPDetailNew",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
datagrid2.DataBind(data.d);
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
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) {
|
|
|
$("#txtShopName").html(data.d.ShopName);
|
|
|
$("#txtPlatOrderCode").html(data.d.PlatOrderCode);
|
|
|
if (data.d.IsJoin == 1)
|
|
|
$("#chk_hb").attr("checked", "checked");
|
|
|
|
|
|
$("#txtTotalPrice").val(data.d.TotalPrice);
|
|
|
if (data.d.OrderDate != null)
|
|
|
$("#txtOrderDate").html(data.d.OrderDate.localeFormat("yyyy-MM-dd"));
|
|
|
if (data.d.InDate != null)
|
|
|
$("#txtInDate").html(data.d.InDate.localeFormat("yyyy-MM-dd"));
|
|
|
$("#txtRevName").val(data.d.RevName);
|
|
|
$("#txtRevCountry").val(data.d.RevCountry);
|
|
|
$("#txtRevAddr").val(data.d.RevAddr);
|
|
|
$("#txtRevPhone").val(data.d.RevPhone);
|
|
|
$("#txtRevPostCode").val(data.d.RevPostCode);
|
|
|
$("#txtPost").val(data.d.Post);
|
|
|
$("#a_post").html(data.d.Post);
|
|
|
|
|
|
$("#txtOrderLevel").val(data.d.OrderLevel);
|
|
|
$("#txtTrackCode").val(data.d.TrackCode);
|
|
|
$("#txtErrorInfo").html(data.d.ErrorInfo);
|
|
|
$("#txtBuyRemark").html(data.d.BuyRemark);
|
|
|
$("#txtLeaveWord").html(data.d.LeaveWord);
|
|
|
|
|
|
$("#txtRevProvince").val(data.d.RevProvince);
|
|
|
$("#txtRevCity").val(data.d.RevCity);
|
|
|
$("#txtRevArea").val(data.d.RevArea);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
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 = "型号描述";
|
|
|
|
|
|
col.CellTemplate = "<span>{Bind TypeDesc}<span>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "货物信息";
|
|
|
col.CellTemplate = "<a>{Bind GoodsSKU}</a>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
//col = new nblf.ui.DataGridColumn();
|
|
|
//col.HeaderText = "当前库存";
|
|
|
|
|
|
//col.CellTemplate = "<span>{Bind CKGoodsNum}<span>";
|
|
|
//Array.add(datagrid1.Columns, col);
|
|
|
//col = new nblf.ui.DataGridColumn();
|
|
|
//col.HeaderText = "购买途中";
|
|
|
|
|
|
//col.CellTemplate = "<span>{Bind GoodsInNum}<span>";
|
|
|
//Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "购买单价";
|
|
|
col.Width = "70px";
|
|
|
col.CellTemplate = "<input type='text' precision='2' min='0' max='10000000' precision='0' style='width:70px;' class='editTextbox' ColName='GoodsPrice' value='{Bind GoodsPrice}'/>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "购买数量";
|
|
|
col.Width = "70px";
|
|
|
col.CellTemplate = "<input type='text' min='0' max='10000000' precision='0' style='width:70px;' class='editTextbox' ColName='GoodsNum' value='{Bind GoodsNum}'/>";
|
|
|
Array.add(datagrid1.Columns, col);
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
|
col.HeaderText = "操作";
|
|
|
col.Width = "80px";
|
|
|
col.CellTemplate = "<input CommandName='DelGoods(this)' class='btnClass dgbtnDel' type='button' value='删除'></input>";
|
|
|
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 DelGoods(obj) {
|
|
|
|
|
|
if (window.confirm('确定要删除吗?') == false) return;
|
|
|
datagrid1.UpdateDataSource();
|
|
|
datagrid1.Del_Row(rowindex);
|
|
|
heji();
|
|
|
hesl();
|
|
|
}
|
|
|
function CreateDataGrid5() {
|
|
|
var col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "货物名称";
|
|
|
|
|
|
col.CellTemplate = "<a>{Bind GoodsName}</a>";
|
|
|
|
|
|
Array.add(datagrid5.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "新编号";
|
|
|
col.CellTemplate = "<a>{Bind GoodsCode}</a>";
|
|
|
Array.add(datagrid5.Columns, col);
|
|
|
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "老编号";
|
|
|
col.CellTemplate = "<a>{Bind GoodsOldCode}</a>";
|
|
|
Array.add(datagrid5.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "型号";
|
|
|
col.CellTemplate = "<a>{Bind TypeCode}</a>";
|
|
|
Array.add(datagrid5.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "描述";
|
|
|
col.CellTemplate = "<a>{Bind TypeDesc}</a>";
|
|
|
Array.add(datagrid5.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
col.HeaderText = "购买数量";
|
|
|
col.CellTemplate = "<input type='text' min='0' max='10000000' precision='0' style='width:50px;' class='editTextbox' did='{Bind DetailId}' dname='{Bind GoodsName}' dgcode='{Bind GoodsCode}' dgocode='{Bind GoodsOldCode}' dtdesc='{Bind TypeDesc}' dtcode='{Bind TypeCode}' value='0'/>";
|
|
|
Array.add(datagrid5.Columns, col);
|
|
|
col = new nblf.ui.DataGridColumn();
|
|
|
|
|
|
|
|
|
datagrid5.IsFixHeader = false;
|
|
|
datagrid5.ShowIndexColumn = false;
|
|
|
datagrid5.AllowPaging = false;
|
|
|
//datagrid1.Height = "260px";
|
|
|
datagrid5.SelectMode = nblf.ui.SelectMode.None;
|
|
|
datagrid5.Init();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
function FindGoods() {
|
|
|
if ($("#txt_sku").val() == "") {
|
|
|
alert("请输入货物sku");
|
|
|
return;
|
|
|
}
|
|
|
var param = new Object();
|
|
|
|
|
|
param.SKU = $("#txt_sku").val();
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/GetGoodsModelFromSku",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
DetailId = data.d.DetailId;
|
|
|
$("#a_goodsname").html(data.d.GoodsName);
|
|
|
|
|
|
$("#a_typecode").html(data.d.TypeDesc);
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
alert("该sku对应货物不存在");
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function GetSelectGoods2() {
|
|
|
if ($("#txt_hwbhmc2").val() == "") {
|
|
|
|
|
|
alert("请输入查询条件");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var param = new Object();
|
|
|
param.TJ = $("#select_tj2").val();
|
|
|
param.SKU = $("#txt_hwbhmc2").val();
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/GetGoodsModelFromGoodsCode",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
|
|
|
if (data.d != null) {
|
|
|
|
|
|
datagrid5.DataBind(data.d);
|
|
|
$("input[did]").MaskedTextBox();
|
|
|
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
alert("该货物查询不到");
|
|
|
datagrid5.DataBind(null);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function AddBuy() {
|
|
|
var list = new Array();
|
|
|
$("input[did]").each(function () {
|
|
|
if ($(this).val() > 0) {
|
|
|
|
|
|
var md = new Object();
|
|
|
|
|
|
md.GoodsNum = $(this).val();
|
|
|
md.DetailId = $(this).attr("did");
|
|
|
md.TypeDesc = $(this).attr("dtdesc");
|
|
|
if ($(this).attr("dgcode") != "")
|
|
|
md.GoodsSKU = $(this).attr("dgcode") + "-" + $(this).attr("dtcode");
|
|
|
else
|
|
|
md.GoodsSKU = $(this).attr("dgocode") + "-" + $(this).attr("dtcode");
|
|
|
|
|
|
md.GoodsPrice = 0;
|
|
|
md.GoodsName = $(this).attr("dname");
|
|
|
Array.add(list, md);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
if (list == null || list.length == 0) {
|
|
|
alert("请在要购买的货物数量处填写数量");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
$(list).each(function () {
|
|
|
var did = this.DetailId;
|
|
|
var flag = false;
|
|
|
$(GoodsList).each(function () {
|
|
|
var rdid = this.DetailId;
|
|
|
if (did == rdid) {
|
|
|
flag = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
if (flag == false) {
|
|
|
var md = new Object();
|
|
|
md.DetailId = this.DetailId;
|
|
|
md.GoodsName = this.GoodsName;
|
|
|
md.GoodsSKU = this.GoodsSKU;
|
|
|
md.TypeDesc = this.TypeDesc;
|
|
|
// md.GoodsInNum = this.GoodsInNum;
|
|
|
// md.CKGoodsNum = this.GoodsNum;
|
|
|
md.GoodsPrice = 0;
|
|
|
md.GoodsNum = this.GoodsNum;
|
|
|
|
|
|
Array.add(GoodsList, md);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
datagrid1.DataBind(GoodsList);
|
|
|
$("#DataGrid1 input[precision]").MaskedTextBox();
|
|
|
$.fancybox.close();
|
|
|
|
|
|
}
|
|
|
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").val(data.d.TrackCode);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function ChangeExpress() {
|
|
|
if ($("#txtPost").val()==0 && $("#txtPost").val() == $("#a_post").html()) {
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
var param = new Object();
|
|
|
|
|
|
|
|
|
param.OrderId = OrderId;
|
|
|
param.PostId = $("#txtPost").val();
|
|
|
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/ChangeOrderPost",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if(data.d!=null)
|
|
|
$("#txtTrackCode").val(data.d);
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
function SaveOrder() {
|
|
|
if ($("#txtOrderCode").val() =="") {
|
|
|
|
|
|
alert("请输入订单号");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#select_plat").val() == "0") {
|
|
|
|
|
|
alert("请选择平台");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#txtOrderDate").val() == "") {
|
|
|
|
|
|
alert("请填写订单日期");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#select_shop").val() == "0") {
|
|
|
|
|
|
alert("请选择店铺");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#txtTotalPrice").val() == "") {
|
|
|
|
|
|
alert("请填写订单金额");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#txtRevAddr").val() == "") {
|
|
|
|
|
|
alert("请填收件人详细地址");
|
|
|
return;
|
|
|
}
|
|
|
if ($("#txtRevName").val() == "") {
|
|
|
|
|
|
alert("请填收件人");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if ($("#txtRevPostCode").val() == "") {
|
|
|
|
|
|
alert("请填邮编");
|
|
|
return;
|
|
|
}
|
|
|
//if ($("#txtPost").val() == "0") {
|
|
|
|
|
|
// alert("请选择发货物流方式");
|
|
|
// return;
|
|
|
//}
|
|
|
if ($("#txtRevAddr").val() == "") {
|
|
|
|
|
|
alert("请填收件人详细地址");
|
|
|
return;
|
|
|
}
|
|
|
if (GoodsList == null || GoodsList.length==0)
|
|
|
{
|
|
|
|
|
|
alert("请选择要购买的货物");
|
|
|
return;
|
|
|
}
|
|
|
var error = "";
|
|
|
datagrid1.UpdateDataSource();
|
|
|
$(GoodsList).each(function () {
|
|
|
if(this.GoodsPrice==null||this.GoodsPrice=="")
|
|
|
{
|
|
|
|
|
|
error+= this.GoodsSKU+" 货物金额没填;";
|
|
|
|
|
|
}
|
|
|
if (this.GoodsNum == null||this.GoodsNum == "") {
|
|
|
|
|
|
error += this.GoodsSKU + " 货物数量没填;";
|
|
|
|
|
|
}
|
|
|
});
|
|
|
if (error != "")
|
|
|
{
|
|
|
|
|
|
alert(error);
|
|
|
return;
|
|
|
}
|
|
|
var param = new Object();
|
|
|
var Model = new Object();
|
|
|
Model.OrderId = 0;
|
|
|
Model.PlatId = $("#select_plat").val();
|
|
|
Model.ShopId = $("#select_shop").val();
|
|
|
Model.OrderCode = $("#txtOrderCode").val();
|
|
|
Model.PlatOrderCode = $("#txtOrderCode").val();
|
|
|
Model.OrderLevel = $("#txtOrderLevel").val();
|
|
|
Model.TotalPrice = $("#txtTotalPrice").val();
|
|
|
Model.TotalWeight = $("#txtTotalWeight").val();
|
|
|
Model.GoodsNum = $("#a_hjsl").html();
|
|
|
Model.OrderDate = $("#txtOrderDate").val();
|
|
|
if ($("#txtOutDate").val()!="")
|
|
|
Model.OrderOutDate = $("#txtOutDate").val();
|
|
|
|
|
|
|
|
|
Model.IsFba = 0;
|
|
|
if ($("#chk_hwc").is(":checked") == true)
|
|
|
Model.IsFba = 1;
|
|
|
Model.MoneyCode = $("#txtMoneyCode").val();
|
|
|
Model.RevName = $("#txtRevName").val();
|
|
|
Model.RevCountry = $("#txtRevCountry").val();
|
|
|
Model.RevAddr = $("#txtRevAddr").val();
|
|
|
Model.RevPhone = $("#txtRevPhone").val();
|
|
|
Model.RevMoblie = $("#txtRevMoblie").val();
|
|
|
Model.RevPostCode = $("#txtRevPostCode").val();
|
|
|
Model.SendInfo = $("#txtSendInfo").val();
|
|
|
Model.ErrorInfo = $("#txtErrorInfo").val();
|
|
|
Model.Post = $("#txtPost").val();
|
|
|
Model.PostFee = $("#txtPostFee").val();
|
|
|
Model.TrackCode = $("#txtTrackCode").val();
|
|
|
Model.BuyRemark = $("#txtBuyRemark").val();
|
|
|
Model.RevProvince = $("#txtRevProvince").val();
|
|
|
Model.RevCity = $("#txtRevCity").val();
|
|
|
Model.RevArea = $("#txtRevArea").val();
|
|
|
|
|
|
Model.OrderState = 1;
|
|
|
param.Model = Model;
|
|
|
|
|
|
param.GoodsList = GoodsList;
|
|
|
|
|
|
|
|
|
|
|
|
WindowLoadModel.Show();
|
|
|
$.ajax({
|
|
|
url: "DD_OrderService.asmx/SaveOrderForTM",
|
|
|
data: Sys.Serialization.JavaScriptSerializer.serialize(param),
|
|
|
async: false,
|
|
|
success: function (data) {
|
|
|
WindowLoadModel.Hide();
|
|
|
if (data.d != "") {
|
|
|
alert(data.d);
|
|
|
return;
|
|
|
}
|
|
|
else {
|
|
|
alert("保存成功");
|
|
|
window.close();
|
|
|
window.parent.CloseTab("订单新增", "订单信息");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
</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 style="width: 110px;" class="f1">
|
|
|
货物编号/名称/SKU:
|
|
|
</td>
|
|
|
<td align="left" colspan="3">
|
|
|
<input id="txt_hwbhmc" class="editTextbox" style="width:120px;" type="text" />
|
|
|
|
|
|
</td>
|
|
|
|
|
|
<td><input id="Button1" type="button" value="查询" class="btnClass btnClassFind" onclick="AddGoods();"/></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td align="left" colspan="5">
|
|
|
<div style="height:280px;overflow:auto">
|
|
|
<div id="DataGrid2"></div></div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td align="center" colspan="5">
|
|
|
<input id="btn_Save" type="button" class="btnClass btnClassSave" value="添 加" /> <input
|
|
|
id="btn_Cancel" type="button" class="btnClass btnClassClose" value="关 闭" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
<div id="test3" title="货物" style="width:680px; height:350px;">
|
|
|
<table width="95%" class="tableAll" border="1" ellspacing="0" cellpadding="2">
|
|
|
<tr>
|
|
|
<td style="width: 110px;" class="f1">
|
|
|
<select id="select_tj2" class="selectClass" style="width: 120px" name="D5">
|
|
|
<option value="1">货物编号</option>
|
|
|
<option value="2">货物名称</option>
|
|
|
<option value="3">SKU</option>
|
|
|
</select>
|
|
|
</td>
|
|
|
<td align="left" colspan="4">
|
|
|
<input id="txt_hwbhmc2" class="editTextbox" style="width:120px;" type="text" /> <input id="btn_sch2" type="button" value="查询" class="btnClass btnClassFind" onclick="GetSelectGoods2();"/>
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
<tr><td align="left" colspan="5"> <font color="red">注:编号和型号中间可以用空格或者-隔开查询,例如:ABC001 002或者ABC001-002</font></td></tr>
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td align="left" colspan="5">
|
|
|
<div style="height:150px;overflow:auto">
|
|
|
<div id="DataGrid5"></div></div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td align="center" colspan="5">
|
|
|
<input id="btn_Save5" type="button" class="btnClass btnClassSave" value="保 存" /> <input
|
|
|
id="btn_Cancel5" type="button" class="btnClass btnClassClose" value="关 闭" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<div class="title_ico">
|
|
|
新增订单
|
|
|
</div>
|
|
|
|
|
|
<table border="1" cellpadding="0" cellspacing="0" style="width: 99%;" align="center" class="tableAll">
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
<font color="red" style="font-weight:bolder">*</font>
|
|
|
订单号:
|
|
|
</td>
|
|
|
<td>
|
|
|
|
|
|
<input id="txtOrderCode" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
<td style="width: 120px" class="f1"> <font color="red" style="font-weight:bolder">*</font> 平台店铺:
|
|
|
</td>
|
|
|
<td>
|
|
|
|
|
|
|
|
|
<select id="select_plat" class="selectClass" style="width: 100px" name="D2">
|
|
|
</select><select id="select_shop" class="selectClass" style="width: 100px" name="D3">
|
|
|
</select></td>
|
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
<font color="red" style="font-weight:bolder">*</font>
|
|
|
订单日期:</td>
|
|
|
<td> <input id="txtOrderDate" type="text" style="width: 200px;" onfocus="WdatePicker()" class="editTextbox" />
|
|
|
</td>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
最迟发货日期:</td>
|
|
|
|
|
|
<td> <input id="txtOutDate" type="text" style="width: 200px;" class="editTextbox" onfocus="WdatePicker()" /></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
<font color="red" style="font-weight:bolder">*</font> 国家简称:</td>
|
|
|
<td>
|
|
|
<input id="txtRevCountry" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
收件人省(州):</td>
|
|
|
<td>
|
|
|
<input id="txtRevProvince" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
收件人市:</td>
|
|
|
<td>
|
|
|
<input id="txtRevCity" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
收件人区:</td>
|
|
|
<td>
|
|
|
<input id="txtRevArea" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
<font color="red" style="font-weight:bolder">*</font> 收件详细地址:</td>
|
|
|
<td colspan="3">
|
|
|
<input id="txtRevAddr" type="text" style="width: 90%;" class="editTextbox" /></td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
<font color="red" style="font-weight:bolder">*</font>
|
|
|
收件人:</td>
|
|
|
<td>
|
|
|
<input id="txtRevName" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
<td style="width: 120px" class="f1">联系电话/手机:</td>
|
|
|
<td>
|
|
|
<input id="txtRevPhone" type="text" style="width: 200px;" class="editTextbox" />/<input id="txtRevMoblie" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
<font color="red" style="font-weight:bolder">*</font> 邮编:</td>
|
|
|
<td>
|
|
|
<input id="txtRevPostCode" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
<td style="width: 120px" class="f1">
|
|
|
<font color="red" style="font-weight:bolder">*</font>
|
|
|
物流方式:</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: 120px" class="f1">发货等级:</td>
|
|
|
<td>
|
|
|
<input id="txtOrderLevel" type="text" style="width: 200px;" class="editTextbox" value="1"/></td>
|
|
|
<td style="width: 120px" class="f1">跟踪码:</td>
|
|
|
<td>
|
|
|
<input id="txtTrackCode" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">货物重量:</td>
|
|
|
<td>
|
|
|
<input id="txtTotalWeight" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
<td style="width: 120px" class="f1">物流费用:</td>
|
|
|
<td>
|
|
|
<input id="txtPostFee" type="text" style="width: 200px;" class="editTextbox" /></td>
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">购买商品:</td>
|
|
|
<td colspan="3"> <a id="btn_add"
|
|
|
style="cursor: pointer; text-decoration: underline; color: blue;">
|
|
|
<img alt="" src="../images/add.ico" />添加商品</a>
|
|
|
<div id="DataGrid1" class="DataGridStyle"></div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1"> </td>
|
|
|
<td>
|
|
|
<input id="chk_hwc" type="checkbox"/>是否海外仓发货</td>
|
|
|
|
|
|
<td colspan="2">
|
|
|
<font color="red" style="font-weight:bolder">*</font> 数量:<a id="a_hjsl" style="font-size:x-large;">0</a>个 <font color="red" style="font-weight:bolder">*</font> 总金额:<input id="txtTotalPrice" type="text" style="width:100px;" class="editTextbox" /><select id="txtMoneyCode" class="selectClass" style="width: 100px" name="D4">
|
|
|
</select></td>
|
|
|
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td style="width: 120px" class="f1">留言备注:</td>
|
|
|
<td colspan="3">
|
|
|
<textarea id="txtBuyRemark" cols="100" rows="4" style="width: 90%"></textarea></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td colspan="4" align="center">
|
|
|
<input id="cmdSave" type="button" value="保 存" class="btnClass btnClassSave" onclick="SaveOrder();" />
|
|
|
<input id="cmdBack" type="button" value="返 回" class="btnClass btnClassBack" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
</body>
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|