From f0226fac55f50b362d145ce969e66d41606a8b06 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期五, 30 七月 2021 14:13:16 +0800 Subject: [PATCH] 今日开发 订单优惠 下订单的时候计算优惠 访问申请 --- zhengcaioa/Model/zhengcaioaContext.cs | 120 ++ zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs | 54 + zhengcaioa/Services/AskService.cs | 131 ++ zhengcaioa/zhengcaioa/Views/AdmAsk/Askcost.cshtml | 20 zhengcaioa/zhengcaioa/Views/AdmAsk/AskCar.cshtml | 20 zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs | 239 +++++ zhengcaioa/Model/AdmAskYouHui.cs | 25 zhengcaioa/zhengcaioa/Views/AdmAsk/AskGood.cshtml | 20 zhengcaioa/zhengcaioa/Views/AdmAsk/AskOther.cshtml | 20 zhengcaioa/IServices/IAskService.cs | 11 zhengcaioa/zhengcaioa/Views/AdmAsk/AskBaiFang.cshtml | 394 ++++++++ zhengcaioa/zhengcaioa/Views/AdmAsk/AskSuggestion.cshtml | 20 zhengcaioa/Services/WfRunProcessService.cs | 698 +++++++++++++++ zhengcaioa/IServices/IWfRunProcessService.cs | 4 zhengcaioa/DTO/AdmAskYouHuiDTO.cs | 28 zhengcaioa/zhengcaioa/Views/CooperOrder/Index.cshtml | 31 zhengcaioa/zhengcaioa/Views/AdmAsk/Askovertime.cshtml | 20 表修改.sql | 295 ++++++ zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs | 7 zhengcaioa/zhengcaioa/Views/AdmAsk/AskYouHui.cshtml | 393 ++++++++ zhengcaioa/zhengcaioa/Views/AdmAsk/AskMarketingCost.cshtml | 20 zhengcaioa/zhengcaioa/Views/CooperOrder/Edit.cshtml | 58 zhengcaioa/DTO/AdmAskBaiFangDTO.cs | 28 zhengcaioa/zhengcaioa/Views/AdmAsk/AskPunishAppeal.cshtml | 20 zhengcaioa/Model/AdmAskBaiFang.cs | 25 25 files changed, 2,605 insertions(+), 96 deletions(-) diff --git a/zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs b/zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs index 0e905c0..92fedbb 100644 --- a/zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs +++ b/zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs @@ -242,7 +242,12 @@ CreateMap<AdmAskMarketingCost, AdmAskMarketingCostDTO>(); CreateMap<AdmAskMarketingCostDTO, AdmAskMarketingCost>(); - + + CreateMap<AdmAskYouHui, AdmAskYouHuiDTO>(); + CreateMap<AdmAskYouHuiDTO, AdmAskYouHui>(); + + CreateMap<AdmAskBaiFang, AdmAskBaiFangDTO>(); + CreateMap<AdmAskBaiFangDTO, AdmAskBaiFang>(); } } diff --git a/zhengcaioa/DTO/AdmAskBaiFangDTO.cs b/zhengcaioa/DTO/AdmAskBaiFangDTO.cs new file mode 100644 index 0000000..60db9bf --- /dev/null +++ b/zhengcaioa/DTO/AdmAskBaiFangDTO.cs @@ -0,0 +1,28 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace DTO +{ + public class AdmAskBaiFangDTO + { + public string Id { get; set; } + public string CustomerId { get; set; } + public string VisType { get; set; } + public string Jtype { get; set; } + public DateTime? BaiFangtime { get; set; } + public string BaiFangtimeName { get; set; } + public string Remark { get; set; } + public string ShenpiStatus { get; set; } + public string RecStatus { get; set; } + public string Creater { get; set; } + public DateTime Createtime { get; set; } + public string Modifier { get; set; } + public DateTime Modifytime { get; set; } + public string CreaterName { get; set; } + public string Tittle { get; set; } + public string Content { get; set; } + public string Tongguojujue { get; set; } + public string Step { get; set; } + } +} diff --git a/zhengcaioa/DTO/AdmAskYouHuiDTO.cs b/zhengcaioa/DTO/AdmAskYouHuiDTO.cs new file mode 100644 index 0000000..13ce8f4 --- /dev/null +++ b/zhengcaioa/DTO/AdmAskYouHuiDTO.cs @@ -0,0 +1,28 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace DTO +{ + public class AdmAskYouHuiDTO + { + public string Id { get; set; } + public string CustomerId { get; set; } + public string OrderType { get; set; } + public string Youhuistandard { get; set; } + public decimal? YouHui { get; set; } + public string YouHuiName { get; set; } + public string Remark { get; set; } + public string ShenpiStatus { get; set; } + public string RecStatus { get; set; } + public string Creater { get; set; } + public DateTime Createtime { get; set; } + public string Modifier { get; set; } + public DateTime Modifytime { get; set; } + public string CreaterName { get; set; } + public string Tittle { get; set; } + public string Content { get; set; } + public string Tongguojujue { get; set; } + public string Step { get; set; } + } +} diff --git a/zhengcaioa/IServices/IAskService.cs b/zhengcaioa/IServices/IAskService.cs index d88cc85..4af4021 100644 --- a/zhengcaioa/IServices/IAskService.cs +++ b/zhengcaioa/IServices/IAskService.cs @@ -30,5 +30,16 @@ //閿�鍞垂鐢ㄧ敵璇� ResultEntity SaveAskMarketingCost(AdmAskMarketingCostDTO admAsk); AdmAskMarketingCostDTO GetAskMarketingCost(string Id); + + + //浼樻儬鐢宠 + ResultEntity SaveAskYouHui(AdmAskYouHuiDTO admAsk); + AdmAskYouHuiDTO GetAskYouHui(string Id); + + List<AdmAskYouHuiDTO> GetAskYouHuiList(string CustomerId, string OrderType); + + //璁块棶璇风ず + ResultEntity SaveAskBaiFang(AdmAskBaiFangDTO admAsk); + AdmAskBaiFangDTO GetAskBaiFang(string Id); } } diff --git a/zhengcaioa/IServices/IWfRunProcessService.cs b/zhengcaioa/IServices/IWfRunProcessService.cs index 8dbe3e9..6694fba 100644 --- a/zhengcaioa/IServices/IWfRunProcessService.cs +++ b/zhengcaioa/IServices/IWfRunProcessService.cs @@ -38,5 +38,9 @@ ResultEntity WfAskOther(string DanjuId, string step, string tongguojujue, string Userid, string Content, string title, string version); ResultEntity WfAskPunishAppeal(string DanjuId, string step, string tongguojujue, string Userid, string Content, string title, string version); + + ResultEntity WfAskYouHui(string DanjuId, string step, string tongguojujue, string Userid, string Content, string title, string version); + + ResultEntity WfAskBaiFang(string DanjuId, string step, string tongguojujue, string Userid, string Content, string title, string version); } } diff --git a/zhengcaioa/Model/AdmAskBaiFang.cs b/zhengcaioa/Model/AdmAskBaiFang.cs new file mode 100644 index 0000000..2c781d7 --- /dev/null +++ b/zhengcaioa/Model/AdmAskBaiFang.cs @@ -0,0 +1,25 @@ +锘縰sing System; +using System.Collections.Generic; + +#nullable disable + +namespace zhengcaioa.Models +{ + public partial class AdmAskBaiFang + { + public string Id { get; set; } + public string CustomerId { get; set; } + public string VisType { get; set; } + public string Jtype { get; set; } + public DateTime? BaiFangtime { get; set; } + public string Remark { get; set; } + public string ShenpiStatus { get; set; } + public string RecStatus { get; set; } + public string Creater { get; set; } + public DateTime Createtime { get; set; } + public string Modifier { get; set; } + public DateTime Modifytime { get; set; } + public string CreaterName { get; set; } + public string Tittle { get; set; } + } +} diff --git a/zhengcaioa/Model/AdmAskYouHui.cs b/zhengcaioa/Model/AdmAskYouHui.cs new file mode 100644 index 0000000..2e833df --- /dev/null +++ b/zhengcaioa/Model/AdmAskYouHui.cs @@ -0,0 +1,25 @@ +锘縰sing System; +using System.Collections.Generic; + +#nullable disable + +namespace zhengcaioa.Models +{ + public partial class AdmAskYouHui + { + public string Id { get; set; } + public string CustomerId { get; set; } + public string OrderType { get; set; } + public string Youhuistandard { get; set; } + public decimal? YouHui { get; set; } + public string Remark { get; set; } + public string ShenpiStatus { get; set; } + public string RecStatus { get; set; } + public string Creater { get; set; } + public DateTime Createtime { get; set; } + public string Modifier { get; set; } + public DateTime Modifytime { get; set; } + public string CreaterName { get; set; } + public string Tittle { get; set; } + } +} diff --git a/zhengcaioa/Model/zhengcaioaContext.cs b/zhengcaioa/Model/zhengcaioaContext.cs index 39f2cf5..4bd4130 100644 --- a/zhengcaioa/Model/zhengcaioaContext.cs +++ b/zhengcaioa/Model/zhengcaioaContext.cs @@ -24,6 +24,7 @@ public virtual DbSet<HrSalaryAppeal> HrSalaryAppeal { get; set; } public virtual DbSet<SimCostYearView> SimCostYearView { get; set; } + public virtual DbSet<AdmAskBaiFang> AdmAskBaiFangs { get; set; } public virtual DbSet<AdmAskCar> AdmAskCars { get; set; } public virtual DbSet<AdmAskcost> AdmAskcosts { get; set; } public virtual DbSet<AdmAskGood> AdmAskGoods { get; set; } @@ -31,6 +32,7 @@ public virtual DbSet<AdmAskLeaveOff> AdmAskLeaveOffs { get; set; } public virtual DbSet<AdmAskMarketingCost> AdmAskMarketingCosts { get; set; } public virtual DbSet<AdmAskovertime> AdmAskovertimes { get; set; } + public virtual DbSet<AdmAskYouHui> AdmAskYouHuis { get; set; } public virtual DbSet<AdmAttendance> AdmAttendances { get; set; } public virtual DbSet<AdmAttendanceDtl> AdmAttendanceDtls { get; set; } public virtual DbSet<AdmAttendanceRule> AdmAttendanceRules { get; set; } @@ -122,6 +124,64 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.HasAnnotation("Relational:Collation", "Chinese_PRC_CI_AS"); + + modelBuilder.Entity<AdmAskBaiFang>(entity => + { + entity.ToTable("ADM_AskBaiFang"); + + entity.Property(e => e.Id).HasMaxLength(50); + + entity.Property(e => e.BaiFangtime).HasColumnType("datetime"); + + entity.Property(e => e.Creater) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("creater") + .HasDefaultValueSql("('1')"); + + entity.Property(e => e.CreaterName) + .HasMaxLength(50) + .HasColumnName("createrName"); + + entity.Property(e => e.Createtime) + .HasColumnType("datetime") + .HasColumnName("createtime") + .HasDefaultValueSql("(getdate())"); + + entity.Property(e => e.CustomerId).HasMaxLength(500); + + entity.Property(e => e.Jtype).HasMaxLength(50); + + entity.Property(e => e.Modifier) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("modifier") + .HasDefaultValueSql("('1')"); + + entity.Property(e => e.Modifytime) + .HasColumnType("datetime") + .HasColumnName("modifytime") + .HasDefaultValueSql("(getdate())"); + + entity.Property(e => e.RecStatus) + .IsRequired() + .HasMaxLength(1) + .HasColumnName("rec_status") + .HasDefaultValueSql("('A')"); + + entity.Property(e => e.Remark).HasMaxLength(500); + + entity.Property(e => e.ShenpiStatus) + .HasMaxLength(1) + .HasColumnName("shenpi_status") + .HasDefaultValueSql("('D')"); + + entity.Property(e => e.Tittle) + .HasMaxLength(50) + .HasColumnName("tittle"); + + entity.Property(e => e.VisType).HasMaxLength(50); + }); modelBuilder.Entity<AdmAskCar>(entity => { @@ -482,6 +542,66 @@ .HasColumnName("tittle"); }); + modelBuilder.Entity<AdmAskYouHui>(entity => + { + entity.ToTable("ADM_AskYouHui"); + + entity.Property(e => e.Id).HasMaxLength(50); + + entity.Property(e => e.Creater) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("creater") + .HasDefaultValueSql("('1')"); + + entity.Property(e => e.CreaterName) + .HasMaxLength(50) + .HasColumnName("createrName"); + + entity.Property(e => e.Createtime) + .HasColumnType("datetime") + .HasColumnName("createtime") + .HasDefaultValueSql("(getdate())"); + + entity.Property(e => e.CustomerId).HasMaxLength(50); + + entity.Property(e => e.Modifier) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("modifier") + .HasDefaultValueSql("('1')"); + + entity.Property(e => e.Modifytime) + .HasColumnType("datetime") + .HasColumnName("modifytime") + .HasDefaultValueSql("(getdate())"); + + entity.Property(e => e.OrderType).HasMaxLength(50); + + entity.Property(e => e.RecStatus) + .IsRequired() + .HasMaxLength(1) + .HasColumnName("rec_status") + .HasDefaultValueSql("('A')"); + + entity.Property(e => e.Remark).HasMaxLength(500); + + entity.Property(e => e.ShenpiStatus) + .HasMaxLength(1) + .HasColumnName("shenpi_status") + .HasDefaultValueSql("('D')"); + + entity.Property(e => e.Tittle) + .HasMaxLength(50) + .HasColumnName("tittle"); + + entity.Property(e => e.YouHui) + .HasColumnType("money") + .HasDefaultValueSql("((0))"); + + entity.Property(e => e.Youhuistandard).HasMaxLength(50); + }); + modelBuilder.Entity<AdmAskMarketingCost>(entity => { entity.ToTable("ADM_AskMarketingCost"); diff --git a/zhengcaioa/Services/AskService.cs b/zhengcaioa/Services/AskService.cs index 2e45284..dd1c59b 100644 --- a/zhengcaioa/Services/AskService.cs +++ b/zhengcaioa/Services/AskService.cs @@ -319,5 +319,136 @@ } #endregion + + #region 浼樻儬鐢宠 + public ResultEntity SaveAskYouHui(AdmAskYouHuiDTO admAsk) + { + ResultEntity resultEntity = new ResultEntity(); + try + { + AdmAskYouHui ask = _mapper.Map<AdmAskYouHui>(admAsk); + if (string.IsNullOrEmpty(admAsk.Id)) + { + ask.Id = Guid.NewGuid().ToString(); + admAsk.Id = ask.Id; + _context.AdmAskYouHuis.Add(ask); + } + else + { + var entity = _context.AdmAskYouHuis.Find(admAsk.Id); + + entity.CustomerId = admAsk.CustomerId; + entity.OrderType = admAsk.OrderType; + entity.Youhuistandard = admAsk.Youhuistandard; + entity.YouHui = admAsk.YouHui; + entity.Remark = admAsk.Remark; + + + entity.ShenpiStatus = admAsk.ShenpiStatus; + entity.CreaterName = admAsk.CreaterName; + entity.Tittle = admAsk.Tittle; + + + + entity.Modifier = admAsk.Modifier; + entity.Modifytime = DateTime.Now; + } + _context.SaveChanges(); + resultEntity.ReturnID = ask.Id; + resultEntity.Result = true; + } + catch (Exception ex) + { + resultEntity.Result = false; + resultEntity.Message = "淇濆瓨澶辫触锛岃鑱旂郴绠$悊鍛�"; + ex.Message.ToString(); + } + + return resultEntity; + } + + public AdmAskYouHuiDTO GetAskYouHui(string Id) + { + var entity = _context.AdmAskYouHuis.Where(e => e.RecStatus == "A" && e.Id == Id).FirstOrDefault(); + if (entity == null) + { + entity = new AdmAskYouHui(); + } + var leaveDTO = _mapper.Map<AdmAskYouHuiDTO>(entity); + return leaveDTO; + + } + + public List<AdmAskYouHuiDTO> GetAskYouHuiList(string CustomerId, string OrderType) + { + var entity = _context.AdmAskYouHuis.Where(e => e.RecStatus == "A" && e.ShenpiStatus == "A" && e.CustomerId == CustomerId && e.OrderType == OrderType && e.Createtime >= DateTime.Now.Date.AddDays(-8)).OrderByDescending(x=>x.Createtime).ToList(); + + var leaveDTO = _mapper.Map<List<AdmAskYouHuiDTO>>(entity); + return leaveDTO; + + } + #endregion + + #region 璁块棶璇风ず + public ResultEntity SaveAskBaiFang(AdmAskBaiFangDTO admAsk) + { + ResultEntity resultEntity = new ResultEntity(); + try + { + AdmAskBaiFang ask = _mapper.Map<AdmAskBaiFang>(admAsk); + if (string.IsNullOrEmpty(admAsk.Id)) + { + ask.Id = Guid.NewGuid().ToString(); + admAsk.Id = ask.Id; + _context.AdmAskBaiFangs.Add(ask); + } + else + { + var entity = _context.AdmAskBaiFangs.Find(admAsk.Id); + + entity.CustomerId = admAsk.CustomerId; + entity.VisType = admAsk.VisType; + entity.Jtype = admAsk.Jtype; + entity.BaiFangtime = admAsk.BaiFangtime; + entity.Remark = admAsk.Remark; + + + entity.ShenpiStatus = admAsk.ShenpiStatus; + entity.CreaterName = admAsk.CreaterName; + entity.Tittle = admAsk.Tittle; + + + + entity.Modifier = admAsk.Modifier; + entity.Modifytime = DateTime.Now; + } + _context.SaveChanges(); + resultEntity.ReturnID = ask.Id; + resultEntity.Result = true; + } + catch (Exception ex) + { + resultEntity.Result = false; + resultEntity.Message = "淇濆瓨澶辫触锛岃鑱旂郴绠$悊鍛�"; + ex.Message.ToString(); + } + + return resultEntity; + } + + public AdmAskBaiFangDTO GetAskBaiFang(string Id) + { + var entity = _context.AdmAskBaiFangs.Where(e => e.RecStatus == "A" && e.Id == Id).FirstOrDefault(); + if (entity == null) + { + entity = new AdmAskBaiFang(); + } + var leaveDTO = _mapper.Map<AdmAskBaiFangDTO>(entity); + return leaveDTO; + + } + + #endregion + } } diff --git a/zhengcaioa/Services/WfRunProcessService.cs b/zhengcaioa/Services/WfRunProcessService.cs index b99eece..5541884 100644 --- a/zhengcaioa/Services/WfRunProcessService.cs +++ b/zhengcaioa/Services/WfRunProcessService.cs @@ -5320,5 +5320,703 @@ return result; } + public ResultEntity WfAskYouHui(string DanjuId, string step, string tongguojujue, string Userid, string Content, string title, string version) + { + + ResultEntity result = new ResultEntity(); + result.Result = true; + + + WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "12").FirstOrDefault(); + if (wfRunProcessDTO != null) + { + version = wfRunProcessDTO.Version; + } + + + if (version == "v1") + { + if (step == "鎻愪氦") + { + //鏇存柊娴佺▼瀹炰緥 + // WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "12").FirstOrDefault(); + if (wfRunProcessDTO == null) + { + //鎻掑叆娴佺▼瀹炰緥 + wfRunProcessDTO = new WfRunProcessDTO(); + //wfRunProcessDTO.Applyno = + wfRunProcessDTO.Applytime = DateTime.Now; + wfRunProcessDTO.Applytiye = "12"; + wfRunProcessDTO.DanjuId = DanjuId; + wfRunProcessDTO.Content = title; + wfRunProcessDTO.Step = "鎬荤粡鐞嗗鎵�"; + wfRunProcessDTO.ShenpiStatus = "D"; + wfRunProcessDTO.Version = version; + wfRunProcessDTO.RecStatus = "A"; + wfRunProcessDTO.Creater = Userid; + wfRunProcessDTO.Createtime = DateTime.Now; + wfRunProcessDTO.Modifier = Userid; + wfRunProcessDTO.Modifytime = DateTime.Now; + wfRunProcessDTO.Deelurl = "/AdmAsk/AskYouHui?id=" + DanjuId; + result = this.save(wfRunProcessDTO); + if (result.Result == false) + { + return result; + } + //鏌ヨ澶勭悊浜� + var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "鎬荤粡鐞�").FirstOrDefault(); + if (hrPositions == null) + { + result.Result = false; + result.Message = "鏈壘鍒拌亴浣�"; + return result; + } + var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A") + join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId + select a + ).ToList(); + + if (pltUsers == null || pltUsers.Count == 0) + { + result.Result = false; + result.Message = "鏈壘鍒板鐞嗕汉"; + return result; + } + foreach (var pltUser in pltUsers) + { + //鎻掑叆寰呭姙 + WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO(); + wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id; + wfNeeddeelDTO.SendUserId = Userid; + wfNeeddeelDTO.DeelUserId = pltUser.Id; + wfNeeddeelDTO.Sendtime = DateTime.Now; + wfNeeddeelDTO.Resivetime = DateTime.Now; + wfNeeddeelDTO.Step = "鎬荤粡鐞嗗鎵�"; + wfNeeddeelDTO.NeeddeelType = "1"; + wfNeeddeelDTO.ChuliStatus = "0"; + wfNeeddeelDTO.Deelurl = "/AdmAsk/AskYouHui?id=" + DanjuId; + wfNeeddeelDTO.Content = ""; + wfNeeddeelDTO.Sort = 1; + wfNeeddeelDTO.RecStatus = "A"; + wfNeeddeelDTO.Creater = Userid; + wfNeeddeelDTO.Createtime = DateTime.Now; + wfNeeddeelDTO.Modifier = Userid; + wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime; + result = _wfNeeddeelService.save(wfNeeddeelDTO); + if (result.Result == false) + { + return result; + } + } + + //鎻掑叆鏂扮殑宸插姙 + WfHistory wfHistoryDTO1 = new WfHistory(); + wfHistoryDTO1.Id = Guid.NewGuid().ToString(); + wfHistoryDTO1.RunProcessId = wfRunProcessDTO.Id; + wfHistoryDTO1.SendUserId = Userid; + wfHistoryDTO1.DeelUserId = wfRunProcessDTO.Creater; + wfHistoryDTO1.Sendtime = DateTime.Now; + wfHistoryDTO1.Resivetime = DateTime.Now; + wfHistoryDTO1.Step = "鎻愪氦"; + wfHistoryDTO1.NeeddeelType = "1"; + wfHistoryDTO1.ChuliStatus = "2"; + wfHistoryDTO1.Deelurl = "/AdmAsk/AskYouHui?id=" + DanjuId; + wfHistoryDTO1.Content = ""; + wfHistoryDTO1.Sort = 1; + wfHistoryDTO1.RecStatus = "A"; + wfHistoryDTO1.Creater = Userid; + wfHistoryDTO1.Createtime = DateTime.Now; + wfHistoryDTO1.Modifier = Userid; + wfHistoryDTO1.Modifytime = wfHistoryDTO1.Createtime; + _context.WfHistories.Add(wfHistoryDTO1); + _context.SaveChanges(); + } + else + { + wfRunProcessDTO.Step = "鎬荤粡鐞嗗鎵�"; + wfRunProcessDTO.Modifier = Userid; + wfRunProcessDTO.Modifytime = DateTime.Now; + result = this.save(wfRunProcessDTO); + if (result.Result == false) + { + return result; + } + + //鏇存柊寰呭姙 + List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "鎻愪氦"); + var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs); + + var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault(); + if (wfHistoryDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒颁唬鍔�"; + return result; + } + wfHistoryDTO.Content = Content; + wfHistoryDTO.ChuliStatus = "2"; + wfHistoryDTO.Modifier = Userid; + wfHistoryDTO.Modifytime = DateTime.Now; + var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs); + foreach (var wfHistory in wfHistories) + { + _context.WfHistories.Add(wfHistory); + } + var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs); + foreach (var wfNeeddeel in wfNeeddeels) + { + //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid); + _context.WfNeeddeels.Remove(wfNeeddeel); + } + _context.SaveChanges(); + + //鏌ヨ澶勭悊浜� + var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "鎬荤粡鐞�").FirstOrDefault(); + if (hrPositions == null) + { + result.Result = false; + result.Message = "鏈壘鍒拌亴浣�"; + return result; + } + var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A") + join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId + select a + ).ToList(); + + if (pltUsers == null || pltUsers.Count == 0) + { + result.Result = false; + result.Message = "鏈壘鍒板鐞嗕汉"; + return result; + } + + foreach (var pltUser in pltUsers) + { + //鎻掑叆鏂扮殑寰呭姙 + WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO(); + wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id; + wfNeeddeelDTO.SendUserId = Userid; + wfNeeddeelDTO.DeelUserId = pltUser.Id; + wfNeeddeelDTO.Sendtime = DateTime.Now; + wfNeeddeelDTO.Resivetime = DateTime.Now; + wfNeeddeelDTO.Step = "鎬荤粡鐞嗗鎵�"; + wfNeeddeelDTO.NeeddeelType = "1"; + wfNeeddeelDTO.ChuliStatus = "0"; + wfNeeddeelDTO.Deelurl = "/AdmAsk/AskYouHui?id=" + DanjuId; + wfNeeddeelDTO.Content = ""; + wfNeeddeelDTO.Sort = 2; + wfNeeddeelDTO.RecStatus = "A"; + wfNeeddeelDTO.Creater = Userid; + wfNeeddeelDTO.Createtime = DateTime.Now; + wfNeeddeelDTO.Modifier = Userid; + wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime; + result = _wfNeeddeelService.save(wfNeeddeelDTO); + if (result.Result == false) + { + return result; + } + } + } + + + + + } + + + if (step == "鎬荤粡鐞嗗鎵�") + { + //鏇存柊娴佺▼瀹炰緥 + //WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "12").FirstOrDefault(); + if (wfRunProcessDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒版祦绋嬪疄渚�"; + return result; + } + if (wfRunProcessDTO.Step != "鎬荤粡鐞嗗鎵�") + { + result.Result = false; + result.Message = "褰撳墠姝ラ宸茬粡澶勭悊"; + return result; + } + if (tongguojujue == "A") + { + + wfRunProcessDTO.Step = "瀹岀粨"; + wfRunProcessDTO.ShenpiStatus = "A"; + wfRunProcessDTO.Modifier = Userid; + wfRunProcessDTO.Modifytime = DateTime.Now; + result = this.save(wfRunProcessDTO); + if (result.Result == false) + { + return result; + } + //鏇存柊鍗曟嵁 + var admAskYouHui = _context.AdmAskYouHuis.Find(DanjuId); + if (wfRunProcessDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒板崟鎹�"; + return result; + } + admAskYouHui.ShenpiStatus = "A"; + _context.SaveChanges(); + + List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "鎬荤粡鐞嗗鎵�"); + + var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs); + + var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault(); + if (wfHistoryDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒颁唬鍔�"; + return result; + } + wfHistoryDTO.Content = Content; + wfHistoryDTO.ChuliStatus = "2"; + wfHistoryDTO.Modifier = Userid; + wfHistoryDTO.Modifytime = DateTime.Now; + var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs); + foreach (var wfHistory in wfHistories) + { + _context.WfHistories.Add(wfHistory); + } + var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs); + foreach (var wfNeeddeel in wfNeeddeels) + { + // _wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid); + _context.WfNeeddeels.Remove(wfNeeddeel); + } + _context.SaveChanges(); + } + else + { + wfRunProcessDTO.Step = "鎻愪氦"; + wfRunProcessDTO.Modifier = Userid; + wfRunProcessDTO.Modifytime = DateTime.Now; + result = this.save(wfRunProcessDTO); + if (result.Result == false) + { + return result; + } + + //鏇存柊寰呭姙 + List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "鎬荤粡鐞嗗鎵�"); + var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs); + + var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault(); + if (wfHistoryDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒颁唬鍔�"; + return result; + } + wfHistoryDTO.Content = Content; + wfHistoryDTO.ChuliStatus = "1"; + wfHistoryDTO.Modifier = Userid; + wfHistoryDTO.Modifytime = DateTime.Now; + var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs); + foreach (var wfHistory in wfHistories) + { + _context.WfHistories.Add(wfHistory); + } + var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs); + foreach (var wfNeeddeel in wfNeeddeels) + { + //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid); + _context.WfNeeddeels.Remove(wfNeeddeel); + } + _context.SaveChanges(); + + + //鎻掑叆鏂扮殑寰呭姙 + WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO(); + wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id; + wfNeeddeelDTO.SendUserId = Userid; + wfNeeddeelDTO.DeelUserId = wfRunProcessDTO.Creater; + wfNeeddeelDTO.Sendtime = DateTime.Now; + wfNeeddeelDTO.Resivetime = DateTime.Now; + wfNeeddeelDTO.Step = "鎻愪氦"; + wfNeeddeelDTO.NeeddeelType = "1"; + wfNeeddeelDTO.ChuliStatus = "0"; + wfNeeddeelDTO.Deelurl = "/AdmAsk/AskYouHui?id=" + DanjuId; + wfNeeddeelDTO.Content = ""; + wfNeeddeelDTO.Sort = 1; + wfNeeddeelDTO.RecStatus = "A"; + wfNeeddeelDTO.Creater = Userid; + wfNeeddeelDTO.Createtime = DateTime.Now; + wfNeeddeelDTO.Modifier = Userid; + wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime; + result = _wfNeeddeelService.save(wfNeeddeelDTO); + if (result.Result == false) + { + return result; + } + + } + + + + } + + + } + + + + return result; + } + + public ResultEntity WfAskBaiFang(string DanjuId, string step, string tongguojujue, string Userid, string Content, string title, string version) + { + + ResultEntity result = new ResultEntity(); + result.Result = true; + + + WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "13").FirstOrDefault(); + if (wfRunProcessDTO != null) + { + version = wfRunProcessDTO.Version; + } + + + if (version == "v1") + { + if (step == "鎻愪氦") + { + //鏇存柊娴佺▼瀹炰緥 + // WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "13").FirstOrDefault(); + if (wfRunProcessDTO == null) + { + //鎻掑叆娴佺▼瀹炰緥 + wfRunProcessDTO = new WfRunProcessDTO(); + //wfRunProcessDTO.Applyno = + wfRunProcessDTO.Applytime = DateTime.Now; + wfRunProcessDTO.Applytiye = "13"; + wfRunProcessDTO.DanjuId = DanjuId; + wfRunProcessDTO.Content = title; + wfRunProcessDTO.Step = "鎬荤粡鐞嗗鎵�"; + wfRunProcessDTO.ShenpiStatus = "D"; + wfRunProcessDTO.Version = version; + wfRunProcessDTO.RecStatus = "A"; + wfRunProcessDTO.Creater = Userid; + wfRunProcessDTO.Createtime = DateTime.Now; + wfRunProcessDTO.Modifier = Userid; + wfRunProcessDTO.Modifytime = DateTime.Now; + wfRunProcessDTO.Deelurl = "/AdmAsk/AskBaiFang?id=" + DanjuId; + result = this.save(wfRunProcessDTO); + if (result.Result == false) + { + return result; + } + //鏌ヨ澶勭悊浜� + var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "鎬荤粡鐞�").FirstOrDefault(); + if (hrPositions == null) + { + result.Result = false; + result.Message = "鏈壘鍒拌亴浣�"; + return result; + } + var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A") + join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId + select a + ).ToList(); + + if (pltUsers == null || pltUsers.Count == 0) + { + result.Result = false; + result.Message = "鏈壘鍒板鐞嗕汉"; + return result; + } + foreach (var pltUser in pltUsers) + { + //鎻掑叆寰呭姙 + WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO(); + wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id; + wfNeeddeelDTO.SendUserId = Userid; + wfNeeddeelDTO.DeelUserId = pltUser.Id; + wfNeeddeelDTO.Sendtime = DateTime.Now; + wfNeeddeelDTO.Resivetime = DateTime.Now; + wfNeeddeelDTO.Step = "鎬荤粡鐞嗗鎵�"; + wfNeeddeelDTO.NeeddeelType = "1"; + wfNeeddeelDTO.ChuliStatus = "0"; + wfNeeddeelDTO.Deelurl = "/AdmAsk/AskBaiFang?id=" + DanjuId; + wfNeeddeelDTO.Content = ""; + wfNeeddeelDTO.Sort = 1; + wfNeeddeelDTO.RecStatus = "A"; + wfNeeddeelDTO.Creater = Userid; + wfNeeddeelDTO.Createtime = DateTime.Now; + wfNeeddeelDTO.Modifier = Userid; + wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime; + result = _wfNeeddeelService.save(wfNeeddeelDTO); + if (result.Result == false) + { + return result; + } + } + + //鎻掑叆鏂扮殑宸插姙 + WfHistory wfHistoryDTO1 = new WfHistory(); + wfHistoryDTO1.Id = Guid.NewGuid().ToString(); + wfHistoryDTO1.RunProcessId = wfRunProcessDTO.Id; + wfHistoryDTO1.SendUserId = Userid; + wfHistoryDTO1.DeelUserId = wfRunProcessDTO.Creater; + wfHistoryDTO1.Sendtime = DateTime.Now; + wfHistoryDTO1.Resivetime = DateTime.Now; + wfHistoryDTO1.Step = "鎻愪氦"; + wfHistoryDTO1.NeeddeelType = "1"; + wfHistoryDTO1.ChuliStatus = "2"; + wfHistoryDTO1.Deelurl = "/AdmAsk/AskBaiFang?id=" + DanjuId; + wfHistoryDTO1.Content = ""; + wfHistoryDTO1.Sort = 1; + wfHistoryDTO1.RecStatus = "A"; + wfHistoryDTO1.Creater = Userid; + wfHistoryDTO1.Createtime = DateTime.Now; + wfHistoryDTO1.Modifier = Userid; + wfHistoryDTO1.Modifytime = wfHistoryDTO1.Createtime; + _context.WfHistories.Add(wfHistoryDTO1); + _context.SaveChanges(); + } + else + { + wfRunProcessDTO.Step = "鎬荤粡鐞嗗鎵�"; + wfRunProcessDTO.Modifier = Userid; + wfRunProcessDTO.Modifytime = DateTime.Now; + result = this.save(wfRunProcessDTO); + if (result.Result == false) + { + return result; + } + + //鏇存柊寰呭姙 + List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "鎻愪氦"); + var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs); + + var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault(); + if (wfHistoryDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒颁唬鍔�"; + return result; + } + wfHistoryDTO.Content = Content; + wfHistoryDTO.ChuliStatus = "2"; + wfHistoryDTO.Modifier = Userid; + wfHistoryDTO.Modifytime = DateTime.Now; + var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs); + foreach (var wfHistory in wfHistories) + { + _context.WfHistories.Add(wfHistory); + } + var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs); + foreach (var wfNeeddeel in wfNeeddeels) + { + //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid); + _context.WfNeeddeels.Remove(wfNeeddeel); + } + _context.SaveChanges(); + + //鏌ヨ澶勭悊浜� + var hrPositions = _context.PltRoles.Where(x => x.RecStatus == "A" && x.RoleName == "鎬荤粡鐞�").FirstOrDefault(); + if (hrPositions == null) + { + result.Result = false; + result.Message = "鏈壘鍒拌亴浣�"; + return result; + } + var pltUsers = (from a in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A") + join b in _context.PltUserRoles.Where(x => x.RecStatus == "A" && x.RoleId == hrPositions.Id) on a.Id equals b.UserId + select a + ).ToList(); + + if (pltUsers == null || pltUsers.Count == 0) + { + result.Result = false; + result.Message = "鏈壘鍒板鐞嗕汉"; + return result; + } + + foreach (var pltUser in pltUsers) + { + //鎻掑叆鏂扮殑寰呭姙 + WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO(); + wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id; + wfNeeddeelDTO.SendUserId = Userid; + wfNeeddeelDTO.DeelUserId = pltUser.Id; + wfNeeddeelDTO.Sendtime = DateTime.Now; + wfNeeddeelDTO.Resivetime = DateTime.Now; + wfNeeddeelDTO.Step = "鎬荤粡鐞嗗鎵�"; + wfNeeddeelDTO.NeeddeelType = "1"; + wfNeeddeelDTO.ChuliStatus = "0"; + wfNeeddeelDTO.Deelurl = "/AdmAsk/AskBaiFang?id=" + DanjuId; + wfNeeddeelDTO.Content = ""; + wfNeeddeelDTO.Sort = 2; + wfNeeddeelDTO.RecStatus = "A"; + wfNeeddeelDTO.Creater = Userid; + wfNeeddeelDTO.Createtime = DateTime.Now; + wfNeeddeelDTO.Modifier = Userid; + wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime; + result = _wfNeeddeelService.save(wfNeeddeelDTO); + if (result.Result == false) + { + return result; + } + } + } + + + + + } + + + if (step == "鎬荤粡鐞嗗鎵�") + { + //鏇存柊娴佺▼瀹炰緥 + //WfRunProcessDTO wfRunProcessDTO = this.GetList(DanjuId, "13").FirstOrDefault(); + if (wfRunProcessDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒版祦绋嬪疄渚�"; + return result; + } + if (wfRunProcessDTO.Step != "鎬荤粡鐞嗗鎵�") + { + result.Result = false; + result.Message = "褰撳墠姝ラ宸茬粡澶勭悊"; + return result; + } + if (tongguojujue == "A") + { + + wfRunProcessDTO.Step = "瀹岀粨"; + wfRunProcessDTO.ShenpiStatus = "A"; + wfRunProcessDTO.Modifier = Userid; + wfRunProcessDTO.Modifytime = DateTime.Now; + result = this.save(wfRunProcessDTO); + if (result.Result == false) + { + return result; + } + //鏇存柊鍗曟嵁 + var admAskBaiFang = _context.AdmAskBaiFangs.Find(DanjuId); + if (wfRunProcessDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒板崟鎹�"; + return result; + } + admAskBaiFang.ShenpiStatus = "A"; + _context.SaveChanges(); + + List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "鎬荤粡鐞嗗鎵�"); + + var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs); + + var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault(); + if (wfHistoryDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒颁唬鍔�"; + return result; + } + wfHistoryDTO.Content = Content; + wfHistoryDTO.ChuliStatus = "2"; + wfHistoryDTO.Modifier = Userid; + wfHistoryDTO.Modifytime = DateTime.Now; + var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs); + foreach (var wfHistory in wfHistories) + { + _context.WfHistories.Add(wfHistory); + } + var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs); + foreach (var wfNeeddeel in wfNeeddeels) + { + // _wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid); + _context.WfNeeddeels.Remove(wfNeeddeel); + } + _context.SaveChanges(); + } + else + { + wfRunProcessDTO.Step = "鎻愪氦"; + wfRunProcessDTO.Modifier = Userid; + wfRunProcessDTO.Modifytime = DateTime.Now; + result = this.save(wfRunProcessDTO); + if (result.Result == false) + { + return result; + } + + //鏇存柊寰呭姙 + List<WfNeeddeelDTO> wfNeeddeelDTOs = _wfNeeddeelService.GetList(wfRunProcessDTO.Id, "鎬荤粡鐞嗗鎵�"); + var wfHistoryDTOs = _mapper.Map<List<WfHistoryDTO>>(wfNeeddeelDTOs); + + var wfHistoryDTO = wfHistoryDTOs.Where(x => x.DeelUserId == Userid).FirstOrDefault(); + if (wfHistoryDTO == null) + { + result.Result = false; + result.Message = "鏈壘鍒颁唬鍔�"; + return result; + } + wfHistoryDTO.Content = Content; + wfHistoryDTO.ChuliStatus = "1"; + wfHistoryDTO.Modifier = Userid; + wfHistoryDTO.Modifytime = DateTime.Now; + var wfHistories = _mapper.Map<List<WfHistory>>(wfHistoryDTOs); + foreach (var wfHistory in wfHistories) + { + _context.WfHistories.Add(wfHistory); + } + var wfNeeddeels = _mapper.Map<List<WfNeeddeel>>(wfNeeddeelDTOs); + foreach (var wfNeeddeel in wfNeeddeels) + { + //_wfNeeddeelService.ModifyStatus(wfNeeddeel.Id, Userid); + _context.WfNeeddeels.Remove(wfNeeddeel); + } + _context.SaveChanges(); + + + //鎻掑叆鏂扮殑寰呭姙 + WfNeeddeelDTO wfNeeddeelDTO = new WfNeeddeelDTO(); + wfNeeddeelDTO.RunProcessId = wfRunProcessDTO.Id; + wfNeeddeelDTO.SendUserId = Userid; + wfNeeddeelDTO.DeelUserId = wfRunProcessDTO.Creater; + wfNeeddeelDTO.Sendtime = DateTime.Now; + wfNeeddeelDTO.Resivetime = DateTime.Now; + wfNeeddeelDTO.Step = "鎻愪氦"; + wfNeeddeelDTO.NeeddeelType = "1"; + wfNeeddeelDTO.ChuliStatus = "0"; + wfNeeddeelDTO.Deelurl = "/AdmAsk/AskBaiFang?id=" + DanjuId; + wfNeeddeelDTO.Content = ""; + wfNeeddeelDTO.Sort = 1; + wfNeeddeelDTO.RecStatus = "A"; + wfNeeddeelDTO.Creater = Userid; + wfNeeddeelDTO.Createtime = DateTime.Now; + wfNeeddeelDTO.Modifier = Userid; + wfNeeddeelDTO.Modifytime = wfNeeddeelDTO.Createtime; + result = _wfNeeddeelService.save(wfNeeddeelDTO); + if (result.Result == false) + { + return result; + } + + } + + + + } + + + } + + + + return result; + } + } } diff --git a/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs b/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs index 8fd61ed..ba62186 100644 --- a/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs @@ -40,13 +40,15 @@ private readonly IFiMemberService _fiMemberService; private readonly IConfiguration _configuration; private readonly IHttpClientFactory _clientFactory; + private readonly IAskService _askService; public CooperOrderController(ILogger<CooperOrderController> logger, ILiaotianService liaotianService, IUserService userService, ICooperOrderService cooperOrderService , ICooperatecustomCustomerService cooperatecustomCustomerService, IProjectService projectService, IPltPageService pltPageService, IFiBookService fiBookService , IFiServiceService fiServiceService, IFiMemberService fiMemberService , IConfiguration configuration - , IHttpClientFactory clientFactory) + , IHttpClientFactory clientFactory + , IAskService askService) { _logger = logger; _liaotianService = liaotianService; @@ -60,6 +62,7 @@ _fiMemberService = fiMemberService; _configuration = configuration; _clientFactory = clientFactory; + _askService = askService; } [CheckLogin] @@ -405,12 +408,14 @@ { dto = _cooperOrderService.Get(id); ViewBag.ShouliStatus = ShouliStatus; + //ViewBag.YouHuiList = _askService.GetAskYouHuiList(dto.Khdw, dto.OrderType); } else { dto.XdTime = DateTime.Now; dto.OrderNum = 1; ViewBag.ShouliStatus = "1"; + //ViewBag.YouHuiList = new List<AdmAskYouHuiDTO>(); } @@ -534,14 +539,49 @@ } - data.ShouliStatus = "1"; - data.Modifier = curentuser.Id; - data.Modifytime = DateTime.Now; - resultEntity = _cooperOrderService.save(data); + var youHuiDTOs = _askService.GetAskYouHuiList(data.Khdw, data.OrderType).FirstOrDefault(); + if (youHuiDTOs != null) + { + data.Youhuier = youHuiDTOs.Id; + if(youHuiDTOs.Youhuistandard == "01") + { + data.Youhui = youHuiDTOs.YouHui.Value; + if(data.Money.Value < data.Youhui.Value) + { + data.Money = 0; + } + else + { + data.Money = data.Money.Value - data.Youhui.Value; + } + + } + else if (youHuiDTOs.Youhuistandard == "02") + { + if (youHuiDTOs.YouHui.Value >= 100) + { + data.Youhui = data.Money.Value; + data.Money = 0; + } + else + { + data.Youhui =Math.Round(data.Money.Value * youHuiDTOs.YouHui.Value * new decimal(0.01),2); + data.Money = data.Money.Value - data.Youhui.Value; + } + } + + + } + + data.ShouliStatus = "1"; + data.Modifier = curentuser.Id; + data.Modifytime = DateTime.Now; + + resultEntity = _cooperOrderService.save(data); // scope.Complete(); //} - + return new JsonResult(resultEntity); } @@ -847,7 +887,7 @@ result = JsonConvert.SerializeObject(shi); } - if (OrderType == "08" || OrderType == "10") + if (OrderType == "08" || OrderType == "10" || OrderType == "11") { result = "[]"; diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs index 60094ff..61d4363 100644 --- a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs @@ -27,13 +27,17 @@ private readonly ILiaotianService _liaotianService; private readonly IUserService _userService; private readonly IAdmBreakPrecedentService _aAdmBreakPrecedentService; + private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService; + private readonly IIntentionCustomerService _intentionCustomerService; public AdmAskController(ILogger<AdmAskController> logger, IAskService askService, IHrDeptService hrDeptService, IWfRunProcessService wfRunProcessService , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService , IAdmGoodsManageService admGoodsManageService , ILiaotianService liaotianService , IUserService userService - , IAdmBreakPrecedentService aAdmBreakPrecedentService) + , IAdmBreakPrecedentService aAdmBreakPrecedentService + , ICooperatecustomCustomerService cooperatecustomCustomerService + , IIntentionCustomerService intentionCustomerService) { _logger = logger; _hrDeptService = hrDeptService; @@ -45,6 +49,8 @@ _liaotianService = liaotianService; _userService = userService; _aAdmBreakPrecedentService = aAdmBreakPrecedentService; + _cooperatecustomCustomerService = cooperatecustomCustomerService; + _intentionCustomerService = intentionCustomerService; } public IActionResult Askcost(string id = "") @@ -966,5 +972,236 @@ } return new JsonResult(resultEntity); } + + + public IActionResult AskYouHui(string id = "") + { + AdmAskYouHuiDTO dto = new AdmAskYouHuiDTO(); + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + + + //娴佺▼鐩稿叧 + string shifoubiaoji = "A"; + string sifoudangqian = "A"; + string dangqianbuzhou = "鎻愪氦"; + var lishiyijian = new List<WfHistoryDTO>(); + + if (string.IsNullOrEmpty(id)) + { + dto.CreaterName = curentuser.UserName; + dto.Tittle = "浼樻儬鐢宠锛�" + curentuser.UserName + "锛�"; + } + else if (dto != null) + { + dto = _askService.GetAskYouHui(id); + dto.YouHuiName = dto.YouHui.Value.ToString("F2"); + + var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "12").FirstOrDefault(); + if (wfRunProcessDTO == null) + { + shifoubiaoji = "D"; + sifoudangqian = "D"; + } + else + { + dangqianbuzhou = wfRunProcessDTO.Step; + //鏌ヨ瀹℃壒杩涘害 + lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id); + if (wfRunProcessDTO.Step != "鎻愪氦") + { + shifoubiaoji = "D"; + } + + //鏌ヨ寰呭姙 + var chaxundaiban = _wfNeeddeelService.GetListTracking(wfRunProcessDTO.Id, wfRunProcessDTO.Step).Where(x => x.DeelUserId == curentuser.Id).ToList(); + if (chaxundaiban != null && chaxundaiban.Count > 0) + { + sifoudangqian = "A"; + } + else + { + sifoudangqian = "D"; + } + + } + + + + + } + + ViewBag.shifoubiaoji = shifoubiaoji; + ViewBag.sifoudangqian = sifoudangqian; + ViewBag.lishiyijian = lishiyijian; + ViewBag.dangqianbuzhou = dangqianbuzhou; + + ViewBag.jtype = _liaotianService.GetSYScode("CooperVisit", "jtype"); + ViewBag.standard = _liaotianService.GetSYScode("fi_piecerate", "standard"); + + ViewBag.CooperatecustomCustomerDTOs = _cooperatecustomCustomerService.GetList(); + + ViewData.Model = dto; + return View(); + } + + + /// <summary> + /// 淇濆瓨閿�鍞垂鐢ㄧ敵璇� + /// </summary> + /// <param name="data"></param> + /// <returns></returns> + [HttpPost] + public IActionResult SaveYouHui(AdmAskYouHuiDTO data) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ResultEntity resultEntity = new ResultEntity(); + using (TransactionScope scope = new TransactionScope()) + { + if (data.Step == "鎻愪氦") + { + + data.ShenpiStatus = "D"; + data.RecStatus = "A"; + data.Creater = curentuser.Id; + data.Createtime = DateTime.Now; + data.Modifier = data.Creater; + data.Modifytime = data.Createtime; + + resultEntity = _askService.SaveAskYouHui(data); + if (!resultEntity.Result) + { + return new JsonResult(resultEntity); + } + } + + + + //鍙戣捣娴佺▼鐩稿叧 + + resultEntity = _wfRunProcessService.WfAskYouHui(data.Id, data.Step, data.Tongguojujue, curentuser.Id, data.Content, data.Tittle, "v1"); + if (!resultEntity.Result) + { + return new JsonResult(resultEntity); + } + scope.Complete(); + } + return new JsonResult(resultEntity); + } + + public IActionResult AskBaiFang(string id = "") + { + AdmAskBaiFangDTO dto = new AdmAskBaiFangDTO(); + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + + + //娴佺▼鐩稿叧 + string shifoubiaoji = "A"; + string sifoudangqian = "A"; + string dangqianbuzhou = "鎻愪氦"; + var lishiyijian = new List<WfHistoryDTO>(); + + if (string.IsNullOrEmpty(id)) + { + dto.CreaterName = curentuser.UserName; + dto.Tittle = "璁块棶璇风ず锛�" + curentuser.UserName + "锛�"; + } + else if (dto != null) + { + dto = _askService.GetAskBaiFang(id); + dto.BaiFangtimeName = dto.BaiFangtime.Value.ToString("yyyy-MM-dd"); + + var wfRunProcessDTO = _wfRunProcessService.GetList(dto.Id, "13").FirstOrDefault(); + if (wfRunProcessDTO == null) + { + shifoubiaoji = "D"; + sifoudangqian = "D"; + } + else + { + dangqianbuzhou = wfRunProcessDTO.Step; + //鏌ヨ瀹℃壒杩涘害 + lishiyijian = _wfHistoryService.GetListshenpi(wfRunProcessDTO.Id); + if (wfRunProcessDTO.Step != "鎻愪氦") + { + shifoubiaoji = "D"; + } + + //鏌ヨ寰呭姙 + var chaxundaiban = _wfNeeddeelService.GetListTracking(wfRunProcessDTO.Id, wfRunProcessDTO.Step).Where(x => x.DeelUserId == curentuser.Id).ToList(); + if (chaxundaiban != null && chaxundaiban.Count > 0) + { + sifoudangqian = "A"; + } + else + { + sifoudangqian = "D"; + } + + } + + + + + } + + ViewBag.shifoubiaoji = shifoubiaoji; + ViewBag.sifoudangqian = sifoudangqian; + ViewBag.lishiyijian = lishiyijian; + ViewBag.dangqianbuzhou = dangqianbuzhou; + + ViewBag.jtype = _liaotianService.GetSYScode("CooperVisit", "jtype"); + ViewBag.visType = _liaotianService.GetSYScode("CooperVisit", "visType"); + //var cooperatecustomCustomerDTOs = _cooperatecustomCustomerService.GetList(); + //var intentionCustomerDTOs = _intentionCustomerService.GetList(); + + //ViewBag.CooperatecustomCustomerDTOs = + + ViewData.Model = dto; + return View(); + } + + + /// <summary> + /// 淇濆瓨閿�鍞垂鐢ㄧ敵璇� + /// </summary> + /// <param name="data"></param> + /// <returns></returns> + [HttpPost] + public IActionResult SaveBaiFang(AdmAskBaiFangDTO data) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ResultEntity resultEntity = new ResultEntity(); + using (TransactionScope scope = new TransactionScope()) + { + if (data.Step == "鎻愪氦") + { + + data.ShenpiStatus = "D"; + data.RecStatus = "A"; + data.Creater = curentuser.Id; + data.Createtime = DateTime.Now; + data.Modifier = data.Creater; + data.Modifytime = data.Createtime; + + resultEntity = _askService.SaveAskBaiFang(data); + if (!resultEntity.Result) + { + return new JsonResult(resultEntity); + } + } + + + + //鍙戣捣娴佺▼鐩稿叧 + + resultEntity = _wfRunProcessService.WfAskBaiFang(data.Id, data.Step, data.Tongguojujue, curentuser.Id, data.Content, data.Tittle, "v1"); + if (!resultEntity.Result) + { + return new JsonResult(resultEntity); + } + scope.Complete(); + } + return new JsonResult(resultEntity); + } } } diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskBaiFang.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskBaiFang.cshtml new file mode 100644 index 0000000..719976f --- /dev/null +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskBaiFang.cshtml @@ -0,0 +1,394 @@ +锘緻model AdmAskBaiFangDTO; +@using DTO; +@using zhengcaioa.Models; +@{ + Layout = null; + + //娴佺▼鐩稿叧 + string shifoubiaoji = ViewBag.shifoubiaoji as string; + string sifoudangqian = ViewBag.sifoudangqian as string; + string dangqianbuzhou = ViewBag.dangqianbuzhou as string; + + List<WfHistoryDTO> lishiyijian = ViewData["lishiyijian"] as List<WfHistoryDTO>; //瀹℃壒杩涘害 + + + List<SysCodeDtl> jtype = ViewData["jtype"] as List<SysCodeDtl>; + + List<SysCodeDtl> visType = ViewData["visType"] as List<SysCodeDtl>; + +} + +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> + <meta name="description" content=""> + <meta name="author" content="ThemeBucket"> + <link href="~/css/bootstrap.min.css" rel="stylesheet"> + <link href="~/css/font-awesome.min.css" rel="stylesheet"> + <link href="~/css/animate.min.css" rel="stylesheet"> + <link href="~/css/style.min.css" rel="stylesheet"> + <link href="~/css/plugins/chosen/chosen.css" rel="stylesheet"> + <link href="~/js/plugins/layer/skin/layer.css" rel="stylesheet"> + <link href="~/css/style.min.css" rel="stylesheet"> + <link href="~/css/plugins/toastr/toastr.min.css" rel="stylesheet" /> + + <!-- jqgrid--> + <script language="javascript" src="~/js/jquery.min.js" type="text/javascript"></script> + <script src="~/js/bootstrap.min.js"></script> + + <!--瀹瑰櫒--> + <script language="javascript" src="~/js/plugins/chosen/chosen.jquery.js" type="text/javascript"></script> + <script language="javascript" src="~/js/plugins/layer/layer.js" type="text/javascript"></script> + <script src="~/js/plugins/toastr/toastr.min.js" type="text/javascript"></script> + <script language="javascript" src="~/js/common-layout.js" type="text/javascript"></script> + <script src="~/js/plugins/layer/laydate/laydate.js" type="text/javascript"></script> + <script src="~/js/TUJS.js"></script> + + <style type="text/css"> + + div.clearfix > label { + padding-top: 8px; + } + + .col-md-1.control-label { + padding-right: 0px; + font-weight: 400; + } + </style> + + +</head> + +<body class="gray-bg" style="overflow:auto"> + <form id="fm" method="post"> + <div class="wrapper wrapper-content" id="ibox-content" style="padding:15px;"> + <div class="row"> + <div class="col-sm-12"> + <div class="ibox float-e-margins"> + <div id="div_content" class="ibox-content" style="background-color:white;"> + <div class="row"> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">鍗曟嵁鍚嶇О<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input type="text" class="form-control" value="@Model.Tittle" name="tittle" id="tittle" validate="RequiredField" autocomplete="off" readonly="readonly"> + + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">鐢宠浜�<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input type="text" class="form-control" value="@Model.CreaterName" name="createrName" id="createrName" validate="RequiredField" autocomplete="off" readonly="readonly"> + + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">璁块棶鏃堕棿<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input type="text" class="layui-input layer-date ldate form-control" value="@Model.BaiFangtimeName" name="BaiFangtime" id="BaiFangtime" readonly="readonly"> + + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">瀹㈡埛鍗曚綅<i class="red">*</i></label> + <div class="col-sm-6 col-md-6"> + <input type="text" class="form-control" value="@Model.CustomerId" name="CustomerId" id="CustomerId" maxlength="500"> + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">璁块棶鏂瑰紡<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <select id="VisType" class="form-control" name="VisType" data-placeholder="閫夋嫨 搴忓垪 ..."> + <option value="" hassubinfo="true">璇烽�夋嫨</option> + @foreach (var item in visType) + { + @if (!item.CodeSn.Equals(Model.VisType)) + { + <option value="@item.CodeSn" hassubinfo="true"> + @item.Comments + </option> + } + else + { + <option value="@item.CodeSn" hassubinfo="true" selected="selected"> + @item.Comments + </option> + } + + } + + + </select> + </div> + </div> + + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">涓氬姟绫诲瀷</label> + <div class="col-sm-2 col-md-2"> + <select id="Jtype" class="form-control" name="Jtype" data-placeholder="閫夋嫨 搴忓垪 ..."> + <option value="" hassubinfo="true">璇烽�夋嫨</option> + @foreach (var item in jtype) + { + @if (!item.CodeSn.Equals(Model.Jtype)) + { + <option value="@item.CodeSn" hassubinfo="true"> + @item.Comments + </option> + } + else + { + <option value="@item.CodeSn" hassubinfo="true" selected="selected"> + @item.Comments + </option> + } + + } + + + </select> + </div> + </div> + + + + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">鐢宠璇存槑</label> + <div class="col-sm-6 col-md-6"> + <textarea class="form-control bt" id="Remark" name="Remark" maxlength="500" length="long" style="resize:none;overflow-y:hidden; height:80px;">@Model.Remark</textarea> + </div> + </div> + + + <div class="clearfix layer-area" style="padding-bottom:15px;" id="shenpiyijian"> + <label class="text-right col-sm-1 col-md-1 control-label">瀹℃壒鎰忚</label> + <div class="col-sm-6 col-md-6"> + <textarea class="form-control data" id="Content" name="Content" style="resize:none;overflow-y:hidden; height:80px;" maxlength="500"></textarea> + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">瀹℃壒杩涘害</label> + <div class="col-sm-6 col-md-6"> + <table> + @if (lishiyijian.Count > 0) + { + <tr> + <td style="border:1px solid #ccc;width:150px;">姝ラ </td> + <td style="border:1px solid #ccc;width:150px;"> 鎵瑰鐘舵��</td> + <td style="border:1px solid #ccc;width:150px;">鎵瑰鏃堕棿</td> + <td style="border:1px solid #ccc;width:300px;"> 瀹℃壒鎰忚</td> + <td style="border:1px solid #ccc;width:100px;"> 鎵瑰浜�</td> + </tr> + } + + @foreach (var wfHistory in lishiyijian) + { + <tr> + <td style="border:1px solid #ccc;width:150px;">@wfHistory.Step</td> + <td style="border:1px solid #ccc;width:150px;">@wfHistory.ChuliStatusName</td> + <td style="border:1px solid #ccc;width:150px;">@wfHistory.ModifytimeName</td> + <td style="border:1px solid #ccc;width:300px;">@wfHistory.Content</td> + <td style="border:1px solid #ccc;width:100px;">@wfHistory.DeelUserIdName</td> + </tr> + } + </table> + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:60px;"> + + </div> + </div> + </div> + </div> + </div> + </div> + </div> + <div class="ibox-content" id="top" style="z-index:100; position:fixed; height:50px; width:100%;bottom:0; text-align: right; padding-top:8px "> + <div class="" style="float:right;" data-bootstro-width="500px"> + <a class="btn btn-success" href="javascript:void(0)" onclick="_pageAutoClose();" style="margin-left:4px; border-radius:4px;"> + <i class="glyphicon glyphicon-remove"></i> <span class="bold">鍙栨秷</span> + </a> + <a class="btn btn-success" id="tijiao" href="javascript:void(0)" onclick="saveSimCost('');" style="margin-left:4px; border-radius:4px;"> + <i class="glyphicon glyphicon-ok"></i> <span class="bold">鎻愪氦</span> + </a> + + <a class="btn btn-success" id="tongyi" href="javascript:void(0)" onclick="saveSimCost('A');" style="margin-left:4px; border-radius:4px;"> + <span class="bold">鍚屾剰</span> + </a> + + <a class="btn btn-success" id="jujue" href="javascript:void(0)" onclick="saveSimCost('D');" style="margin-left:4px; border-radius:4px;"> + <span class="bold">鎷掔粷</span> + </a> + <input type="hidden" id="id" name="id" value="@Model.Id" /> + <input type="hidden" id="Tongguojujue" name="Tongguojujue" value="" /> + <input type="hidden" id="Step" name="Step" value="@dangqianbuzhou" /> + </div> + </div> + + </form> + + <script type="text/javascript"> + + var hh = document.body.clientHeight - $("#top").height() * 2 - 50; + $("#div_content").height(hh); + + toastr.options = { + "closeButton": true, + "debug": false, + "progressBar": true, + "positionClass": "toast-bottom-right", + "onclick": null, + "showDuration": "300", + "hideDuration": "600", + "timeOut": "4500", + "extendedTimeOut": "600", + "showEasing": "swing", + "hideEasing": "linear", + "showMethod": "fadeIn", + "hideMethod": "fadeOut" + }; + + + $(function () { + + + + + + if ("@shifoubiaoji" != "A") { + $("input").attr('readonly', true); + $("textarea").attr('readonly', true); + $(':radio').attr('disabled', true); + $(':checkbox').attr('disabled', true); + $(':button').attr('disabled', true); + //$('a').removeAttr('onclick'); + $('select').attr('disabled', true); + $("#fileUp").attr('disabled', true); + + $('.fujianshanchu').removeAttr('onclick'); + + + if ("@sifoudangqian" == "A") { + $("#Content").attr('readonly', false); + $('#tijiao').hide(); + } else { + $('#tongyi').hide(); + $('#jujue').hide(); + $('#tijiao').hide(); + $('#shenpiyijian').hide(); + } + + } else { + + + //瀹℃壒鐩稿叧 + $('#shenpiyijian').hide(); + if ("@sifoudangqian" == "A") { + $('#tongyi').hide(); + $('#jujue').hide(); + //$('#CustomerId').chosen(); + + $(".ldate").each(function (el) { + laydate({ + elem: "#" + $(this).attr('id'), //瀵瑰簲id + format: 'YYYY-MM-DD', //鏃ユ湡鏍煎紡 // 鍒嗛殧绗﹀彲浠ヤ换鎰忓畾涔夛紝璇ヤ緥瀛愯〃绀哄彧鏄剧ず骞存湀 + min: '2021-01-01', //璁惧畾鏈�灏忔棩鏈熶负褰撳墠鏃ユ湡 + max: '2099-06-16', //鏈�澶ф棩鏈� + type: 'datetime', + festival: false, //鏄剧ず鑺傛棩 + istime: true, 聽 //鏄惁鏄剧ず鏃跺垎绉� + istoday: true, //鏄惁鏄粖澶� + choose: function (datas) { //閫夋嫨鏃ユ湡瀹屾瘯鐨勫洖璋� + // console.log("234234234234324"); + // end.min = datas; //寮�濮嬫棩閫夊ソ鍚庯紝閲嶇疆缁撴潫鏃ョ殑鏈�灏忔棩鏈� + // end.start = datas //灏嗙粨鏉熸棩鐨勫垵濮嬪�艰瀹氫负寮�濮嬫棩 + checktime(); + } + }); + + }); + + } else { + $('#tongyi').hide(); + $('#jujue').hide(); + $('#tijiao').hide(); + } + + + } + + }) + + + // 淇濆瓨 + function saveSimCost(tongyi) { + if ($.trim($("#BaiFangtime").val()) == '') { + toastr.warning("璁块棶鏃堕棿涓嶈兘涓虹┖"); + return; + } + + if ($.trim($("#CustomerId").val()) == '') { + toastr.warning("瀹㈡埛鍗曚綅涓嶈兘涓虹┖"); + return; + } + if ($.trim($("#VisType").val()) == '') { + toastr.warning("璁块棶鏂瑰紡涓嶈兘涓虹┖"); + return; + } + + + + + + $("#Tongguojujue").val(tongyi); + + $.ajax({ + type: "POST", + url: "/AdmAsk/SaveBaiFang", + dataType: "json", + global: false, + data: $('#fm').serialize(), + success: function (data) { + + if (data.Result) { + parent.layer.msg('鎻愪氦鎴愬姛', { icon: 6 }); + try { + _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶 + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } + else { + parent.layer.msg(data.Message, { icon: 5 }); + } + + }, + error: function () { + parent.layer.msg('澶辫触', { icon: 5 }); + } + }); + } + + + function _pageAutoClose() { + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + + } + </script> +</body> +</html> \ No newline at end of file diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskCar.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskCar.cshtml index df970e4..9764002 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskCar.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskCar.cshtml @@ -307,12 +307,20 @@ function _pageAutoClose() { - parent.window._reloadPageData(); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.isRefresh = true; - parent.layer.closeAll('loading'); - parent.layer.close(index); - return false; + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } </script> </body> diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskGood.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskGood.cshtml index 2837b01..9011f47 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskGood.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskGood.cshtml @@ -306,12 +306,20 @@ function _pageAutoClose() { - parent.window._reloadPageData(); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.isRefresh = true; - parent.layer.closeAll('loading'); - parent.layer.close(index); - return false; + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } </script> </body> diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskMarketingCost.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskMarketingCost.cshtml index a61f713..10225e3 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskMarketingCost.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskMarketingCost.cshtml @@ -280,12 +280,20 @@ function _pageAutoClose() { - parent.window._reloadPageData(); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.isRefresh = true; - parent.layer.closeAll('loading'); - parent.layer.close(index); - return false; + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } </script> </body> diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskOther.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskOther.cshtml index f8c1c22..88f9dd7 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskOther.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskOther.cshtml @@ -280,12 +280,20 @@ function _pageAutoClose() { - parent.window._reloadPageData(); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.isRefresh = true; - parent.layer.closeAll('loading'); - parent.layer.close(index); - return false; + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } </script> </body> diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskPunishAppeal.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskPunishAppeal.cshtml index 7da4913..b9eadef 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskPunishAppeal.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskPunishAppeal.cshtml @@ -437,12 +437,20 @@ getBreakPrecedent(); function _pageAutoClose() { - parent.window._reloadPageData(); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.isRefresh = true; - parent.layer.closeAll('loading'); - parent.layer.close(index); - return false; + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } </script> </body> diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskSuggestion.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskSuggestion.cshtml index e930939..0d7729c 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskSuggestion.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskSuggestion.cshtml @@ -302,12 +302,20 @@ function _pageAutoClose() { - parent.window._reloadPageData(); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.isRefresh = true; - parent.layer.closeAll('loading'); - parent.layer.close(index); - return false; + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } </script> </body> diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/AskYouHui.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskYouHui.cshtml new file mode 100644 index 0000000..f4e391b --- /dev/null +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/AskYouHui.cshtml @@ -0,0 +1,393 @@ +锘緻model AdmAskYouHuiDTO; +@using DTO; +@using zhengcaioa.Models; +@{ + Layout = null; + + //娴佺▼鐩稿叧 + string shifoubiaoji = ViewBag.shifoubiaoji as string; + string sifoudangqian = ViewBag.sifoudangqian as string; + string dangqianbuzhou = ViewBag.dangqianbuzhou as string; + + List<WfHistoryDTO> lishiyijian = ViewData["lishiyijian"] as List<WfHistoryDTO>; //瀹℃壒杩涘害 + + + List<SysCodeDtl> jtype = ViewData["jtype"] as List<SysCodeDtl>; + + List<SysCodeDtl> standard = ViewData["standard"] as List<SysCodeDtl>; + + List<CooperatecustomCustomerDTO> CooperatecustomCustomerDTOs = ViewData["CooperatecustomCustomerDTOs"] as List<CooperatecustomCustomerDTO>; +} + +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> + <meta name="description" content=""> + <meta name="author" content="ThemeBucket"> + <link href="~/css/bootstrap.min.css" rel="stylesheet"> + <link href="~/css/font-awesome.min.css" rel="stylesheet"> + <link href="~/css/animate.min.css" rel="stylesheet"> + <link href="~/css/style.min.css" rel="stylesheet"> + <link href="~/css/plugins/chosen/chosen.css" rel="stylesheet"> + <link href="~/js/plugins/layer/skin/layer.css" rel="stylesheet"> + <link href="~/css/style.min.css" rel="stylesheet"> + <link href="~/css/plugins/toastr/toastr.min.css" rel="stylesheet" /> + + <!-- jqgrid--> + <script language="javascript" src="~/js/jquery.min.js" type="text/javascript"></script> + <script src="~/js/bootstrap.min.js"></script> + + <!--瀹瑰櫒--> + <script language="javascript" src="~/js/plugins/chosen/chosen.jquery.js" type="text/javascript"></script> + <script language="javascript" src="~/js/plugins/layer/layer.js" type="text/javascript"></script> + <script src="~/js/plugins/toastr/toastr.min.js" type="text/javascript"></script> + <script language="javascript" src="~/js/common-layout.js" type="text/javascript"></script> + <script src="~/js/plugins/layer/laydate/laydate.js" type="text/javascript"></script> + <script src="~/js/TUJS.js"></script> + + <style type="text/css"> + + div.clearfix > label { + padding-top: 8px; + } + + .col-md-1.control-label { + padding-right: 0px; + font-weight: 400; + } + </style> + + +</head> + +<body class="gray-bg" style="overflow:auto"> + <form id="fm" method="post"> + <div class="wrapper wrapper-content" id="ibox-content" style="padding:15px;"> + <div class="row"> + <div class="col-sm-12"> + <div class="ibox float-e-margins"> + <div id="div_content" class="ibox-content" style="background-color:white;"> + <div class="row"> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">鍗曟嵁鍚嶇О<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input type="text" class="form-control" value="@Model.Tittle" name="tittle" id="tittle" validate="RequiredField" autocomplete="off" readonly="readonly"> + + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">鐢宠浜�<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input type="text" class="form-control" value="@Model.CreaterName" name="createrName" id="createrName" validate="RequiredField" autocomplete="off" readonly="readonly"> + + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">鍚堜綔瀹㈡埛<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <select id="CustomerId" class="form-control" name="CustomerId" data-placeholder="閫夋嫨 搴忓垪 ..."> + <option value="" hassubinfo="true">璇烽�夋嫨</option> + @foreach (var item in CooperatecustomCustomerDTOs) + { + @if (!item.Id.Equals(Model.CustomerId)) + { + <option value="@item.Id" hassubinfo="true"> + @item.Name + </option> + } + else + { + <option value="@item.Id" hassubinfo="true" selected="selected"> + @item.Name + </option> + } + + } + + + </select> + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">璁㈠崟绫诲瀷<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <select id="OrderType" class="form-control" name="OrderType" data-placeholder="閫夋嫨 搴忓垪 ..."> + <option value="" hassubinfo="true">璇烽�夋嫨</option> + @foreach (var item in jtype) + { + @if (!item.CodeSn.Equals(Model.OrderType)) + { + <option value="@item.CodeSn" hassubinfo="true"> + @item.Comments + </option> + } + else + { + <option value="@item.CodeSn" hassubinfo="true" selected="selected"> + @item.Comments + </option> + } + + } + + + </select> + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">浼樻儬鏍囧噯<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <select id="Youhuistandard" class="form-control" name="Youhuistandard" data-placeholder="閫夋嫨 搴忓垪 ..."> + <option value="" hassubinfo="true">璇烽�夋嫨</option> + @foreach (var item in standard) + { + @if (!item.CodeSn.Equals(Model.Youhuistandard)) + { + <option value="@item.CodeSn" hassubinfo="true"> + @item.Comments + </option> + } + else + { + <option value="@item.CodeSn" hassubinfo="true" selected="selected"> + @item.Comments + </option> + } + + } + + + </select> + </div> + </div> + + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">浼樻儬<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input class="form-control" id="YouHui" name="YouHui" type="text" value="@Model.YouHuiName" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">鐢宠璇存槑</label> + <div class="col-sm-6 col-md-6"> + <textarea class="form-control bt" id="Remark" name="Remark" maxlength="500" length="long" style="resize:none;overflow-y:hidden; height:80px;">@Model.Remark</textarea> + </div> + </div> + + + <div class="clearfix layer-area" style="padding-bottom:15px;" id="shenpiyijian"> + <label class="text-right col-sm-1 col-md-1 control-label">瀹℃壒鎰忚</label> + <div class="col-sm-6 col-md-6"> + <textarea class="form-control data" id="Content" name="Content" style="resize:none;overflow-y:hidden; height:80px;" maxlength="500"></textarea> + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">瀹℃壒杩涘害</label> + <div class="col-sm-6 col-md-6"> + <table> + @if (lishiyijian.Count > 0) + { + <tr> + <td style="border:1px solid #ccc;width:150px;">姝ラ </td> + <td style="border:1px solid #ccc;width:150px;"> 鎵瑰鐘舵��</td> + <td style="border:1px solid #ccc;width:150px;">鎵瑰鏃堕棿</td> + <td style="border:1px solid #ccc;width:300px;"> 瀹℃壒鎰忚</td> + <td style="border:1px solid #ccc;width:100px;"> 鎵瑰浜�</td> + </tr> + } + + @foreach (var wfHistory in lishiyijian) + { + <tr> + <td style="border:1px solid #ccc;width:150px;">@wfHistory.Step</td> + <td style="border:1px solid #ccc;width:150px;">@wfHistory.ChuliStatusName</td> + <td style="border:1px solid #ccc;width:150px;">@wfHistory.ModifytimeName</td> + <td style="border:1px solid #ccc;width:300px;">@wfHistory.Content</td> + <td style="border:1px solid #ccc;width:100px;">@wfHistory.DeelUserIdName</td> + </tr> + } + </table> + </div> + </div> + <div class="clearfix layer-area" style="padding-bottom:60px;"> + + </div> + </div> + </div> + </div> + </div> + </div> + </div> + <div class="ibox-content" id="top" style="z-index:100; position:fixed; height:50px; width:100%;bottom:0; text-align: right; padding-top:8px "> + <div class="" style="float:right;" data-bootstro-width="500px"> + <a class="btn btn-success" href="javascript:void(0)" onclick="_pageAutoClose();" style="margin-left:4px; border-radius:4px;"> + <i class="glyphicon glyphicon-remove"></i> <span class="bold">鍙栨秷</span> + </a> + <a class="btn btn-success" id="tijiao" href="javascript:void(0)" onclick="saveSimCost('');" style="margin-left:4px; border-radius:4px;"> + <i class="glyphicon glyphicon-ok"></i> <span class="bold">鎻愪氦</span> + </a> + + <a class="btn btn-success" id="tongyi" href="javascript:void(0)" onclick="saveSimCost('A');" style="margin-left:4px; border-radius:4px;"> + <span class="bold">鍚屾剰</span> + </a> + + <a class="btn btn-success" id="jujue" href="javascript:void(0)" onclick="saveSimCost('D');" style="margin-left:4px; border-radius:4px;"> + <span class="bold">鎷掔粷</span> + </a> + <input type="hidden" id="id" name="id" value="@Model.Id" /> + <input type="hidden" id="Tongguojujue" name="Tongguojujue" value="" /> + <input type="hidden" id="Step" name="Step" value="@dangqianbuzhou" /> + </div> + </div> + + </form> + + <script type="text/javascript"> + + var hh = document.body.clientHeight - $("#top").height() * 2 - 50; + $("#div_content").height(hh); + + toastr.options = { + "closeButton": true, + "debug": false, + "progressBar": true, + "positionClass": "toast-bottom-right", + "onclick": null, + "showDuration": "300", + "hideDuration": "600", + "timeOut": "4500", + "extendedTimeOut": "600", + "showEasing": "swing", + "hideEasing": "linear", + "showMethod": "fadeIn", + "hideMethod": "fadeOut" + }; + + + $(function () { + + + + + + if ("@shifoubiaoji" != "A") { + $("input").attr('readonly', true); + $("textarea").attr('readonly', true); + $(':radio').attr('disabled', true); + $(':checkbox').attr('disabled', true); + $(':button').attr('disabled', true); + //$('a').removeAttr('onclick'); + $('select').attr('disabled', true); + $("#fileUp").attr('disabled', true); + + $('.fujianshanchu').removeAttr('onclick'); + + + if ("@sifoudangqian" == "A") { + $("#Content").attr('readonly', false); + $('#tijiao').hide(); + } else { + $('#tongyi').hide(); + $('#jujue').hide(); + $('#tijiao').hide(); + $('#shenpiyijian').hide(); + } + + } else { + + + //瀹℃壒鐩稿叧 + $('#shenpiyijian').hide(); + if ("@sifoudangqian" == "A") { + $('#tongyi').hide(); + $('#jujue').hide(); + $('#CustomerId').chosen(); + } else { + $('#tongyi').hide(); + $('#jujue').hide(); + $('#tijiao').hide(); + } + + + } + + }) + + + // 淇濆瓨 + function saveSimCost(tongyi) { + + + if ($.trim($("#CustomerId").val()) == '') { + toastr.warning("鍚堜綔瀹㈡埛涓嶈兘涓虹┖"); + return; + } + if ($.trim($("#OrderType").val()) == '') { + toastr.warning("璁㈠崟绫诲瀷涓嶈兘涓虹┖"); + return; + } + if ($.trim($("#Youhuistandard").val()) == '') { + toastr.warning("浼樻儬鏍囧噯涓嶈兘涓虹┖"); + return; + } + + + if ($.trim($("#YouHui").val()) == '') { + toastr.warning("浼樻儬涓嶈兘涓虹┖"); + return; + } + + $("#Tongguojujue").val(tongyi); + + $.ajax({ + type: "POST", + url: "/AdmAsk/SaveYouHui", + dataType: "json", + global: false, + data: $('#fm').serialize(), + success: function (data) { + + if (data.Result) { + parent.layer.msg('鎻愪氦鎴愬姛', { icon: 6 }); + try { + _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶 + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } + else { + parent.layer.msg(data.Message, { icon: 5 }); + } + + }, + error: function () { + parent.layer.msg('澶辫触', { icon: 5 }); + } + }); + } + + + function _pageAutoClose() { + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + + } + </script> +</body> +</html> \ No newline at end of file diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/Askcost.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/Askcost.cshtml index b4449f5..2db3a66 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmAsk/Askcost.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/Askcost.cshtml @@ -277,12 +277,20 @@ function _pageAutoClose() { - parent.window._reloadPageData(); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.isRefresh = true; - parent.layer.closeAll('loading'); - parent.layer.close(index); - return false; + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } </script> </body> diff --git a/zhengcaioa/zhengcaioa/Views/AdmAsk/Askovertime.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAsk/Askovertime.cshtml index e5ba859..6945801 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmAsk/Askovertime.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmAsk/Askovertime.cshtml @@ -311,12 +311,20 @@ function _pageAutoClose() { - parent.window._reloadPageData(); - var index = parent.layer.getFrameIndex(window.name); - parent.layer.isRefresh = true; - parent.layer.closeAll('loading'); - parent.layer.close(index); - return false; + try { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + catch (err) { + var pathname = window.location.pathname; + var search = window.location.search; + parent._CloseTab1(pathname + search); + } + } </script> </body> diff --git a/zhengcaioa/zhengcaioa/Views/CooperOrder/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/CooperOrder/Edit.cshtml index 422a85c..f7cf0c1 100644 --- a/zhengcaioa/zhengcaioa/Views/CooperOrder/Edit.cshtml +++ b/zhengcaioa/zhengcaioa/Views/CooperOrder/Edit.cshtml @@ -12,9 +12,11 @@ string ShouliStatus = ViewData["ShouliStatus"] as string; //鍙楃悊鍚庝笉鍏佽缂栬緫 + //List<SysCodeDtl> YouHuiList = ViewData["YouHuiList"] as List<SysCodeDtl>; //浼樻儬鍒楄〃 + } @{ - Layout = null; + Layout = null; } <!DOCTYPE html> @@ -103,7 +105,7 @@ <div class="row"> <div class="clearfix layer-area" style="padding-bottom:15px;"> - + <label class="text-right col-sm-1 col-md-1 control-label">璁㈠崟鍙�</label> <div class="col-sm-2 col-md-2"> @@ -189,30 +191,30 @@ </div> @*<label class="text-right col-sm-1 col-md-1 control-label">椤圭洰<i class="red">*</i></label> - <div class="col-sm-2 col-md-2"> - <select id="OrderPro" class="form-control" name="OrderPro" data-placeholder="閫夋嫨 搴忓垪 ..."> - <option value="" hassubinfo="true">璇烽�夋嫨</option> - @foreach (var item in project) - { - @if (!item.Id.Equals(Model.OrderPro)) + <div class="col-sm-2 col-md-2"> + <select id="OrderPro" class="form-control" name="OrderPro" data-placeholder="閫夋嫨 搴忓垪 ..."> + <option value="" hassubinfo="true">璇烽�夋嫨</option> + @foreach (var item in project) { - <option value="@item.Id" hassubinfo="true"> - @item.Name - </option> + @if (!item.Id.Equals(Model.OrderPro)) + { + <option value="@item.Id" hassubinfo="true"> + @item.Name + </option> + } + else + { + <option value="@item.Id" hassubinfo="true" selected="selected"> + @item.Name + </option> + } + } - else - { - <option value="@item.Id" hassubinfo="true" selected="selected"> - @item.Name - </option> } - } - } + </select> - </select> - - </div>*@ + </div>*@ @@ -226,19 +228,19 @@ <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">璁㈠崟鏁伴噺<i class="red">*</i></label> <div class="col-sm-2 col-md-2" grouptype="Vdata"> - <input class="form-control" label="瀹㈡埛鍚嶇О" name="OrderNum" id="OrderNum" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.OrderNum" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" > + <input class="form-control" label="瀹㈡埛鍚嶇О" name="OrderNum" id="OrderNum" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.OrderNum" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"> </div> <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">鍗曚环<i class="red">*</i></label> <div class="col-sm-2 col-md-2" grouptype="Vdata"> - <input class="form-control" label="瀹㈡埛鍚嶇О" name="Price" id="Price" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.Price" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> + <input class="form-control" label="瀹㈡埛鍚嶇О" name="Price" id="Price" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.Price" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> </div> <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">閲戦<i class="red">*</i></label> <div class="col-sm-2 col-md-2" grouptype="Vdata"> - <input class="form-control" label="瀹㈡埛鍚嶇О" name="Money" id="Money" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.Money" oninput="if(value.length>8)value=value.slice(0,18)" readonly="readonly"> + <input class="form-control" label="瀹㈡埛鍚嶇О" name="Money" id="Money" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.Money" oninput="if(value.length>8)value=value.slice(0,18)" readonly="readonly"> </div> @@ -279,7 +281,15 @@ </div> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <div class="col-sm-1 col-md-1"> + + </div> + <div class="col-sm-8 col-md-8" style="color:red;"> + 绯荤粺鑷姩鏍规嵁8澶╁唴鐢宠鐨勪紭鎯犻」鐩绠椾紭鎯犻噾棰� + </div> + </div> </div> diff --git a/zhengcaioa/zhengcaioa/Views/CooperOrder/Index.cshtml b/zhengcaioa/zhengcaioa/Views/CooperOrder/Index.cshtml index 7271917..e5199a7 100644 --- a/zhengcaioa/zhengcaioa/Views/CooperOrder/Index.cshtml +++ b/zhengcaioa/zhengcaioa/Views/CooperOrder/Index.cshtml @@ -166,23 +166,24 @@ }, { label: '浼樻儬/鍏�', name: 'Youhui', labtype: 'txt', hidden: youhuibool, width: 60, - formatter: function (cellvalue, options, rowObject) { - if (rowObject.YouhuiStatus == null || rowObject.YouhuiStatus == 'null' || rowObject.YouhuiStatus == '') { - if (rowObject.ShouliStatus == '1' || rowObject.ChedanStatus == 'A' ) { - if (rowObject.ChedanStatus == 'A') { - return cellvalue; - } else { - return ""; - } + //formatter: function (cellvalue, options, rowObject) { + // if (rowObject.YouhuiStatus == null || rowObject.YouhuiStatus == 'null' || rowObject.YouhuiStatus == '') { + // if (rowObject.ShouliStatus == '1' || rowObject.ChedanStatus == 'A' ) { + // if (rowObject.ChedanStatus == 'A') { + // return cellvalue; + // } else { + // return ""; + // } - } else { - return "<a onclick=\"youhui('" + rowObject.Id + "')\" >浼樻儬</a>"; - } + // } else { + // return "<a onclick=\"youhui('" + rowObject.Id + "')\" >浼樻儬</a>"; + // } - } else { - return cellvalue; - } - } }, + // } else { + // return cellvalue; + // } + //} + }, { label: '鎵撳嵃', name: 'OrderType', labtype: 'txt', hidden: false, width: 60, formatter: function (cellvalue, options, rowObject) { diff --git "a/\350\241\250\344\277\256\346\224\271.sql" "b/\350\241\250\344\277\256\346\224\271.sql" index 82e0866..e2b94cf 100644 --- "a/\350\241\250\344\277\256\346\224\271.sql" +++ "b/\350\241\250\344\277\256\346\224\271.sql" @@ -1,3 +1,298 @@ +USE [zhengcaioa] +GO + +/****** Object: Table [dbo].[ADM_AskBaiFang] Script Date: 2021/7/30 9:03:25 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +CREATE TABLE [dbo].[ADM_AskBaiFang]( + [Id] [nvarchar](50) NOT NULL, + + [CustomerId] [nvarchar](50) NULL, + [VisType] [nvarchar](50) NULL, + [Jtype] [nvarchar](50) NULL, + [BaiFangtime] [datetime] NULL, + [Remark] [nvarchar](500) NULL, + + [shenpi_status] [nvarchar](1) NULL, + [rec_status] [nvarchar](1) NOT NULL, + [creater] [nvarchar](50) NOT NULL, + [createtime] [datetime] NOT NULL, + [modifier] [nvarchar](50) NOT NULL, + [modifytime] [datetime] NOT NULL, + [createrName] [nvarchar](50) NULL, + [tittle] [nvarchar](50) NULL, + CONSTRAINT [PK__AskBaiFang __3214EC077AC5FA48] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY] +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[ADM_AskBaiFang] ADD DEFAULT ('D') FOR [shenpi_status] +GO + +ALTER TABLE [dbo].[ADM_AskBaiFang] ADD DEFAULT ('A') FOR [rec_status] +GO + +ALTER TABLE [dbo].[ADM_AskBaiFang] ADD DEFAULT ('1') FOR [creater] +GO + +ALTER TABLE [dbo].[ADM_AskBaiFang] ADD DEFAULT (getdate()) FOR [createtime] +GO + +ALTER TABLE [dbo].[ADM_AskBaiFang] ADD DEFAULT ('1') FOR [modifier] +GO + +ALTER TABLE [dbo].[ADM_AskBaiFang] ADD DEFAULT (getdate()) FOR [modifytime] +GO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +USE [zhengcaioa] +GO + +/****** Object: Table [dbo].[ADM_AskYouHui] Script Date: 2021/7/30 9:03:25 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +CREATE TABLE [dbo].[ADM_AskYouHui]( + [Id] [nvarchar](50) NOT NULL, + [CustomerId] [nvarchar](50) NULL, + [OrderType] [nvarchar](50) NULL, + [Youhuistandard] [nvarchar](50) NULL, + [YouHui] [money] NULL, + [Remark] [nvarchar](500) NULL, + + [shenpi_status] [nvarchar](1) NULL, + [rec_status] [nvarchar](1) NOT NULL, + [creater] [nvarchar](50) NOT NULL, + [createtime] [datetime] NOT NULL, + [modifier] [nvarchar](50) NOT NULL, + [modifytime] [datetime] NOT NULL, + [createrName] [nvarchar](50) NULL, + [tittle] [nvarchar](50) NULL, + CONSTRAINT [PK__AskYouHui __3214EC077AC5FA48] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY] +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[ADM_AskYouHui] ADD DEFAULT ((0)) FOR [YouHui] +GO + +ALTER TABLE [dbo].[ADM_AskYouHui] ADD DEFAULT ('D') FOR [shenpi_status] +GO + +ALTER TABLE [dbo].[ADM_AskYouHui] ADD DEFAULT ('A') FOR [rec_status] +GO + +ALTER TABLE [dbo].[ADM_AskYouHui] ADD DEFAULT ('1') FOR [creater] +GO + +ALTER TABLE [dbo].[ADM_AskYouHui] ADD DEFAULT (getdate()) FOR [createtime] +GO + +ALTER TABLE [dbo].[ADM_AskYouHui] ADD DEFAULT ('1') FOR [modifier] +GO + +ALTER TABLE [dbo].[ADM_AskYouHui] ADD DEFAULT (getdate()) FOR [modifytime] +GO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + USE [zhengcaioa] GO -- Gitblit v1.9.1