diff --git a/TradeManage/HuoWu/HW_GoodsAddForTM.aspx b/TradeManage/HuoWu/HW_GoodsAddForTM.aspx index a36bea9..451872a 100644 --- a/TradeManage/HuoWu/HW_GoodsAddForTM.aspx +++ b/TradeManage/HuoWu/HW_GoodsAddForTM.aspx @@ -44,7 +44,14 @@ var XPId = 0; var GoodsModel = null; var Title = "货物信息"; - var UserId = "<%=Session["UserId"]%>"; + var UserId = "<%=Session["UserId"]%>"; + var TemuChengBen = { + JinJia: "0", + YunFei: "0", + TouCheng: "0", + HuoWuShuiFei: "0", + YuGuJiaGe: "0", + } var WindowLoadModel = new WindowLoad(); $(document).ready(function () { WindowLoadModel.ApplicationPath = "../"; @@ -95,7 +102,8 @@ GetUrl(); GetUrl2(); GetPostNum(); - GetFedexModel(); + GetFedexModel(); + GetTemuFee(); } //else @@ -651,6 +659,74 @@ } + + //获取temu成本预估 + function GetTemuFee() { + var param = { + GoodsId: GoodsId + } + $.ajax({ + url: "../DD_OrderServiceNew.asmx/GetListTemuChengBen", + data: Sys.Serialization.JavaScriptSerializer.serialize(param), + success: function (data) { + var JinJia = (GoodsModel.InPrice / usdfeerate).toFixed(2) + var TouCheng = (GoodsModel.Solid * 130).toFixed(2) + var HuoWuShuiFei = (GoodsModel.Solid * 130).toFixed(2) + var YuGuJiaGe = Number(JinJia) + Number(TouCheng) + Number(HuoWuShuiFei) + TemuChengBen = { + JinJia: JinJia, + YunFei: "0", + TouCheng: TouCheng, + HuoWuShuiFei: HuoWuShuiFei, + YuGuJiaGe: YuGuJiaGe.toFixed(2), + } + if (data.d.DataSource && data.d.DataSource.length) { + TemuChengBen = data.d.DataSource[0] + } + $("#txt_temu_JinJia").val(TemuChengBen.JinJia) + $("#txt_temu_YunFei").val(TemuChengBen.YunFei) + $("#txt_temu_TouCheng").val(TemuChengBen.TouCheng) + $("#txt_temu_HuoWuShuiFei").val(TemuChengBen.HuoWuShuiFei) + $('#txt_temu_YuGuJiaGe').text(TemuChengBen.YuGuJiaGe + '$') + } + }); + + } + + //计算并保存temu成本预估 + function SaveTemuFee() { + var JinJia = $("#txt_temu_JinJia").val() + var YunFei = $("#txt_temu_YunFei").val() + var TouCheng = $("#txt_temu_TouCheng").val() + var HuoWuShuiFei = $("#txt_temu_HuoWuShuiFei").val() + if (!JinJia || !YunFei || !TouCheng || !HuoWuShuiFei) { + alert("请把信息填写完整"); + return; + } + var YuGuJiaGe = Number(JinJia) + Number(YunFei) + Number(TouCheng) + Number(HuoWuShuiFei) + $('#txt_temu_YuGuJiaGe').text(YuGuJiaGe+'$') + var param = { + Model: { + ID: TemuChengBen.ID, + GoodsId: GoodsId, + JinJia: JinJia, + YunFei: YunFei, + TouCheng: TouCheng, + HuoWuShuiFei: HuoWuShuiFei, + YuGuJiaGe: YuGuJiaGe, + } + } + $.ajax({ + url: "../DD_OrderServiceNew.asmx/Save_TemuChengBen", + data: Sys.Serialization.JavaScriptSerializer.serialize(param), + + success: function (data) { + WindowLoadModel.Hide(); + GetFedexModel(); + } + }); + } + function SumYGFee() { if(GoodsModel!=null) @@ -4776,6 +4852,19 @@ function selectE(p,c) { type="button" value="计算" /> + + + temu成本预估: + + + 进价: + +运费: + +货物税费: + +头程: + =预计价格:0$   + + + diff --git a/TradeManage/HuoWu/HW_GoodsDetailList2.aspx b/TradeManage/HuoWu/HW_GoodsDetailList2.aspx index 6853fb6..adb7aec 100644 --- a/TradeManage/HuoWu/HW_GoodsDetailList2.aspx +++ b/TradeManage/HuoWu/HW_GoodsDetailList2.aspx @@ -3001,6 +3001,7 @@ + diff --git a/TradeManage/HuoWuServiceNew.asmx.cs b/TradeManage/HuoWuServiceNew.asmx.cs index 2aea6a7..fbc2346 100644 --- a/TradeManage/HuoWuServiceNew.asmx.cs +++ b/TradeManage/HuoWuServiceNew.asmx.cs @@ -447,7 +447,15 @@ namespace TradeManage public JsonModel> GetGoodsDetailListNew22(int platid, int MUserId, int cpzt, int GNum, int TJ1, int IsYC, int IsJQ, int StoreId, int AQNum, int AQNum2, string Name, string Supplier, int TJ2, int SNum, int ENum, int cgjh,int kh, int PageIndex, int PageSize, string Sort) { HuoWuData data = new HuoWuData(); - int num = Convert.ToInt32(base.Session["CompanyId"]); + int num = 0; + if (base.Session["CompanyId"] != null) + { + num = Convert.ToInt32(base.Session["CompanyId"]); + } + else + { + num = 1; + } RefParameterCollection where = new RefParameterCollection(); if (IsYC == 0) { @@ -475,7 +483,8 @@ namespace TradeManage where.Add("b.guserid_wayfair", "=", MUserId, DbType.Int32); else if (MUserId != 0 && platid == 21) where.Add("b.guserid_sheIn", "=", MUserId, DbType.Int32); - + else if (MUserId != 0 && platid == 23) + where.Add("b.guserid_temu", "=", MUserId, DbType.Int32); if (AQNum == 1) { where.Add("isnull(a.WestNum,0)-isnull(a.GoodsHJNum12,0)", "<", 0, DbType.Int32); diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index 0dbaa67..1977aa0 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -30614,10 +30614,10 @@ select @id"; try { string tsql = @" -SELECT a.[ID],a.[GoodsId],c.GoodsCode,[JinJia],[YunFei],[TouCheng],[HuoWuShuiFei],[YuGuJiaGe],[CreateUserId],[CreateTime] - FROM [newerpbak_cwk].[dbo].[TemuChengBen] a +SELECT top 1 a.[ID],a.[GoodsId],c.GoodsCode,[JinJia],[YunFei],[TouCheng],[HuoWuShuiFei],[YuGuJiaGe],[CreateUserId],[CreateTime] + FROM [dbo].[TemuChengBen] a inner join HW_GoodsInfo c on a.GoodsId=c.GoodsId -where a.GoodsId = @GoodsId "; +where a.GoodsId = @GoodsId order by a.CreateTime desc"; Database db = DatabaseFactory.CreateDatabase(); DbCommand cmd = db.GetSqlStringCommand(tsql); db.AddInParameter(cmd, "@GoodsId", DbType.Int32, GoodsId); diff --git a/TradeManageNew/HuoWuServiceNew.asmx.cs b/TradeManageNew/HuoWuServiceNew.asmx.cs index ff88dda..3b2a81e 100644 --- a/TradeManageNew/HuoWuServiceNew.asmx.cs +++ b/TradeManageNew/HuoWuServiceNew.asmx.cs @@ -451,7 +451,18 @@ namespace TradeManageNew public JsonModel> GetGoodsDetailListNew22(int platid,int MUserId,int cpzt,int GNum, int TJ1, int IsYC, int IsJQ, int StoreId, int AQNum, int AQNum2, string Name, string Supplier, int TJ2, int SNum, int ENum, int cgjh, int kh, int PageIndex, int PageSize, string Sort) { HuoWuData data = new HuoWuData(); - int num = Convert.ToInt32(base.Session["CompanyId"]); + int num = 0; + if (base.Session["CompanyId"] != null) + { + num = Convert.ToInt32(base.Session["CompanyId"]); + } + else + { + num = 1; + } + + + RefParameterCollection where = new RefParameterCollection(); if (cpzt > 0) { @@ -497,6 +508,8 @@ namespace TradeManageNew where.Add("b.guserid_wayfair", "=", MUserId, DbType.Int32); else if (MUserId != 0 && platid == 21) where.Add("b.guserid_sheIn", "=", MUserId, DbType.Int32); + else if (MUserId != 0 && platid == 23) + where.Add("b.guserid_temu", "=", MUserId, DbType.Int32); if (AQNum == 1) {