diff --git a/TradeManageNew/CaiGou/GoodsReportPrice.aspx b/TradeManageNew/CaiGou/GoodsReportPrice.aspx index 90d4082..12bc57c 100644 --- a/TradeManageNew/CaiGou/GoodsReportPrice.aspx +++ b/TradeManageNew/CaiGou/GoodsReportPrice.aspx @@ -136,7 +136,15 @@ Array.add(datagrid1.Columns, col); col = new nblf.ui.DataGridColumn(); col.HeaderText = "意向箱数"; - col.CellTemplate = "{Bind Cantidad}"; + col.CellTemplate = `{Bind orginData}`; + col.CellFormatter = function (data) { + var num = data.Cantidad + if (data.IsCustomerUpdate) { + return `${num}` + } else { + return `${num}` + } + } Array.add(datagrid1.Columns, col); col = new nblf.ui.DataGridColumn(); col.HeaderText = "总体积"; @@ -193,7 +201,7 @@ col = new nblf.ui.DataGridColumn(); col.HeaderText = "操作员工"; - col.CellTemplate = "{Bind UserName}"; + col.CellTemplate = "{Bind UpdateName}"; Array.add(datagrid1.Columns, col); col = new nblf.ui.DataGridColumn(); col.HeaderText = "报价时间"; @@ -313,7 +321,9 @@ data: Sys.Serialization.JavaScriptSerializer.serialize(param), success: function (data) { WindowLoadModel.Hide(); - + data.d.data.datas.forEach(item => { + item.orginData = JSON.parse(JSON.stringify(item)) + }) var newDatas = data.d.data.datas; $(newDatas).each(function (i) { newDatas[i].newCreateDate = GetNewDate(newDatas[i].CreateDate); diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index 8076bb6..6f5e739 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -27859,11 +27859,11 @@ end "; string tsql = @" if @Id>0 begin -UPDATE [dbo].[DT_Quote_New] SET [Foto] = @Foto, [Nombre] = @Nombre, [Caracteristicas] =@Caracteristicas, [Modelo] =@Modelo, [Recio] =@Recio, [QtyOrCtn] = @QtyOrCtn, [Cbm] = @Cbm, [AllCbm] = @AllCbm, [Gw] =@Gw, [Nw] = @Nw, [CompanyId] = @CompanyId, [UserId] = @UserId, [CreateDate] = @CreateDate, [IsAuthority] =@IsAuthority, [FactoryName] =@FactoryName, [FactoryImg] = @FactoryImg, [Cantidad] = @Cantidad, [Valor] = @Valor, [ClientId] = @ClientId, [CityName] = @CityName, [DTQuoteNo] = @DTQuoteNo WHERE [Id] = @Id; +UPDATE [dbo].[DT_Quote_New] SET [Foto] = @Foto, [Nombre] = @Nombre, [Caracteristicas] =@Caracteristicas, [Modelo] =@Modelo, [Recio] =@Recio, [QtyOrCtn] = @QtyOrCtn, [Cbm] = @Cbm, [AllCbm] = @AllCbm, [Gw] =@Gw, [Nw] = @Nw, [CompanyId] = @CompanyId, [UserId] = @UserId, [CreateDate] = @CreateDate, [IsAuthority] =@IsAuthority, [FactoryName] =@FactoryName, [FactoryImg] = @FactoryImg, [Cantidad] = @Cantidad, [Valor] = @Valor, [ClientId] = @ClientId, [CityName] = @CityName, [DTQuoteNo] = @DTQuoteNo, [IsCustomerUpdate] = @IsCustomerUpdate, [UpdateName] = @UpdateName WHERE [Id] = @Id; end else begin -INSERT INTO [dbo].[DT_Quote_New] ([Foto], [Nombre], [Caracteristicas], [Modelo], [Recio], [QtyOrCtn], [Cbm],[AllCbm], [Gw], [Nw], [CompanyId], [UserId], [CreateDate], [IsAuthority], [FactoryName], [FactoryImg], [Cantidad], [Valor], [ClientId], [CityName], [DTQuoteNo]) VALUES (@Foto,@Nombre,@Caracteristicas,@Modelo,@Recio, @QtyOrCtn,@Cbm,@AllCbm,@Gw, @Nw,@CompanyId, @UserId, @CreateDate,@IsAuthority, @FactoryName, @FactoryImg,@Cantidad,@Valor,@ClientId,@CityName,@DTQuoteNo); +INSERT INTO [dbo].[DT_Quote_New] ([Foto], [Nombre], [Caracteristicas], [Modelo], [Recio], [QtyOrCtn], [Cbm],[AllCbm], [Gw], [Nw], [CompanyId], [UserId], [CreateDate], [IsAuthority], [FactoryName], [FactoryImg], [Cantidad], [Valor], [ClientId], [CityName], [DTQuoteNo],[IsCustomerUpdate],[UpdateName]) VALUES (@Foto,@Nombre,@Caracteristicas,@Modelo,@Recio, @QtyOrCtn,@Cbm,@AllCbm,@Gw, @Nw,@CompanyId, @UserId, @CreateDate,@IsAuthority, @FactoryName, @FactoryImg,@Cantidad,@Valor,@ClientId,@CityName,@DTQuoteNo,@IsCustomerUpdate,@UpdateName); set @Id=SCOPE_IDENTITY() end select @Id"; @@ -27889,8 +27889,10 @@ select @Id"; db.AddInParameter(cmd, "@CityName", DbType.String, Model.CityName); db.AddInParameter(cmd, "@DTQuoteNo", DbType.String, Model.DTQuoteNo); db.AddInParameter(cmd, "@Cantidad", DbType.Int32, Model.Cantidad); - db.AddInParameter(cmd, "@Valor", DbType.Decimal, Model.Valor); + db.AddInParameter(cmd, "@Valor", DbType.Decimal, Model.Valor); db.AddInParameter(cmd, "@ClientId", DbType.Int32, Model.ClientId); + db.AddInParameter(cmd, "@IsCustomerUpdate", DbType.Boolean, Model.IsCustomerUpdate); + db.AddInParameter(cmd, "@UpdateName", DbType.String, Model.UpdateName); resultId = Convert.ToInt32(db.ExecuteScalar(cmd)); } @@ -27918,6 +27920,25 @@ select @Id"; return model; } + //不传时间 + public static appShowMsg GetMsg_ClientToday_Nodate(int ClientId,string QuoteNo) + { + string sql = $"SELECT SUM(Valor) as AllValor,SUM(AllCbm) as AllCbm FROM [dbo].[DT_Quote_New] where ClientId = {ClientId} and DTQuoteNo = '{QuoteNo}';SELECT Id as ClientId,ClientName from JC_Client where Id = {ClientId};"; + + Database db = DatabaseFactory.CreateDatabase(); + DbCommand cmd = db.GetSqlStringCommand(sql); + DataSet ds = db.ExecuteDataSet(cmd); + var model1 = ds.Tables[0].Rows[0].ToModel(); + var model2 = ds.Tables[1].Rows[0].ToModel(); + appShowMsg model = new appShowMsg(); + model.ClientName = model2.ClientName; + model.ClientId = model2.ClientId; + model.AllValor = model1.AllValor; + model.AllCbm = model1.AllCbm; + + return model; + } + public static DT_Quote_NewTable GetModel_DT_QuoteNewTable(int Id) { string tsql = $"SELECT * FROM [dbo].[DT_Quote_New] where Id = {Id} "; diff --git a/TradeManageNew/ModelNew.cs b/TradeManageNew/ModelNew.cs index d6bf0fc..c34ce10 100644 --- a/TradeManageNew/ModelNew.cs +++ b/TradeManageNew/ModelNew.cs @@ -9739,6 +9739,15 @@ namespace TradeManageNew /// 报价单号 /// public string DTQuoteNo { get; set; } + /// + /// 是否为客户修改 + /// + public bool? IsCustomerUpdate { get; set; } + /// + /// UpdateName + /// + public string UpdateName { get; set; } + } public class appShowMsg diff --git a/TradeManageNew/SysManageServiceNew.asmx.cs b/TradeManageNew/SysManageServiceNew.asmx.cs index cecc337..cf8967f 100644 --- a/TradeManageNew/SysManageServiceNew.asmx.cs +++ b/TradeManageNew/SysManageServiceNew.asmx.cs @@ -15932,13 +15932,13 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr #endregion #region 返回单个客户今天的报价总金额和总体积 ok [WebMethod(EnableSession = true)] - public AppResultModel GetMsg_ClientToday(int ClientId,string newDate) + public AppResultModel GetMsg_ClientToday(int ClientId,string QuoteNo) { var resultModel = new AppResultModel(); try { //var newDate = DateTime.Now.ToShortDateString(); - var newappShowMsg = DataNew.GetMsg_ClientToday(ClientId, newDate); + var newappShowMsg = DataNew.GetMsg_ClientToday_Nodate(ClientId, QuoteNo); if (newappShowMsg == null) {