username@email.com
2021-07-30 f0226fac55f50b362d145ce969e66d41606a8b06
今日开发  订单优惠   下订单的时候计算优惠
访问申请
19个文件已修改
6个文件已添加
2701 ■■■■■ 已修改文件
zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/AdmAskBaiFangDTO.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/AdmAskYouHuiDTO.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/IAskService.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/IWfRunProcessService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/AdmAskBaiFang.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/AdmAskYouHui.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/zhengcaioaContext.cs 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/AskService.cs 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/WfRunProcessService.cs 698 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs 239 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/AskBaiFang.cshtml 394 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/AskCar.cshtml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/AskGood.cshtml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/AskMarketingCost.cshtml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/AskOther.cshtml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/AskPunishAppeal.cshtml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/AskSuggestion.cshtml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/AskYouHui.cshtml 393 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/Askcost.cshtml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmAsk/Askovertime.cshtml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/CooperOrder/Edit.cshtml 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/CooperOrder/Index.cshtml 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
表修改.sql 295 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>();
        }
    }
zhengcaioa/DTO/AdmAskBaiFangDTO.cs
New file
@@ -0,0 +1,28 @@
using 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; }
    }
}
zhengcaioa/DTO/AdmAskYouHuiDTO.cs
New file
@@ -0,0 +1,28 @@
using 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; }
    }
}
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);
    }
}
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);
    }
}
zhengcaioa/Model/AdmAskBaiFang.cs
New file
@@ -0,0 +1,25 @@
using 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; }
    }
}
zhengcaioa/Model/AdmAskYouHui.cs
New file
@@ -0,0 +1,25 @@
using 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; }
    }
}
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");
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
    }
}
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;
        }
    }
}
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 = "[]";
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);
        }
    }
}
zhengcaioa/zhengcaioa/Views/AdmAsk/AskBaiFang.cshtml
New file
@@ -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>&nbsp;&nbsp;<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>&nbsp;&nbsp;<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>
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>
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>
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>
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>
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>
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>
zhengcaioa/zhengcaioa/Views/AdmAsk/AskYouHui.cshtml
New file
@@ -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>&nbsp;&nbsp;<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>&nbsp;&nbsp;<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>
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>
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>
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>
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) {
±íÐÞ¸Ä.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