| | |
| | | CreateMap<AdmAskzczbwsydtl, AdmAskzczbwsydtlDTO>(); |
| | | CreateMap<AdmAskzczbwsydtlDTO, AdmAskzczbwsydtl>(); |
| | | |
| | | CreateMap<CustomerGuanlian, CustomerGuanlianDTO>(); |
| | | CreateMap<CustomerGuanlianDTO, CustomerGuanlian>(); |
| | | |
| | | CreateMap<IntentionCustomer, CooperatecustomCustomerDTO>(); |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public DateTime? Ywjltime { get; set; } |
| | | |
| | | public int Guanliankehushu { get; set; } |
| | | |
| | | } |
| | | |
| | | public class CooperatecustomCustomerDTOSearch : SearchEntity |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace DTO |
| | | { |
| | | public class CustomerGuanlianDTO |
| | | { |
| | | public string Id { get; set; } |
| | | public string CustomerId { get; set; } |
| | | public string Customertype { get; set; } |
| | | public string SecCustomerId { get; set; } |
| | | public string SecCustomertype { get; set; } |
| | | |
| | | |
| | | public List<CooperatecustomCustomerDTO> cooperatecustomCustomerDTOs { get; set; } |
| | | } |
| | | } |
| | |
| | | public string Viscustomer { get; set; } |
| | | |
| | | public DateTime? Ywjltime { get; set; } |
| | | |
| | | public int Guanliankehushu { get; set; } |
| | | } |
| | | |
| | | public class IntentionCustomerDTOSearch : SearchEntity |
| | |
| | | |
| | | |
| | | ResultEntity saveyufukuan(CooperatecustomCustomerDTO cooperatecustomCustomerDTO); |
| | | |
| | | |
| | | ResultEntity saveCustomerGuanlian(CustomerGuanlianDTO DTO); |
| | | |
| | | ResultEntity DeleteCustomerGuanlian(string CustomerId, string SecCustomerId); |
| | | |
| | | List<CooperatecustomCustomerDTO> GetListCustomerGuanlian(string CustomerId); |
| | | |
| | | CustomerGuanlianDTO GetCustomerGuanlian(string CustomerId,string SecCustomerId); |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | |
| | | #nullable disable |
| | | |
| | | namespace zhengcaioa.Models |
| | | { |
| | | public partial class CustomerGuanlian |
| | | { |
| | | public string Id { get; set; } |
| | | public string CustomerId { get; set; } |
| | | public string Customertype { get; set; } |
| | | public string SecCustomerId { get; set; } |
| | | public string SecCustomertype { get; set; } |
| | | } |
| | | } |
| | |
| | | public virtual DbSet<CooperOrder> CooperOrders { get; set; } |
| | | public virtual DbSet<CooperVisit> CooperVisits { get; set; } |
| | | public virtual DbSet<CooperatecustomCustomer> CooperatecustomCustomers { get; set; } |
| | | public virtual DbSet<CustomerGuanlian> CustomerGuanlians { get; set; } |
| | | public virtual DbSet<CusFangwenjilu> CusFangwenjilus { get; set; } |
| | | public virtual DbSet<FiAccount> FiAccounts { get; set; } |
| | | public virtual DbSet<FiAccountRecord> FiAccountRecords { get; set; } |
| | |
| | | .HasColumnName("taocanjianshu"); |
| | | }); |
| | | |
| | | modelBuilder.Entity<CustomerGuanlian>(entity => |
| | | { |
| | | entity.ToTable("CustomerGuanlian"); |
| | | |
| | | entity.Property(e => e.Id).HasMaxLength(50); |
| | | |
| | | entity.Property(e => e.CustomerId).HasMaxLength(50); |
| | | |
| | | entity.Property(e => e.Customertype).HasMaxLength(50); |
| | | |
| | | entity.Property(e => e.SecCustomerId).HasMaxLength(50); |
| | | |
| | | entity.Property(e => e.SecCustomertype).HasMaxLength(50); |
| | | }); |
| | | |
| | | modelBuilder.Entity<CusFangwenjilu>(entity => |
| | | { |
| | | entity.ToTable("cus_fangwenjilu"); |
| | |
| | | cooperatecustomCustomer.Ywjltime = DateTime.Now; |
| | | var Cooper = _context.CooperatecustomCustomers.Count(x => x.RecStatus == "A" && x.Ywjl == cooperatecustomCustomer.Ywjl); |
| | | var Inten = _context.IntentionCustomers.Count(x => x.RecStatus == "A" && x.Ywjl == cooperatecustomCustomer.Ywjl); |
| | | if (Cooper + Inten >= 1000) |
| | | if (Cooper + Inten >= 2000) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该业务经理,客户单位和合作客户合计超过1000!"; |
| | | resultEntity.Message = "该业务经理,客户单位和合作客户合计超过2000!"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | |
| | | updateproject.Ywjltime = DateTime.Now; |
| | | var Cooper = _context.CooperatecustomCustomers.Count(x => x.RecStatus == "A" && x.Ywjl == cooperatecustomCustomer.Ywjl); |
| | | var Inten = _context.IntentionCustomers.Count(x => x.RecStatus == "A" && x.Ywjl == cooperatecustomCustomer.Ywjl); |
| | | if (Cooper + Inten >= 1000) |
| | | if (Cooper + Inten >= 2000) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该业务经理,客户单位和合作客户合计超过1000!"; |
| | | resultEntity.Message = "该业务经理,客户单位和合作客户合计超过2000!"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | |
| | | cooperatecustomCustomerDTO.Hezuoyewu += "采购公告权限 | "; |
| | | } |
| | | |
| | | cooperatecustomCustomerDTO.Guanliankehushu = _context.CustomerGuanlians.Count(x => x.CustomerId == cooperatecustomCustomerDTO.Id); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | var list = _mapper.Map<List<CooperatecustomCustomerDTO>>(listPosition); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | public ResultEntity saveCustomerGuanlian(CustomerGuanlianDTO DTO) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | var customerGuanlian = _mapper.Map<CustomerGuanlian>(DTO); |
| | | |
| | | |
| | | if (String.IsNullOrEmpty(customerGuanlian.Id)) |
| | | { |
| | | customerGuanlian.Id = Guid.NewGuid().ToString(); |
| | | DTO.Id = customerGuanlian.Id; |
| | | _context.CustomerGuanlians.Add(customerGuanlian); |
| | | |
| | | CustomerGuanlian customerGuanlian1 = new CustomerGuanlian(); |
| | | customerGuanlian1.Id = Guid.NewGuid().ToString(); |
| | | customerGuanlian1.CustomerId = customerGuanlian.SecCustomerId; |
| | | customerGuanlian1.Customertype = customerGuanlian.SecCustomertype; |
| | | customerGuanlian1.SecCustomerId = customerGuanlian.CustomerId; |
| | | customerGuanlian1.SecCustomertype = customerGuanlian.Customertype; |
| | | _context.CustomerGuanlians.Add(customerGuanlian1); |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = customerGuanlian.Id; |
| | | resultEntity.Result = true; |
| | | |
| | | return resultEntity; |
| | | } |
| | | |
| | | public CustomerGuanlianDTO GetCustomerGuanlian(string CustomerId, string SecCustomerId) |
| | | { |
| | | var entity = _context.CustomerGuanlians.Where(x=>x.CustomerId == CustomerId && x.SecCustomerId == SecCustomerId).FirstOrDefault(); |
| | | if (entity == null) |
| | | { |
| | | entity = new CustomerGuanlian(); |
| | | } |
| | | var customerGuanlianDTO = _mapper.Map<CustomerGuanlianDTO>(entity); |
| | | return customerGuanlianDTO; |
| | | } |
| | | |
| | | public ResultEntity DeleteCustomerGuanlian(string CustomerId, string SecCustomerId) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | |
| | | |
| | | var entity = _context.CustomerGuanlians.Where(x => x.CustomerId == CustomerId && x.SecCustomerId == SecCustomerId).FirstOrDefault(); |
| | | |
| | | if (entity != null) |
| | | { |
| | | var entity1 = _context.CustomerGuanlians.Where(x => x.CustomerId == entity.SecCustomerId && x.SecCustomerId == entity.CustomerId).FirstOrDefault(); |
| | | _context.CustomerGuanlians.Remove(entity); |
| | | if (entity1 != null) |
| | | { |
| | | _context.CustomerGuanlians.Remove(entity1); |
| | | } |
| | | } |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = CustomerId; |
| | | resultEntity.Result = true; |
| | | return resultEntity; |
| | | } |
| | | public List<CooperatecustomCustomerDTO> GetListCustomerGuanlian(string CustomerId) |
| | | { |
| | | var customerGuanlians = _context.CustomerGuanlians.Where(x=>x.CustomerId == CustomerId).ToList(); |
| | | List <CooperatecustomCustomerDTO> cooperatecustomCustomerDTOs = new List<CooperatecustomCustomerDTO>(); |
| | | if (customerGuanlians!=null && customerGuanlians.Count > 0) |
| | | { |
| | | var hezuokehu = customerGuanlians/*.Where(x => x.SecCustomertype == "合作客户")*/.Select(x => x.SecCustomerId).ToArray(); |
| | | if(hezuokehu!=null&& hezuokehu.Length > 0) |
| | | { |
| | | var cooperatecustomCustomers = _context.CooperatecustomCustomers.Where(x => x.RecStatus == "A" && hezuokehu.Contains(x.Id)).ToList(); |
| | | var cooperatecustomCustomerDTOssss = _mapper.Map<List<CooperatecustomCustomerDTO>>(cooperatecustomCustomers); |
| | | foreach(var cooperatecustomCustomerDTO in cooperatecustomCustomerDTOssss) |
| | | { |
| | | cooperatecustomCustomerDTO.Customertype = "合作客户"; |
| | | cooperatecustomCustomerDTOs.Add(cooperatecustomCustomerDTO); |
| | | |
| | | } |
| | | |
| | | } |
| | | //var dangankehu = customerGuanlians.Where(x => x.SecCustomertype == "档案客户").Select(x => x.SecCustomerId).ToArray(); |
| | | if (hezuokehu != null && hezuokehu.Length > 0) |
| | | { |
| | | var intentionCustomers = _context.IntentionCustomers.Where(x => x.RecStatus == "A" && hezuokehu.Contains(x.Id)).ToList(); |
| | | var cooperatecustomCustomerDTOssss = _mapper.Map<List<CooperatecustomCustomerDTO>>(intentionCustomers); |
| | | foreach (var cooperatecustomCustomerDTO in cooperatecustomCustomerDTOssss) |
| | | { |
| | | cooperatecustomCustomerDTO.Customertype = "档案客户"; |
| | | cooperatecustomCustomerDTOs.Add(cooperatecustomCustomerDTO); |
| | | } |
| | | } |
| | | } |
| | | return cooperatecustomCustomerDTOs; |
| | | } |
| | | } |
| | | } |
| | |
| | | intentionCustomer.Ywjltime = DateTime.Now; |
| | | var Cooper = _context.CooperatecustomCustomers.Count(x => x.RecStatus == "A" && x.Ywjl == intentionCustomer.Ywjl); |
| | | var Inten = _context.IntentionCustomers.Count(x => x.RecStatus == "A" && x.Ywjl == intentionCustomer.Ywjl); |
| | | if(Cooper+ Inten >= 1000) |
| | | if(Cooper+ Inten >= 2000) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该业务经理,客户单位和合作客户合计超过1000!"; |
| | | resultEntity.Message = "该业务经理,客户单位和合作客户合计超过2000!"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | |
| | | updateproject.Ywjltime = DateTime.Now; |
| | | var Cooper = _context.CooperatecustomCustomers.Count(x => x.RecStatus == "A" && x.Ywjl == intentionCustomer.Ywjl); |
| | | var Inten = _context.IntentionCustomers.Count(x => x.RecStatus == "A" && x.Ywjl == intentionCustomer.Ywjl); |
| | | if (Cooper + Inten >= 1000) |
| | | if (Cooper + Inten >= 2000) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该业务经理,客户单位和合作客户合计超过1000!"; |
| | | resultEntity.Message = "该业务经理,客户单位和合作客户合计超过2000!"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | var query = (from a in _context.IntentionCustomers |
| | | join b in listCode.Where(x => x.CodeTable == "IntentionCustomer" && x.CodeField == "khly") |
| | | on a.Khly equals b.CodeSn |
| | | join c in listCode.Where(x => x.CodeTable == "CooperatecustomCustomer" && x.CodeField == "hyfl") |
| | | on a.Hyfl equals c.CodeSn |
| | | join d in listCode.Where(x => x.CodeTable == "CooperatecustomCustomer" && x.CodeField == "khlx") |
| | | on a.Khlx equals d.CodeSn |
| | | join e in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A" && x.IsYwjl == "A") |
| | | on a.Ywjl equals e.Id |
| | | into esss |
| | | from abi in esss.DefaultIfEmpty() |
| | | // join b in listCode.Where(x => x.CodeTable == "IntentionCustomer" && x.CodeField == "khly") |
| | | // on a.Khly equals b.CodeSn |
| | | // join c in listCode.Where(x => x.CodeTable == "CooperatecustomCustomer" && x.CodeField == "hyfl") |
| | | // on a.Hyfl equals c.CodeSn |
| | | // join d in listCode.Where(x => x.CodeTable == "CooperatecustomCustomer" && x.CodeField == "khlx") |
| | | //on a.Khlx equals d.CodeSn |
| | | // join e in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A" && x.IsYwjl == "A") |
| | | // on a.Ywjl equals e.Id |
| | | // into esss |
| | | // from abi in esss.DefaultIfEmpty() |
| | | |
| | | join f in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A" ) |
| | | on a.Dianxiaozhuanyuan equals f.Id |
| | | into fsss |
| | | from fff in fsss.DefaultIfEmpty() |
| | | // join f in _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A" ) |
| | | // on a.Dianxiaozhuanyuan equals f.Id |
| | | // into fsss |
| | | // from fff in fsss.DefaultIfEmpty() |
| | | |
| | | join f in _context.Areas on a.Sheng equals f.CodeId |
| | | join g in _context.Areas on a.City equals g.CodeId |
| | | join h in _context.Areas on a.AreaId equals h.CodeId |
| | | // join f in _context.Areas on a.Sheng equals f.CodeId |
| | | // join g in _context.Areas on a.City equals g.CodeId |
| | | // join h in _context.Areas on a.AreaId equals h.CodeId |
| | | |
| | | |
| | | join l in _context.IntentionVisits.Where(x => x.RecStatus == "A").GroupBy(q => new { q.Viscustomer }).Select(q => new |
| | |
| | | Hyfl = a.Hyfl, |
| | | Khlx = a.Khlx, |
| | | Ywjl = a.Ywjl, |
| | | ShengName = f.Name + "-" + g.Name + "-" + h.Name, |
| | | CityName = g.Name, |
| | | AreaIdName = h.Name, |
| | | KhlyName = b.Comments, |
| | | HyflName = c.Comments, |
| | | KhlxName = d.Comments, |
| | | YwjlName = abi.UserName, |
| | | //ShengName = f.Name + "-" + g.Name + "-" + h.Name, |
| | | //CityName = g.Name, |
| | | //AreaIdName = h.Name, |
| | | //KhlyName = b.Comments, |
| | | //HyflName = c.Comments, |
| | | //KhlxName = d.Comments, |
| | | //YwjlName = abi.UserName, |
| | | Name = a.Name, |
| | | Postal = a.Postal, |
| | | Address = a.Address, |
| | |
| | | YixiangtimeName = a.Yixiangtime.HasValue? a.Yixiangtime.Value.ToString("yyyy-MM-dd"):"", |
| | | Yixiang = a.Yixiang, |
| | | Dianxiaozhuanyuan = a.Dianxiaozhuanyuan, |
| | | DianxiaozhuanyuanName = fff.UserName, |
| | | //DianxiaozhuanyuanName = fff.UserName, |
| | | Zuijinzhuizongtime = a.Zuijinzhuizongtime, |
| | | ZuijinzhuizongtimeName = a.Zuijinzhuizongtime.HasValue ? a.Zuijinzhuizongtime.Value.ToString("yyyy-MM-dd") : "", |
| | | Visittimes = lll.Visittimes, |
| | |
| | | searchEntity.totalrows = query.Count(); |
| | | var lianlist = query.OrderByDescending(x => x.Modifytime).Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | |
| | | if(lianlist!=null && lianlist.Count > 0) |
| | | { |
| | | var areas = _context.Areas; |
| | | var pltUsers = _context.PltUsers.Where(x => x.RecStatus == "A" && x.Zhiwustatus == "A"); |
| | | |
| | | var khly = listCode.Where(x => x.CodeTable == "IntentionCustomer" && x.CodeField == "khly"); |
| | | |
| | | |
| | | var hyfl = listCode.Where(x => x.CodeTable == "CooperatecustomCustomer" && x.CodeField == "hyfl"); |
| | | |
| | | |
| | | var khlx = listCode.Where(x => x.CodeTable == "CooperatecustomCustomer" && x.CodeField == "khlx"); |
| | | |
| | | |
| | | foreach (var intentionCustomerDTO in lianlist) |
| | | { |
| | | var sheng = areas.Where(x => x.CodeId == intentionCustomerDTO.Sheng).FirstOrDefault(); |
| | | var city = areas.Where(x => x.CodeId == intentionCustomerDTO.City).FirstOrDefault(); |
| | | var Area = areas.Where(x => x.CodeId == intentionCustomerDTO.AreaId).FirstOrDefault(); |
| | | if (sheng != null) |
| | | { |
| | | intentionCustomerDTO.ShengName = sheng.Name; |
| | | } |
| | | if (city != null) |
| | | { |
| | | intentionCustomerDTO.CityName = city.Name; |
| | | intentionCustomerDTO.ShengName += "-" + city.Name; |
| | | } |
| | | if (Area != null) |
| | | { |
| | | intentionCustomerDTO.AreaIdName = Area.Name; |
| | | intentionCustomerDTO.ShengName += "-" + Area.Name; |
| | | } |
| | | var ywjl = pltUsers.Where(x => x.Id == intentionCustomerDTO.Ywjl).FirstOrDefault(); |
| | | if (ywjl != null) |
| | | { |
| | | intentionCustomerDTO.YwjlName = ywjl.UserName; |
| | | } |
| | | var Dianxiaozhuanyuan = pltUsers.Where(x => x.Id == intentionCustomerDTO.Dianxiaozhuanyuan).FirstOrDefault(); |
| | | if (Dianxiaozhuanyuan != null) |
| | | { |
| | | intentionCustomerDTO.DianxiaozhuanyuanName = Dianxiaozhuanyuan.UserName; |
| | | } |
| | | var KhlyName = khly.Where(x => x.CodeSn == intentionCustomerDTO.Khly).FirstOrDefault(); |
| | | if (KhlyName != null) |
| | | { |
| | | intentionCustomerDTO.KhlyName = KhlyName.Comments; |
| | | } |
| | | var HyflName = hyfl.Where(x => x.CodeSn == intentionCustomerDTO.Hyfl).FirstOrDefault(); |
| | | if (HyflName != null) |
| | | { |
| | | intentionCustomerDTO.HyflName = HyflName.Comments; |
| | | } |
| | | var KhlxName = khlx.Where(x => x.CodeSn == intentionCustomerDTO.Khlx).FirstOrDefault(); |
| | | if (KhlxName != null) |
| | | { |
| | | intentionCustomerDTO.KhlxName = KhlxName.Comments; |
| | | } |
| | | |
| | | |
| | | intentionCustomerDTO.Guanliankehushu = _context.CustomerGuanlians.Count(x => x.CustomerId == intentionCustomerDTO.Id); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //foreach (var intentionCustomerDTO in lianlist) |
| | | //{ |
| | |
| | | //} |
| | | |
| | | |
| | | data.LoadData(searchEntity, lianlist); |
| | | data.LoadData(searchEntity, lianlist); |
| | | return data; |
| | | } |
| | | |
| | |
| | | return View(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [CheckLogin] |
| | | |
| | | public IActionResult IndexCustomerGuanlian(string CustomerId,string Customertype) |
| | | { |
| | | |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | |
| | | CustomerGuanlianDTO customerGuanlianDTO = new CustomerGuanlianDTO(); |
| | | customerGuanlianDTO.CustomerId = CustomerId; |
| | | customerGuanlianDTO.Customertype = Customertype; |
| | | customerGuanlianDTO.cooperatecustomCustomerDTOs = _cooperatecustomCustomerService.GetListCustomerGuanlian(CustomerId); |
| | | |
| | | |
| | | |
| | | ViewData.Model = customerGuanlianDTO; |
| | | return View(); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 保存 |
| | | /// </summary> |
| | | /// <param name="data">岗位实体类对象</param> |
| | | /// <returns></returns> |
| | | /// |
| | | [HttpPost] |
| | | public IActionResult DelCustomerGuanlian(CustomerGuanlianDTO dTO) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = false; |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | |
| | | |
| | | |
| | | |
| | | resultEntity = _cooperatecustomCustomerService.DeleteCustomerGuanlian(dTO.CustomerId, dTO.SecCustomerId); |
| | | |
| | | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | |
| | | public IActionResult IndexSelect(string Id, string Customertype) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | List<ActionEntity> actionlist = new List<ActionEntity>(); |
| | | |
| | | |
| | | |
| | | |
| | | ActionEntity actionEntity = new ActionEntity(); |
| | | actionEntity.OpenType = 0; |
| | | actionEntity.ActionUrl = ""; |
| | | actionEntity.ActionFun = "Search"; |
| | | actionEntity.PageIco = "fa fa-search"; |
| | | actionEntity.ActionName = "查询"; |
| | | actionlist.Add(actionEntity); |
| | | |
| | | |
| | | ActionEntity actionEntity2 = new ActionEntity(); |
| | | actionEntity2.OpenType = 0; |
| | | actionEntity2.ActionUrl = ""; |
| | | actionEntity2.ActionFun = "Zhuanyi"; |
| | | actionEntity2.PageIco = "fa fa-exchange"; |
| | | actionEntity2.ActionName = "确认关联"; |
| | | actionlist.Add(actionEntity2); |
| | | |
| | | |
| | | ViewData["ActionInfo"] = actionlist; |
| | | //ViewData["ActionInfo2"] = pageEntities2; |
| | | |
| | | ViewBag.khlx = _liaotianService.GetSYScode("CooperatecustomCustomer", "khlx").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewBag.khly = _liaotianService.GetSYScode("IntentionCustomer", "khly").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewBag.hyfl = _liaotianService.GetSYScode("CooperatecustomCustomer", "hyfl").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | |
| | | ViewBag.users = _userService.GetList().Where(x => x.IsYwjl == "A").Select(x => new { code = x.Id, label = x.UserName }).ToList(); |
| | | |
| | | ViewBag.Creater = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList(); |
| | | |
| | | ViewBag.shifou = _liaotianService.GetSYScode("system", "shifou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | |
| | | |
| | | var areaDTOs = _projectService.Getsheng().ToList(); |
| | | foreach (var areaDTO in areaDTOs) |
| | | { |
| | | if (areaDTO.CodeId == "510000") |
| | | { |
| | | areaDTOs.Remove(areaDTO); |
| | | break; |
| | | } |
| | | } |
| | | var areaDTOsic = new Area(); |
| | | areaDTOsic.CodeId = "510000"; |
| | | areaDTOsic.Name = "四川省"; |
| | | areaDTOsic.ParentId = "0 "; |
| | | areaDTOs.Insert(1, areaDTOsic); |
| | | ViewBag.ShengDropDown = areaDTOs.Select(x => new { code = x.CodeId, label = x.Name }).ToList(); |
| | | |
| | | ViewBag.Baomingtimebegin = DateTime.Now.AddMonths(-6).ToString("yyyy-MM-dd"); |
| | | ViewBag.Baomingtimeend = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | ViewBag.Id = Id; |
| | | ViewBag.Customertype1 = Customertype; |
| | | |
| | | ViewBag.Customertype = _liaotianService.GetSYScode("ADM_Askzczbwsydtl", "Customertype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | |
| | | |
| | | return View(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 保存 |
| | | /// </summary> |
| | | /// <param name="data">岗位实体类对象</param> |
| | | /// <returns></returns> |
| | | /// |
| | | [HttpPost] |
| | | public IActionResult SaveCustomerGuanlian(CustomerGuanlianDTO dTO) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | |
| | | using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, |
| | | new TransactionOptions |
| | | { |
| | | IsolationLevel = IsolationLevel.ReadCommitted, |
| | | Timeout = TransactionManager.MaximumTimeout |
| | | } |
| | | )) |
| | | { |
| | | |
| | | if (!string.IsNullOrWhiteSpace(dTO.SecCustomerId)) |
| | | { |
| | | var SecCustomerId = dTO.SecCustomerId.Split(','); |
| | | |
| | | var SecCustomertype = dTO.SecCustomertype.Split(','); |
| | | |
| | | for (int i = 0; i < SecCustomerId.Length; i++) |
| | | { |
| | | var customerGuanlianDTO = _cooperatecustomCustomerService.GetCustomerGuanlian(dTO.CustomerId, SecCustomerId[i]); |
| | | |
| | | if (string.IsNullOrEmpty(customerGuanlianDTO.Id)) |
| | | { |
| | | customerGuanlianDTO.CustomerId = dTO.CustomerId; |
| | | customerGuanlianDTO.Customertype = dTO.Customertype; |
| | | customerGuanlianDTO.SecCustomerId = SecCustomerId[i]; |
| | | customerGuanlianDTO.SecCustomertype = SecCustomertype[i]; |
| | | resultEntity = _cooperatecustomCustomerService.saveCustomerGuanlian(customerGuanlianDTO); |
| | | } |
| | | } |
| | | scope.Complete(); |
| | | } |
| | | else |
| | | { |
| | | resultEntity.Result = true; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | admSignInDTO = new AdmSignInDTO(); |
| | | } |
| | | //查询请假 请假时间不能重叠 |
| | | List<AdmAskLeaveDTO> admAskLeaveDTOMin = admAskLeaveDTOs.Where(x =>/*x.Lavetype != "2" &&*/ x.StratTime < dateminkaoqin.AddDays(1) && x.EndTime > dateminkaoqin).OrderByDescending(x=>x.Createtime).ToList(); |
| | | List<AdmAskLeaveDTO> admAskLeaveDTOMin = admAskLeaveDTOs.Where(x => x.Lavetype != "2" && x.StratTime < dateminkaoqin.AddDays(1) && x.EndTime > dateminkaoqin).OrderByDescending(x=>x.Createtime).ToList(); |
| | | //查询销假 销假时间不能重叠 |
| | | List<AdmAskLeaveOffDTO> admAskLeaveOffDTOMin = admAskLeaveOffDTOs.Where(x => x.StratTime < dateminkaoqin.AddDays(1) && x.EndTime > dateminkaoqin).OrderByDescending(x => x.Createtime).ToList(); |
| | | |
| | |
| | | return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/CooperatecustomCustomer/Edit?id=" + rowObject.Id + "')\" >" + cellvalue + "</a>"; |
| | | } |
| | | }, |
| | | { |
| | | label: '关联客户数', name: 'Guanliankehushu', labtype: 'txt', hidden: false, width: 100, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return "<a onclick=\"OpenWindow('" + rowObject.Name.replace(/'/g, '') + "','100%','100%', '/CooperatecustomCustomer/IndexCustomerGuanlian?CustomerId=" + rowObject.Id + "&Customertype=合作客户')\" >" + cellvalue + "</a>"; |
| | | } |
| | | }, |
| | | { label: '联系电话', name: 'Tel', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '所属区域', name: 'ShengName', labtype: 'txt', hidden: false, width: 100 }, |
| | | //{ label: '客户来源', name: 'KhlyName', labtype: 'txt', hidden: false, width: 100 }, |
| | |
| | | return "<a class='Huifang' style='display: none;' onclick=\"OpenWindow('回访记录','98%','100%', '/CooperVisit/Index?IsYwjl=true&Viscustomer=" + rowObject.Id + "')\" >回访记录</a>"; |
| | | } |
| | | }, |
| | | { |
| | | label: '添加关联客户', name: 'Guanliankehushu', labtype: 'txt', hidden: false, width: 100, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return "<a onclick=\"OpenWindow('" + rowObject.Name.replace(/'/g, '') + "','100%','100%', '/CooperatecustomCustomer/IndexSelect?Id=" + rowObject.Id + "&Customertype=合作客户')\" >添加关联客户</a>"; |
| | | } |
| | | }, |
| | | ]; |
| | | dataUrl = "/CooperatecustomCustomer/GetList?Createtime=" + Baomingtimebegin + "|" + Baomingtimeend +"@(string.IsNullOrEmpty(Creater)?"": "&Ywjl=" + Creater)"; |
| | | searchCol = [ |
New file |
| | |
| | | @model CustomerGuanlianDTO; |
| | | @using DTO; |
| | | @using zhengcaioa.Models; |
| | | @{ |
| | | Layout = null; |
| | | |
| | | |
| | | |
| | | //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; |
| | | } |
| | | |
| | | table { |
| | | border-collapse: collapse; |
| | | border: none; |
| | | width: 900px; |
| | | margin-left: 0px; |
| | | text-align: center; |
| | | } |
| | | |
| | | td { |
| | | border: solid #000000 1px; |
| | | height: 30px; |
| | | } |
| | | </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-7 col-md-7"> |
| | | <a class="btn btn-success" id="xuanze" href="javascript:void(0)" onclick="xuanzekehu();" style="margin-left:4px; border-radius:4px;"> |
| | | <i class="glyphicon glyphicon-ok"></i> <span class="bold">选择</span> |
| | | </a> |
| | | </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-8 col-md-8"> |
| | | <table style="width:95%;" id="kehutable"> |
| | | @{ |
| | | int i = 1; |
| | | } |
| | | <tr> |
| | | @*<td style="width:10%;"> 编号</td>*@ |
| | | <td style="width:60%;"> 客户名称</td> |
| | | |
| | | <td style="width:15%;"> 联系方式</td> |
| | | <td style="width:15%;"> 客户类型</td> |
| | | <td style="width:10%;"> 删除</td> |
| | | </tr> |
| | | @*<tr class="Customers"> |
| | | |
| | | <td> 1</td> |
| | | <td> 测试客户</td> |
| | | <td> 测试电话</td> |
| | | <td> |
| | | 合作客户 |
| | | <input type="hidden" name="Customername" value="测试客户" /> |
| | | <input type="hidden" name="Phone" value="测试电话" /> |
| | | <input type="hidden" name="Customertype" value="合作客户" /> |
| | | <input type="hidden" name="CustomerId" value="32423423432432434" /> |
| | | </td> |
| | | </tr>*@ |
| | | |
| | | @if (Model.cooperatecustomCustomerDTOs != null && Model.cooperatecustomCustomerDTOs.Count > 0) |
| | | { |
| | | @foreach (var cooperatecustomCustomerDTO in Model.cooperatecustomCustomerDTOs) |
| | | { |
| | | <tr class="Customers"> |
| | | |
| | | @*<td> @i</td>*@ |
| | | <td> @cooperatecustomCustomerDTO.Name</td> |
| | | <td> @cooperatecustomCustomerDTO.Tel</td> |
| | | <td> |
| | | @cooperatecustomCustomerDTO.Customertype |
| | | <input type="hidden" name="Customername" value="@cooperatecustomCustomerDTO.Name" /> |
| | | <input type="hidden" name="Phone" value="@cooperatecustomCustomerDTO.Tel" /> |
| | | <input type="hidden" name="Customertype" value="@cooperatecustomCustomerDTO.Customertype" /> |
| | | <input type="hidden" name="CustomerId" value="@cooperatecustomCustomerDTO.Id" /> |
| | | </td> |
| | | <td style="width:10%;"> <button type="button" class="delBtn" onclick="delBtn(this, '@cooperatecustomCustomerDTO.Id','@Model.CustomerId')" data-type="3" style="width:32px">-</button> </td> |
| | | </tr> |
| | | |
| | | i++; |
| | | } |
| | | } |
| | | </table> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | <div class="clearfix layer-area" style="padding-bottom:60px;"> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </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" |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | var xuanzekehu = function () { |
| | | OpenWindow("选择客户", "100%", "100%", "/CooperatecustomCustomer/IndexSelect?Id=@(Model.CustomerId)&Customertype=@(Html.Raw(Model.Customertype))"); |
| | | } |
| | | |
| | | |
| | | var _reloadPageData = function () { |
| | | |
| | | |
| | | window.location = "/CooperatecustomCustomer/IndexCustomerGuanlian?CustomerId=@(Model.CustomerId)&Customertype=@(Html.Raw(Model.Customertype))"; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | function delBtn(obj, id, CustomerId) { |
| | | |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/CooperatecustomCustomer/DelCustomerGuanlian", |
| | | dataType: "json", |
| | | global: false, |
| | | data: { CustomerId: CustomerId, SecCustomerId: id}, |
| | | success: function (data) { |
| | | |
| | | if (data.Result) { |
| | | $(obj).parent().parent().remove(); |
| | | layer.msg('删除成功', { icon: 6 }); |
| | | //try { |
| | | // _pageAutoClose();//自动关闭页面方法 |
| | | //} |
| | | //catch (err) { |
| | | // var pathname = window.location.pathname; |
| | | // var search = window.location.search; |
| | | // parent._CloseTab1(pathname + search); |
| | | //} |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | |
| | | }, |
| | | error: function () { |
| | | layer.msg('失败', { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |
New file |
| | |
| | | @using DTO; |
| | | @{ |
| | | ViewBag.Title = "IntentionCustomer"; |
| | | Layout = "~/Views/Shared/_Layout_Search.cshtml"; |
| | | |
| | | |
| | | } |
| | | @section headerStyle{ |
| | | <script type="text/javascript"> |
| | | var khlxs = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.khlx))'; |
| | | var khlys = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.khly))'; |
| | | var hyfls = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.hyfl))'; |
| | | var users = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.users))'; |
| | | var shengDropDown = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.ShengDropDown))'; |
| | | var Creater = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Creater))'; |
| | | var shifou = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.shifou))'; |
| | | |
| | | var Customertype = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.Customertype))'; |
| | | |
| | | var Baomingtimebegin = '@Html.Raw(ViewBag.Baomingtimebegin)'; |
| | | var Baomingtimeend = '@Html.Raw(ViewBag.Baomingtimeend)'; |
| | | var Id = '@Html.Raw(ViewBag.Id)'; |
| | | var Customertype1 = '@Html.Raw(ViewBag.Customertype1)'; |
| | | |
| | | loseherght = 60; |
| | | gridConfig = { multiselect: true, selectcol: "Id" }; |
| | | dataCol = [ |
| | | { |
| | | label: 'id', name: 'Id', labtype: 'txt', hidden: true |
| | | }, |
| | | { label: '建档时间', name: 'CreatetimeName', labtype: 'txt', hidden: false, width: 100 }, |
| | | { |
| | | label: '客户单位', name: 'Name', labtype: 'txt', hidden: false, width: 400 |
| | | }, |
| | | |
| | | { label: '联系电话', name: 'Tel', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '所属区域', name: 'ShengName', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '客户来源', name: 'KhlyName', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '行业分类', name: 'HyflName', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '客户类型', name: 'KhlxName', labtype: 'txt', hidden: false, width: 100}, |
| | | { label: '业务经理', name: 'YwjlName', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '客户种类', name: 'Customertype', labtype: 'txt', hidden: false, width: 100 }, |
| | | |
| | | ]; |
| | | dataUrl = "/IntentionCustomer/GetListSelect?Createtime=" + Baomingtimebegin + "|" + Baomingtimeend +"&Customertype=01"; |
| | | searchCol = [ |
| | | { label: '客户来源', name: 'Khly', labtype: 'combox', hidden: false, data: JSON.parse(khlys), cwidth: '5%', cccwidth: '8%' }, |
| | | { label: '行业分类', name: 'Hyfl', labtype: 'combox', hidden: false, data: JSON.parse(hyfls), cwidth: '5%', cccwidth: '15%' }, |
| | | { label: '客户类型', name: 'Khlx', labtype: 'combox', hidden: false, data: JSON.parse(khlxs), cwidth: '5%', cccwidth: '8%' }, |
| | | { label: '业务经理', name: 'Ywjl', labtype: 'combox', hidden: false, data: JSON.parse(users), cwidth: '5%', cccwidth: '8%' }, |
| | | |
| | | { label: '省', name: 'Sheng', labtype: 'combox', hidden: false, data: JSON.parse(shengDropDown), cwidth: '5%', cccwidth: '8%' }, |
| | | { label: '市', name: 'City', labtype: 'combox', hidden: false, data: JSON.parse('[]'), cwidth: '1%', cccwidth: '8%' }, |
| | | { label: '区县', name: 'AreaId', labtype: 'combox', hidden: false, data: JSON.parse('[]'), cwidth: '2%', cccwidth: '8%' }, |
| | | { label: '客户单位', name: 'Name', labtype: 'txt', hidden: false }, |
| | | { label: '建档时间', name: 'Createtime', labtype: 'datearea', hidden: false }, |
| | | { label: '客户种类', name: 'Customertype', labtype: 'combox', hidden: false, data: JSON.parse(Customertype), cwidth: '5%', cccwidth: '8%' }, |
| | | |
| | | |
| | | ]; |
| | | |
| | | |
| | | var _pageSearch = function () { |
| | | $("#jqGrid").jqGrid('setGridParam', { |
| | | url: dataUrl = "/IntentionCustomer/GetListSelect", postData: jsons, page: 1 |
| | | }); //重新载入 |
| | | var jsons = GetSearchEnd(); |
| | | if (jsons == false) { |
| | | msg.info("请录入查询条件"); |
| | | return false; |
| | | } |
| | | LoadGrid(jsons); |
| | | } |
| | | |
| | | |
| | | |
| | | var _pageZhuanyi = function () { |
| | | |
| | | var duanxin = GetGridSelect(); |
| | | var SecCustomerId = ""; |
| | | var SecCustomertype = ""; |
| | | if (duanxin != '') { |
| | | var Customerss = Id; |
| | | var Customertype = Customertype1; |
| | | for (var i = 0; i < duanxin.length; i++) { |
| | | |
| | | if (Customerss != duanxin[i]) { |
| | | var rowData = $("#jqGrid").jqGrid('getRowData', duanxin[i]); |
| | | |
| | | |
| | | SecCustomerId += duanxin[i] + ','; |
| | | SecCustomertype += rowData.Customertype + ','; |
| | | } |
| | | |
| | | } |
| | | if (SecCustomerId == "") { |
| | | toastr.error("请选择客户"); |
| | | return; |
| | | } |
| | | |
| | | SecCustomerId = SecCustomerId.substring(0, SecCustomerId.length - 1); |
| | | SecCustomertype = SecCustomertype.substring(0, SecCustomertype.length - 1); |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/CooperatecustomCustomer/SaveCustomerGuanlian", |
| | | dataType: "json", |
| | | global: false, |
| | | data: { CustomerId: Customerss, Customertype: Customertype , SecCustomerId: SecCustomerId, SecCustomertype: SecCustomertype }, |
| | | success: function (data) { |
| | | if (data.Result) { |
| | | /* $(obj).parent().parent().remove();*/ |
| | | layer.msg('保存成功', { icon: 6 }); |
| | | _pageAutoClose();//自动关闭页面方法 |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | |
| | | }, |
| | | error: function () { |
| | | layer.msg('失败', { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //var index = parent.layer.getFrameIndex(window.name); |
| | | //parent.layer.close(index); |
| | | //return false; |
| | | } else { |
| | | toastr.error("请选择客户"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | var _afterSave = function (result) { |
| | | if (result) { |
| | | toastr.success("保存成功"); |
| | | } else { |
| | | toastr.error("保存失败"); |
| | | } |
| | | } |
| | | |
| | | var _afterDel = function (result) { |
| | | if (result) { |
| | | toastr.success("删除成功"); |
| | | } else { |
| | | /**/ |
| | | toastr.error("删除失败"); |
| | | /**/ |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | 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; |
| | | |
| | | |
| | | } |
| | | |
| | | </script> |
| | | } |
| | | |
| | | @section footerScripts{ |
| | | <script type="text/javascript"> |
| | | |
| | | function send() { |
| | | |
| | | var msg = $("#PBSSheng"); |
| | | |
| | | |
| | | if (msg.length > 0) { |
| | | $("#PBSSheng").change(function () { |
| | | var sheng = $("#PBSSheng").val(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: "/Project/getCity?shengid=" + sheng, |
| | | dataType: "json", |
| | | global: false, |
| | | data: "", |
| | | success: function (data) { |
| | | |
| | | var city = $("#PBSCity"); |
| | | city.find('option').remove(); |
| | | var aaa = '<option value="" hassubinfo="true"> </option>'; |
| | | city.append(aaa); |
| | | if (data.length > 0) { |
| | | for (var i = 0; i < data.length; i++) { |
| | | |
| | | var o = '<option value="' + data[i].CodeId + '" hassubinfo="true">' + data[i].Name + '</option>'; |
| | | city.append(o); |
| | | } |
| | | } |
| | | $("#PBSCity").trigger('chosen:updated');//更新选项 |
| | | }, |
| | | error: function () { |
| | | |
| | | |
| | | parent.layer.msg('失败', { icon: 5 }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } else { |
| | | setTimeout(send, 1000); |
| | | } |
| | | } |
| | | |
| | | |
| | | send(); |
| | | |
| | | |
| | | |
| | | function sendCity() { |
| | | |
| | | var msg = $("#PBSCity"); |
| | | |
| | | |
| | | if (msg.length > 0) { |
| | | $("#PBSCity").change(function () { |
| | | |
| | | var city = $("#PBSCity").val(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: "/Project/getAreaId?cityid=" + city, |
| | | dataType: "json", |
| | | global: false, |
| | | data: "", |
| | | success: function (data) { |
| | | |
| | | var quxian = $("#PBSAreaId"); |
| | | quxian.find('option').remove(); |
| | | var aaa = '<option value="" hassubinfo="true"> </option>'; |
| | | quxian.append(aaa); |
| | | if (data.length > 0) { |
| | | for (var i = 0; i < data.length; i++) { |
| | | |
| | | var o = '<option value="' + data[i].CodeId + '" hassubinfo="true">' + data[i].Name + '</option>'; |
| | | quxian.append(o); |
| | | } |
| | | } |
| | | $("#PBSAreaId").trigger('chosen:updated');//更新选项 |
| | | }, |
| | | error: function () { |
| | | |
| | | |
| | | parent.layer.msg('失败', { icon: 5 }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } else { |
| | | setTimeout(sendCity, 1000); |
| | | } |
| | | } |
| | | |
| | | |
| | | sendCity(); |
| | | |
| | | |
| | | $(function () { |
| | | |
| | | |
| | | |
| | | $("#PBSCreatetimeend").val(Baomingtimeend); |
| | | |
| | | $("#PBSCreatetimestart").val(Baomingtimebegin); |
| | | |
| | | $("#PBSCustomertype").val("01"); |
| | | $("#PBSCustomertype").trigger('chosen:updated');//更新选项 |
| | | }); |
| | | |
| | | |
| | | </script> |
| | | } |
| | |
| | | return "<a onclick=\"OpenWindow('" + cellvalue.replace(/'/g, '') + "','98%','100%', '/IntentionCustomer/Edit?id=" + rowObject.Id + "')\" ><span style='color:" + color + ";'>" + cellvalue + "</span></a>"; |
| | | } |
| | | }, |
| | | |
| | | { |
| | | label: '关联客户数', name: 'Guanliankehushu', labtype: 'txt', hidden: false, width: 100, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return "<a onclick=\"OpenWindow('" + rowObject.Name.replace(/'/g, '') + "','100%','100%', '/CooperatecustomCustomer/IndexCustomerGuanlian?CustomerId=" + rowObject.Id + "&Customertype=档案客户')\" >" + cellvalue + "</a>"; |
| | | } |
| | | }, |
| | | { label: '联系电话', name: 'Tel', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '所属区域', name: 'ShengName', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: '客户来源', name: 'KhlyName', labtype: 'txt', hidden: false, width: 100 }, |
| | |
| | | } |
| | | }, |
| | | |
| | | { |
| | | label: '添加关联客户', name: 'Guanliankehushu', labtype: 'txt', hidden: false, width: 100, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return "<a onclick=\"OpenWindow('" + rowObject.Name.replace(/'/g, '') + "','100%','100%', '/CooperatecustomCustomer/IndexSelect?Id=" + rowObject.Id + "&Customertype=档案客户')\" >添加关联客户</a>"; |
| | | } |
| | | }, |
| | | |
| | | ]; |
| | | dataUrl = "/IntentionCustomer/GetList?Createtime=" + Baomingtimebegin + "|" + Baomingtimeend +"@(string.IsNullOrEmpty(Creater11) ?"": "&Ywjl=" + Creater11)"; |
| | | searchCol = [ |