Merge branch 'master' of http://47.108.235.38:8080/r/baifenbaishop
New file |
| | |
| | | /*********************************************************************** |
| | | * Project: baifenBinfa |
| | | * ProjectName: 百分兵法管理系统 |
| | | * Web: http://chuanyin.com |
| | | * Author: |
| | | * Email: |
| | | * CreateTime: 2024/3/29 11:16:20 |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq.Expressions; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor; |
| | | using CoreCms.Net.Model.ViewModels.Basics; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using SqlSugar; |
| | | |
| | | |
| | | namespace CoreCms.Net.IRepository |
| | | { |
| | | /// <summary> |
| | | /// 线下经销商采集 工厂接口 |
| | | /// </summary> |
| | | public interface IOfflineDistributorRepository : IBaseRepository<OfflineDistributor> |
| | | { |
| | | #region 重写增删改查操作=========================================================== |
| | | |
| | | /// <summary> |
| | | /// 重写异步插入方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> InsertAsync(OfflineDistributor entity); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 重写异步更新方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> UpdateAsync(OfflineDistributor entity); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 重写异步更新方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> UpdateAsync(List<OfflineDistributor> entity); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 重写删除指定ID的数据 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> DeleteByIdAsync(object id); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 重写删除指定ID集合的数据(批量删除) |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids); |
| | | |
| | | #endregion |
| | | |
| | | #region 获取缓存的所有数据========================================================== |
| | | |
| | | /// <summary> |
| | | /// 获取缓存的所有数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<List<OfflineDistributor>> GetCaChe(); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// 重写根据条件查询分页数据 |
| | | /// </summary> |
| | | /// <param name="predicate">判断集合</param> |
| | | /// <param name="orderByType">排序方式</param> |
| | | /// <param name="pageIndex">当前页面索引</param> |
| | | /// <param name="pageSize">分布大小</param> |
| | | /// <param name="orderByExpression"></param> |
| | | /// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param> |
| | | /// <returns></returns> |
| | | Task<IPageList<OfflineDistributor>> QueryPageAsync( |
| | | Expression<Func<OfflineDistributor, bool>> predicate, |
| | | Expression<Func<OfflineDistributor, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1, |
| | | int pageSize = 20, bool blUseNoLock = false); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CoreCms.Net.IServices.baifenbingfa |
| | | { |
| | | /// <summary> |
| | | /// 百分兵法常用服务 |
| | | /// </summary> |
| | | |
| | | public interface IBfbfComAPIService |
| | | { |
| | | /// <summary> |
| | | /// 搜索返回用户数据 |
| | | /// </summary> |
| | | /// <param name="s"></param> |
| | | /// <returns></returns> |
| | | Task<List<SearchUserData>> SearchUserData(string s); |
| | | } |
| | | |
| | | |
| | | public class SearchUserData |
| | | { |
| | | /// <summary> |
| | | /// ID |
| | | /// </summary> |
| | | public int Id { get; set; } |
| | | /// <summary> |
| | | /// name |
| | | /// </summary> |
| | | public string name { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | /*********************************************************************** |
| | | * Project: baifenBinfa |
| | | * ProjectName: 百分兵法管理系统 |
| | | * Web: http://chuanyin.com |
| | | * Author: |
| | | * Email: |
| | | * CreateTime: 2024/3/29 11:16:20 |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq.Expressions; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor; |
| | | using CoreCms.Net.Model.ViewModels.Basics; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using SqlSugar; |
| | | |
| | | namespace CoreCms.Net.IServices |
| | | { |
| | | /// <summary> |
| | | /// 线下经销商采集 服务工厂接口 |
| | | /// </summary> |
| | | public interface IOfflineDistributorServices : IBaseServices<OfflineDistributor> |
| | | { |
| | | #region 重写增删改查操作=========================================================== |
| | | |
| | | /// <summary> |
| | | /// 重写异步插入方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> InsertAsync(OfflineDistributor entity); |
| | | |
| | | /// <summary> |
| | | /// 重写异步更新方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> UpdateAsync(OfflineDistributor entity); |
| | | |
| | | /// <summary> |
| | | /// 重写异步更新方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> UpdateAsync(List<OfflineDistributor> entity); |
| | | |
| | | /// <summary> |
| | | /// 重写删除指定ID的数据 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> DeleteByIdAsync(object id); |
| | | |
| | | /// <summary> |
| | | /// 重写删除指定ID集合的数据(批量删除) |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 获取缓存的所有数据========================================================== |
| | | |
| | | /// <summary> |
| | | /// 获取缓存的所有数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<List<OfflineDistributor>> GetCaChe(); |
| | | |
| | | #endregion |
| | | |
| | | #region 重写根据条件查询分页数据 |
| | | /// <summary> |
| | | /// 重写根据条件查询分页数据 |
| | | /// </summary> |
| | | /// <param name="predicate">判断集合</param> |
| | | /// <param name="orderByType">排序方式</param> |
| | | /// <param name="pageIndex">当前页面索引</param> |
| | | /// <param name="pageSize">分布大小</param> |
| | | /// <param name="orderByExpression"></param> |
| | | /// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param> |
| | | /// <returns></returns> |
| | | Task<IPageList<OfflineDistributor>> QueryPageAsync( |
| | | Expression<Func<OfflineDistributor, bool>> predicate, |
| | | Expression<Func<OfflineDistributor, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1, |
| | | int pageSize = 20, bool blUseNoLock = false); |
| | | #endregion |
| | | /// <summary> |
| | | /// 获取详情 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | |
| | | Task<AdminUiCallBack> GetInfo(int id); |
| | | Task<AdminUiCallBack> UserInsertAsync(OfflineDistributor entity); |
| | | } |
| | | } |
| | |
| | | * Email: 34161541@qq.com |
| | | * CreateTime: 2021-06-08 22:14:59 |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | ***********************************************************************/ |
| | | using Chuanyin.Attribute; |
| | | using SqlSugar; |
| | | using System.ComponentModel.DataAnnotations; |
| | | |
| | |
| | | /// 用户表 |
| | | /// </summary> |
| | | [SugarTable("CoreCmsUser",TableDescription = "用户表")] |
| | | [SqlCodeFirst] |
| | | public partial class CoreCmsUser |
| | | { |
| | | /// <summary> |
| | |
| | | [SugarColumn(ColumnDescription = "关联三方账户")] |
| | | [Required(ErrorMessage = "请输入{0}")] |
| | | public System.Int32 userWx { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 是否是推广人员 |
| | | /// </summary> |
| | | [Display(Name = "是否是推广人员")] |
| | | [SugarColumn(ColumnDescription = "是否是推广人员",IsNullable =true)] |
| | | [Required(ErrorMessage = "请输入{0}")] |
| | | public bool? IsBaifenPromotion { get; set; } |
| | | /// <summary> |
| | | /// 删除标志 有数据就是删除 |
| | | /// </summary> |
New file |
| | |
| | | using Chuanyin.Attribute; |
| | | using CoreCms.Net.Model.Entities.baseModel; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor |
| | | { |
| | | /// <summary> |
| | | /// 线下经销商 |
| | | /// </summary> |
| | | [Display(Name = "线下经销商采集")] |
| | | [SugarTable(TableDescription = "线下经销商采集")] |
| | | [SqlCodeFirst] |
| | | public partial class OfflineDistributor: BFBaseModel |
| | | { |
| | | /// <summary> |
| | | /// 主键ID,自增长 |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键ID")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 信息收集时间 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "信息收集时间")] |
| | | public DateTime CollectionTime { get; set; } = DateTime.Now; |
| | | |
| | | /// <summary> |
| | | /// 区域信息 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "区域信息")] |
| | | public string Region { get; set; } |
| | | /// <summary> |
| | | /// 详细地址 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "详细地址")] |
| | | public string Adder { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 类别 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "类别")] |
| | | public string Category { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 学校名称(若适用) |
| | | /// </summary> |
| | | |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "学校名称")] |
| | | public string School { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商名称 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "经销商名称")] |
| | | public string DealerName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 联系人姓名 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "联系人姓名")] |
| | | public string ContactPerson { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 联系电话 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "联系电话")] |
| | | public string PhoneNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 店招图片地址 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "店招图片地址")] |
| | | public string StoreLogoUrl { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 合作意向描述 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "合作意向描述")] |
| | | public string CooperationIntent { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 业务经理姓名 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "业务经理姓名")] |
| | | public string BusinessManager { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 洽谈记录 |
| | | /// <summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "洽谈记录")] |
| | | public string NegotiationRecord { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 关联用户ID |
| | | /// <summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "关联用户ID")] |
| | | public int? UserID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 收集人ID |
| | | /// <summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "收集人ID")] |
| | | public int? PUserID { get; set; } |
| | | /// <summary> |
| | | /// 备注 |
| | | /// <summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "备注")] |
| | | public string Remake { get; set; } |
| | | /// <summary> |
| | | /// 是否合作 |
| | | /// <summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "是否合作", DefaultValue = "0")] |
| | | public bool IsMeeting { get; set; } = false; |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using Chuanyin.Attribute; |
| | | using CoreCms.Net.Model.Entities.baseModel; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor |
| | | { |
| | | /// <summary> |
| | | /// 线下经销商采集 |
| | | /// </summary> |
| | | [Display(Name = "洽谈记录")] |
| | | [SugarTable(TableDescription = "洽谈记录")] |
| | | [SqlCodeFirst] |
| | | public class OfflineDistributorMeeting: BFBaseModel |
| | | { |
| | | /// <summary> |
| | | /// id |
| | | /// </summary> |
| | | [SugarColumn(ColumnDescription = "id", IsIdentity = true, IsPrimaryKey = true)] |
| | | public int id { get; set; } |
| | | /// <summary> |
| | | /// 洽谈时间 |
| | | /// </summary> |
| | | [Display(Name = "洽谈时间")] |
| | | [SugarColumn(ColumnDescription = "洽谈时间")] |
| | | public DateTime time { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 恰谈情况 |
| | | /// </summary> |
| | | [Display(Name = "恰谈情况")] |
| | | [SugarColumn(ColumnDescription = "恰谈情况")] |
| | | public string Dec { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | | [Display(Name = "备注")] |
| | | [SugarColumn(ColumnDescription = "备注",IsNullable =true)] |
| | | public string Remake { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商表ID |
| | | /// </summary> |
| | | [Display(Name = "经销商表ID")] |
| | | [SugarColumn(ColumnDescription = "经销商表ID")] |
| | | public int OfflineDistributorID { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using Chuanyin.Attribute; |
| | | using CoreCms.Net.Model.Entities.baseModel; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Display(Name = "线下经销商采集")] |
| | | [SugarTable(TableDescription = "线下经销商采集")] |
| | | [SqlCodeFirst] |
| | | public class OfflineDistributorOder: BFBaseModel |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 主键ID,自增长 |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键ID")] |
| | | public int Id { get; set; } |
| | | /// <summary> |
| | | /// 单价 |
| | | /// </summary> |
| | | [Display(Name = "单价")] |
| | | [SugarColumn(ColumnDescription = "商品单价", IsNullable = true)] |
| | | public decimal UnitPrice { get; set; } |
| | | /// <summary> |
| | | /// 时间 |
| | | /// </summary> |
| | | [Display(Name = "时间")] |
| | | [SugarColumn(ColumnDescription = "时间")] |
| | | public DateTime time { get; set; } |
| | | /// <summary> |
| | | /// 货物名称 |
| | | /// </summary> |
| | | [Display(Name = "货物名称")] |
| | | [SugarColumn(ColumnDescription = "商品名称", IsNullable = true)] |
| | | public string GoodsName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货物编码 |
| | | /// </summary> |
| | | [Display(Name = "货物编码")] |
| | | [SugarColumn(ColumnDescription = "商品编码", IsNullable = true)] |
| | | public string GoodsCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订货数量 |
| | | /// </summary> |
| | | [Display(Name = "订货数量")] |
| | | [SugarColumn(ColumnDescription = "订购数量", IsNullable = true)] |
| | | public int OrderQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订货时间 |
| | | /// </summary> |
| | | [Display(Name = "订货时间")] |
| | | [SugarColumn(ColumnDescription = "订购时间", IsNullable = true)] |
| | | public DateTime? OrderTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 实付金额 |
| | | /// </summary> |
| | | [Display(Name = "实付金额")] |
| | | [SugarColumn(ColumnDescription = "实际支付金额", IsNullable = true)] |
| | | public decimal ActualPayment { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 发货时间 |
| | | /// </summary> |
| | | [Display(Name = "发货时间")] |
| | | [SugarColumn(ColumnDescription = "发货时间", IsNullable = true)] |
| | | public DateTime? DeliveryTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 发货单号 |
| | | /// </summary> |
| | | [Display(Name = "发货单号")] |
| | | [SugarColumn(ColumnDescription = "发货单编号", IsNullable = true)] |
| | | public string DeliveryNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 快递公司 |
| | | /// </summary> |
| | | [Display(Name = "快递公司")] |
| | | [SugarColumn(ColumnDescription = "快递公司名称", IsNullable = true)] |
| | | public string ExpressCompany { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 发货数量(如果与订货数量不同步,单独列出) |
| | | /// </summary> |
| | | [Display(Name = "发货数量")] |
| | | [SugarColumn(ColumnDescription = "实际发货数量", IsNullable = true)] |
| | | public int ShippedQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 退款金额 |
| | | /// </summary> |
| | | [Display(Name = "退款金额")] |
| | | [SugarColumn(ColumnDescription = "退款金额", IsNullable = true)] |
| | | public decimal? RefundAmount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | | [Display(Name = "备注")] |
| | | [SugarColumn(ColumnDescription = "订单备注", IsNullable =true)] |
| | | public string Remarks { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商表ID |
| | | /// </summary> |
| | | [Display(Name = "经销商表ID")] |
| | | [SugarColumn(ColumnDescription = "经销商表ID")] |
| | | public int OfflineDistributorID { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using Chuanyin.Attribute; |
| | | using CoreCms.Net.Model.Entities.baseModel; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor |
| | | { |
| | | /// <summary> |
| | | /// 线下经销商 |
| | | /// </summary> |
| | | |
| | | public partial class OfflineDistributor |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 关联用户 |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToOne, nameof(UserID))] |
| | | public CoreCmsUser? User { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 推荐用户 |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToOne, nameof(PUserID))] |
| | | public CoreCmsUser? pUser { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 洽谈记录 |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToMany, nameof(OfflineDistributorMeeting.OfflineDistributorID))] |
| | | public List<OfflineDistributorMeeting> meetings { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 洽谈记录 |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToMany, nameof(OfflineDistributorOder.OfflineDistributorID))] |
| | | public List<OfflineDistributorOder> Oders { get; set; } |
| | | /// <summary> |
| | | /// 洽谈次数 |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public int meetingCount { get; set; } = 0; |
| | | /// <summary> |
| | | /// 合作金额 |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public decimal money { get; set; } = 0; |
| | | /// <summary> |
| | | /// 区域名称 |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public string areaCodeName { get; set; } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [Required(ErrorMessage = "请输入相应数据")] |
| | | public bool data { get; set; } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | isDelete = p.isDelete, |
| | | type = (int)sWeChatInfo.type, |
| | | parentNickName = sParentUser.nickName, |
| | | IsBaifenPromotion = p.IsBaifenPromotion, |
| | | //childNum = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.parentId == p.id).Count(), //影响效率,移除掉。放到接口端单独计算。 |
| | | }) |
| | | .MergeTable().With(SqlWith.Null) |
New file |
| | |
| | | /*********************************************************************** |
| | | * Project: baifenBinfa |
| | | * ProjectName: 百分兵法管理系统 |
| | | * Web: http://chuanyin.com |
| | | * Author: |
| | | * Email: |
| | | * CreateTime: 2024/3/29 11:16:20 |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq.Expressions; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Caching.Manual; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.ViewModels.Basics; |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using SqlSugar; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor; |
| | | |
| | | namespace CoreCms.Net.Repository |
| | | { |
| | | /// <summary> |
| | | /// 线下经销商采集 接口实现 |
| | | /// </summary> |
| | | public class OfflineDistributorRepository : BaseRepository<OfflineDistributor>, IOfflineDistributorRepository |
| | | { |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | public OfflineDistributorRepository(IUnitOfWork unitOfWork) : base(unitOfWork) |
| | | { |
| | | _unitOfWork = unitOfWork; |
| | | } |
| | | |
| | | #region 实现重写增删改查操作========================================================== |
| | | |
| | | /// <summary> |
| | | /// 重写异步插入方法 |
| | | /// </summary> |
| | | /// <param name="entity">实体数据</param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> InsertAsync(OfflineDistributor entity) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; |
| | | jm.code = bl ? 0 : 1; |
| | | jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; |
| | | |
| | | return jm; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写异步更新方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> UpdateAsync(OfflineDistributor entity) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var oldModel = await DbClient.Queryable<OfflineDistributor>().In(entity.Id).SingleAsync(); |
| | | if (oldModel == null) |
| | | { |
| | | jm.msg = "不存在此信息"; |
| | | return jm; |
| | | } |
| | | //事物处理过程开始 |
| | | oldModel.Id = entity.Id; |
| | | oldModel.CollectionTime = entity.CollectionTime; |
| | | oldModel.Region = entity.Region; |
| | | oldModel.Adder = entity.Adder; |
| | | oldModel.Category = entity.Category; |
| | | oldModel.School = entity.School; |
| | | oldModel.DealerName = entity.DealerName; |
| | | oldModel.ContactPerson = entity.ContactPerson; |
| | | oldModel.PhoneNumber = entity.PhoneNumber; |
| | | oldModel.StoreLogoUrl = entity.StoreLogoUrl; |
| | | oldModel.CooperationIntent = entity.CooperationIntent; |
| | | oldModel.BusinessManager = entity.BusinessManager; |
| | | oldModel.NegotiationRecord = entity.NegotiationRecord; |
| | | oldModel.UserID = entity.UserID; |
| | | oldModel.Remake = entity.Remake; |
| | | oldModel.createTime = entity.createTime; |
| | | oldModel.upDataTime = entity.upDataTime; |
| | | oldModel.createBy = entity.createBy; |
| | | oldModel.upDataBy = entity.upDataBy; |
| | | oldModel.isdelete = entity.isdelete; |
| | | |
| | | //事物处理过程结束 |
| | | var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); |
| | | jm.code = bl ? 0 : 1; |
| | | jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; |
| | | |
| | | return jm; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写异步更新方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> UpdateAsync(List<OfflineDistributor> entity) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync(); |
| | | jm.code = bl ? 0 : 1; |
| | | jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; |
| | | |
| | | return jm; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写删除指定ID的数据 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> DeleteByIdAsync(object id) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var bl = await DbClient.Deleteable<OfflineDistributor>(id).ExecuteCommandHasChangeAsync(); |
| | | jm.code = bl ? 0 : 1; |
| | | jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; |
| | | |
| | | return jm; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写删除指定ID集合的数据(批量删除) |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var bl = await DbClient.Deleteable<OfflineDistributor>().In(ids).ExecuteCommandHasChangeAsync(); |
| | | jm.code = bl ? 0 : 1; |
| | | jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; |
| | | |
| | | return jm; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 获取缓存的所有数据========================================================== |
| | | |
| | | /// <summary> |
| | | /// 获取缓存的所有数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<List<OfflineDistributor>> GetCaChe() |
| | | { |
| | | var list = await DbClient.Queryable<OfflineDistributor>().With(SqlWith.NoLock).WithCache().ToListAsync(); |
| | | return list; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 重写根据条件查询分页数据 |
| | | /// <summary> |
| | | /// 重写根据条件查询分页数据 |
| | | /// </summary> |
| | | /// <param name="predicate">判断集合</param> |
| | | /// <param name="orderByType">排序方式</param> |
| | | /// <param name="pageIndex">当前页面索引</param> |
| | | /// <param name="pageSize">分布大小</param> |
| | | /// <param name="orderByExpression"></param> |
| | | /// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param> |
| | | /// <returns></returns> |
| | | public async Task<IPageList<OfflineDistributor>> QueryPageAsync(Expression<Func<OfflineDistributor, bool>> predicate, |
| | | Expression<Func<OfflineDistributor, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1, |
| | | int pageSize = 20, bool blUseNoLock = false) |
| | | { |
| | | RefAsync<int> totalCount = 0; |
| | | List<OfflineDistributor> page; |
| | | if (blUseNoLock) |
| | | { |
| | | page = await DbClient.Queryable<OfflineDistributor>() |
| | | .OrderByIF(orderByExpression != null, orderByExpression, orderByType) |
| | | .WhereIF(predicate != null, predicate).Select(p => new OfflineDistributor |
| | | { |
| | | Id = p.Id, |
| | | CollectionTime = p.CollectionTime, |
| | | Region = p.Region, |
| | | Adder = p.Adder, |
| | | Category = p.Category, |
| | | School = p.School, |
| | | DealerName = p.DealerName, |
| | | ContactPerson = p.ContactPerson, |
| | | PhoneNumber = p.PhoneNumber, |
| | | StoreLogoUrl = p.StoreLogoUrl, |
| | | CooperationIntent = p.CooperationIntent, |
| | | BusinessManager = p.BusinessManager, |
| | | NegotiationRecord = p.NegotiationRecord, |
| | | UserID = p.UserID, |
| | | Remake = p.Remake, |
| | | createTime = p.createTime, |
| | | upDataTime = p.upDataTime, |
| | | createBy = p.createBy, |
| | | upDataBy = p.upDataBy, |
| | | isdelete = p.isdelete, |
| | | |
| | | }).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount); |
| | | } |
| | | else |
| | | { |
| | | page = await DbClient.Queryable<OfflineDistributor>() |
| | | .OrderByIF(orderByExpression != null, orderByExpression, orderByType) |
| | | .WhereIF(predicate != null, predicate).Select(p => new OfflineDistributor |
| | | { |
| | | Id = p.Id, |
| | | CollectionTime = p.CollectionTime, |
| | | Region = p.Region, |
| | | Adder = p.Adder, |
| | | Category = p.Category, |
| | | School = p.School, |
| | | DealerName = p.DealerName, |
| | | ContactPerson = p.ContactPerson, |
| | | PhoneNumber = p.PhoneNumber, |
| | | StoreLogoUrl = p.StoreLogoUrl, |
| | | CooperationIntent = p.CooperationIntent, |
| | | BusinessManager = p.BusinessManager, |
| | | NegotiationRecord = p.NegotiationRecord, |
| | | UserID = p.UserID, |
| | | Remake = p.Remake, |
| | | createTime = p.createTime, |
| | | upDataTime = p.upDataTime, |
| | | createBy = p.createBy, |
| | | upDataBy = p.upDataBy, |
| | | isdelete = p.isdelete, |
| | | |
| | | }).ToPageListAsync(pageIndex, pageSize, totalCount); |
| | | } |
| | | var list = new PageList<OfflineDistributor>(page, pageIndex, pageSize, totalCount); |
| | | return list; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Model.Entities; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CoreCms.Net.Services.baifenbingfa |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class BfbfComAPIService : IBfbfComAPIService |
| | | { |
| | | |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | |
| | | public BfbfComAPIService(ICoreCmsUserServices userServices,IUnitOfWork unitOfWork) |
| | | { |
| | | _userServices = userServices; |
| | | _unitOfWork = unitOfWork; |
| | | } |
| | | public async Task<List<SearchUserData>> SearchUserData(string s) |
| | | { |
| | | var ListData= await _unitOfWork.GetDbClient().Queryable<CoreCmsUser>().Where(x => x.isDelete == false).Select(x => new SearchUserData |
| | | { |
| | | Id = x.id, |
| | | name = x.mobile + "|" + x.userName + "|" + x.nickName, |
| | | |
| | | }).WithCache(50).ToListAsync(); |
| | | if (string.IsNullOrEmpty(s)) |
| | | { |
| | | return ListData; |
| | | } |
| | | return ListData.Where(x => x.name.Contains(s)).ToList(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /*********************************************************************** |
| | | * Project: baifenBinfa |
| | | * ProjectName: 百分兵法管理系统 |
| | | * Web: http://chuanyin.com |
| | | * Author: |
| | | * Email: |
| | | * CreateTime: 2024/3/29 11:16:20 |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Auth.HttpContextUser; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.Promote; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor; |
| | | using CoreCms.Net.Model.ViewModels.Basics; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using SqlSugar; |
| | | |
| | | |
| | | namespace CoreCms.Net.Services |
| | | { |
| | | /// <summary> |
| | | /// 线下经销商采集 接口实现 |
| | | /// </summary> |
| | | public class OfflineDistributorServices : BaseServices<OfflineDistributor>, IOfflineDistributorServices |
| | | { |
| | | private readonly IOfflineDistributorRepository _dal; |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | |
| | | private readonly IHttpContextUser _contextUser; |
| | | public OfflineDistributorServices(IUnitOfWork unitOfWork, IOfflineDistributorRepository dal,IHttpContextUser httpContextUser) |
| | | { |
| | | this._dal = dal; |
| | | base.BaseDal = dal; |
| | | _unitOfWork = unitOfWork; |
| | | _contextUser = httpContextUser; |
| | | } |
| | | |
| | | #region 实现重写增删改查操作========================================================== |
| | | |
| | | /// <summary> |
| | | /// 重写异步插入方法 |
| | | /// </summary> |
| | | /// <param name="entity">实体数据</param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> InsertAsync(OfflineDistributor entity) |
| | | { |
| | | entity.createTime = DateTime.Now; |
| | | entity.createBy = $"{_contextUser.Name}"; |
| | | return await _dal.InsertAsync(entity); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写异步插入方法 |
| | | /// </summary> |
| | | /// <param name="entity">实体数据</param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> UserInsertAsync(OfflineDistributor entity) |
| | | { |
| | | entity.createTime = DateTime.Now; |
| | | entity.createBy = $"{_contextUser.Name}"; |
| | | var bol = await _unitOfWork.GetDbClient().InsertNav(entity).Include(x => x.meetings).ExecuteCommandAsync(); |
| | | if (bol) |
| | | { |
| | | return new AdminUiCallBack() |
| | | { |
| | | code = 0, |
| | | data = bol, |
| | | msg = "操作成功" |
| | | |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | |
| | | return new AdminUiCallBack() |
| | | { |
| | | code = 1, |
| | | data = bol, |
| | | msg = "操作失败" |
| | | |
| | | }; |
| | | |
| | | } |
| | | return await _dal.InsertAsync(entity); |
| | | } |
| | | public async Task<AdminUiCallBack> GetInfo(int id) |
| | | { |
| | | var data = await _unitOfWork.GetDbClient().Queryable<OfflineDistributor>().Where(x => x.Id == id) |
| | | .Includes(x => x.meetings) |
| | | .Includes(x => x.Oders).FirstAsync(); |
| | | if (data == null) |
| | | return new AdminUiCallBack() |
| | | { |
| | | msg = "没有找到该数据" |
| | | }; |
| | | else |
| | | return new AdminUiCallBack() |
| | | { |
| | | code = 0, |
| | | data = data |
| | | }; |
| | | } |
| | | /// <summary> |
| | | /// 重写异步更新方法方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> UpdateAsync(OfflineDistributor entity) |
| | | { |
| | | var db = _unitOfWork.GetDbClient(); |
| | | var oldmod = await _dal.QueryByIdAsync(entity.Id); |
| | | |
| | | if (oldmod == null) |
| | | { |
| | | return new AdminUiCallBack() |
| | | { |
| | | data = "没有找到相关数据" |
| | | }; |
| | | } |
| | | oldmod.upDataTime = DateTime.Now; |
| | | oldmod.upDataBy = $"{_contextUser.Name}"; |
| | | oldmod.BusinessManager = entity.BusinessManager; |
| | | oldmod.PhoneNumber = entity.PhoneNumber; |
| | | oldmod.PUserID = entity.PUserID; |
| | | oldmod.Region = entity.Region; |
| | | oldmod.Remake = entity.Remake; |
| | | oldmod.DealerName = entity.DealerName; |
| | | oldmod.UserID = entity.UserID; |
| | | oldmod.IsMeeting = entity.IsMeeting; |
| | | oldmod.StoreLogoUrl = entity.StoreLogoUrl; |
| | | oldmod.Adder = entity.Adder; |
| | | oldmod.ContactPerson = entity.ContactPerson; |
| | | oldmod.Category = entity.Category; |
| | | |
| | | oldmod.School = entity.School; |
| | | var oldMeetings = await db.Queryable<OfflineDistributorMeeting>().Where(x => x.OfflineDistributorID == oldmod.Id).OrderBy(x => x.id).ToListAsync(); |
| | | var oldIntentions = await db.Queryable<OfflineDistributorOder>().Where(x => x.OfflineDistributorID == oldmod.Id).OrderBy(x => x.Id).ToListAsync(); |
| | | |
| | | foreach (var intention in entity.Oders) |
| | | { |
| | | if (intention.Id == 9999999) |
| | | { |
| | | intention.Id = 0; |
| | | intention.createBy = $"{_contextUser.Name}"; |
| | | intention.createTime = DateTime.Now; |
| | | intention.isdelete = false; |
| | | continue; |
| | | } |
| | | var old = oldIntentions.Where(x=>x.Id==intention.Id).SingleOrDefault(); |
| | | if (old != null) |
| | | { |
| | | intention.isdelete = old.isdelete; |
| | | intention.createBy = old.createBy; |
| | | intention.createTime = old.createTime; |
| | | intention.upDataBy = $"{_contextUser.Name}"; |
| | | intention.upDataTime = DateTime.Now; |
| | | } |
| | | } |
| | | oldmod.Oders = entity.Oders; |
| | | |
| | | foreach (var meetin in entity.meetings) |
| | | { |
| | | if (meetin.id == 9999999) |
| | | { |
| | | meetin.id = 0; |
| | | meetin.createBy = $"{_contextUser.Name}"; |
| | | meetin.createTime = DateTime.Now; |
| | | meetin.isdelete = false; |
| | | continue; |
| | | } |
| | | var old = oldMeetings.Where(x => x.id == meetin.id).SingleOrDefault(); |
| | | if (old != null) |
| | | { |
| | | meetin.isdelete = old.isdelete; |
| | | meetin.createBy = old.createBy; |
| | | meetin.createTime = old.createTime; |
| | | meetin.upDataBy = $"{_contextUser.Name}"; |
| | | meetin.upDataTime = DateTime.Now; |
| | | } |
| | | } |
| | | oldmod.meetings = entity.meetings; |
| | | |
| | | var bol = await _unitOfWork.GetDbClient().UpdateNav(oldmod).Include(x => x.meetings).Include(x => x.Oders).ExecuteCommandAsync(); |
| | | if (bol) |
| | | { |
| | | return new AdminUiCallBack() |
| | | { |
| | | code = 0, |
| | | data = bol, |
| | | msg = "操作成功" |
| | | |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | |
| | | return new AdminUiCallBack() |
| | | { |
| | | code = 1, |
| | | data = bol, |
| | | msg = "操作失败" |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | //return await _dal.UpdateAsync(entity); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写异步更新方法方法 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> UpdateAsync(List<OfflineDistributor> entity) |
| | | { |
| | | return await _dal.UpdateAsync(entity); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写删除指定ID的数据 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> DeleteByIdAsync(object id) |
| | | { |
| | | return await _dal.DeleteByIdAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写删除指定ID集合的数据(批量删除) |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids) |
| | | { |
| | | return await _dal.DeleteByIdsAsync(ids); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 获取缓存的所有数据========================================================== |
| | | |
| | | /// <summary> |
| | | /// 获取缓存的所有数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<List<OfflineDistributor>> GetCaChe() |
| | | { |
| | | return await _dal.GetCaChe(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 重写根据条件查询分页数据 |
| | | /// <summary> |
| | | /// 重写根据条件查询分页数据 |
| | | /// </summary> |
| | | /// <param name="predicate">判断集合</param> |
| | | /// <param name="orderByType">排序方式</param> |
| | | /// <param name="pageIndex">当前页面索引</param> |
| | | /// <param name="pageSize">分布大小</param> |
| | | /// <param name="orderByExpression"></param> |
| | | /// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param> |
| | | /// <returns></returns> |
| | | public async Task<IPageList<OfflineDistributor>> QueryPageAsync(Expression<Func<OfflineDistributor, bool>> predicate, |
| | | Expression<Func<OfflineDistributor, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1, |
| | | int pageSize = 20, bool blUseNoLock = false) |
| | | { |
| | | return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "runtimeTarget": { |
| | | "name": ".NETCoreApp,Version=v8.0", |
| | | "signature": "" |
| | | }, |
| | | "compilationOptions": {}, |
| | | "targets": { |
| | | ".NETCoreApp,Version=v8.0": { |
| | | "CoreCms.Net.Uni-App/1.0.0": { |
| | | "runtime": { |
| | | "CoreCms.Net.Uni-App.dll": {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "libraries": { |
| | | "CoreCms.Net.Uni-App/1.0.0": { |
| | | "type": "project", |
| | | "serviceable": false, |
| | | "sha512": "" |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using CoreCms.Net.Web.Admin.Infrastructure; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CoreCms.Net.Web.Admin.Controllers.Api |
| | | { |
| | | [Description("通用API")] |
| | | [Route("api/[controller]/[action]")] |
| | | [ApiController] |
| | | [RequiredErrorForAdmin] |
| | | [Authorize(Permissions.Name)] |
| | | public class CommonAPIController : ControllerBase |
| | | { |
| | | private readonly IBfbfComAPIService _comapiservice; |
| | | public CommonAPIController(IBfbfComAPIService comapiservice) |
| | | { |
| | | _comapiservice = comapiservice; |
| | | } |
| | | /// <summary> |
| | | /// 获取用户搜索列表 |
| | | /// </summary> |
| | | /// <param name="s"></param> |
| | | [HttpPost] |
| | | [Description("获取列表")] |
| | | [AllowAnonymous] |
| | | public async Task<AdminUiCallBack> GetUserList() |
| | | { |
| | | var ret= new AdminUiCallBack(); |
| | | var s = Request.Form["sKey"].FirstOrDefault(); |
| | | var data= await _comapiservice.SearchUserData(s); |
| | | if(data!=null) |
| | | { |
| | | ret.code = 0; |
| | | ret.data = data; |
| | | } |
| | | else |
| | | { |
| | | ret.msg = "读取用户数据失败"; |
| | | } |
| | | |
| | | return ret; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /*********************************************************************** |
| | | * Project: baifenBinfa |
| | | * ProjectName: 百分兵法管理系统 |
| | | * Web: http://chuanyin.com |
| | | * Author: |
| | | * Email: |
| | | * CreateTime: 2024/3/29 11:16:20 |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | |
| | | |
| | | using System; |
| | | using System.ComponentModel; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.Expression; |
| | | using CoreCms.Net.Model.FromBody; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using CoreCms.Net.Filter; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.Utility.Helper; |
| | | using CoreCms.Net.Utility.Extensions; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using NPOI.HSSF.UserModel; |
| | | using SqlSugar; |
| | | using CoreCms.Net.Web.Admin.Infrastructure; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor; |
| | | using SqlSugar.Extensions; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.Promote; |
| | | using CoreCms.Net.Services.Basic; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | |
| | | namespace CoreCms.Net.Web.Admin.Controllers |
| | | { |
| | | /// <summary> |
| | | /// 线下经销商采集 |
| | | ///</summary> |
| | | [Description("线下经销商采集")] |
| | | [Route("api/[controller]/[action]")] |
| | | [ApiController] |
| | | [RequiredErrorForAdmin] |
| | | [Authorize(Permissions.Name)] |
| | | public class OfflineDistributorController : ControllerBase |
| | | { |
| | | private readonly IWebHostEnvironment _webHostEnvironment; |
| | | private readonly IOfflineDistributorServices _OfflineDistributorServices; |
| | | private readonly ICoreCmsAreaServices _coreCmsAreaServices; |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | | ///</summary> |
| | | public OfflineDistributorController(IWebHostEnvironment webHostEnvironment |
| | | ,IOfflineDistributorServices OfflineDistributorServices |
| | | ,ICoreCmsAreaServices CoreCmsAreaServices |
| | | ,IUnitOfWork unitOfWork |
| | | ) |
| | | { |
| | | _webHostEnvironment = webHostEnvironment; |
| | | _OfflineDistributorServices = OfflineDistributorServices; |
| | | _coreCmsAreaServices = CoreCmsAreaServices; |
| | | _unitOfWork = unitOfWork; |
| | | } |
| | | |
| | | #region 获取列表============================================================ |
| | | // POST: Api/OfflineDistributor/GetPageList |
| | | /// <summary> |
| | | /// 获取列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("获取列表")] |
| | | public async Task<AdminUiCallBack> GetPageList() |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1); |
| | | var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30); |
| | | var where = PredicateBuilder.True<OfflineDistributor>(); |
| | | //获取排序字段 |
| | | var orderField = Request.Form["orderField"].FirstOrDefault(); |
| | | |
| | | Expression<Func<OfflineDistributor, object>> orderEx = orderField switch |
| | | { |
| | | "Id" => p => p.Id,"CollectionTime" => p => p.CollectionTime,"Region" => p => p.Region,"Adder" => p => p.Adder,"Category" => p => p.Category,"School" => p => p.School,"DealerName" => p => p.DealerName,"ContactPerson" => p => p.ContactPerson,"PhoneNumber" => p => p.PhoneNumber,"StoreLogoUrl" => p => p.StoreLogoUrl,"CooperationIntent" => p => p.CooperationIntent,"BusinessManager" => p => p.BusinessManager,"NegotiationRecord" => p => p.NegotiationRecord,"UserID" => p => p.UserID,"Remake" => p => p.Remake,"createTime" => p => p.createTime,"upDataTime" => p => p.upDataTime,"createBy" => p => p.createBy,"upDataBy" => p => p.upDataBy,"isdelete" => p => p.isdelete, |
| | | _ => p => p.Id |
| | | }; |
| | | |
| | | //设置排序方式 |
| | | var orderDirection = Request.Form["orderDirection"].FirstOrDefault(); |
| | | var orderBy = orderDirection switch |
| | | { |
| | | "asc" => OrderByType.Asc, |
| | | "desc" => OrderByType.Desc, |
| | | _ => OrderByType.Desc |
| | | }; |
| | | //查询筛选 |
| | | |
| | | //主键ID int |
| | | var Id = Request.Form["Id"].FirstOrDefault().ObjectToInt(0); |
| | | if (Id > 0) |
| | | { |
| | | where = where.And(p => p.Id == Id); |
| | | } |
| | | //信息收集时间 datetime |
| | | var CollectionTime = Request.Form["CollectionTime"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(CollectionTime)) |
| | | { |
| | | if (CollectionTime.Contains("到")) |
| | | { |
| | | var dts = CollectionTime.Split("到"); |
| | | var dtStart = dts[0].Trim().ObjectToDate(); |
| | | where = where.And(p => p.CollectionTime > dtStart); |
| | | var dtEnd = dts[1].Trim().ObjectToDate(); |
| | | where = where.And(p => p.CollectionTime < dtEnd); |
| | | } |
| | | else |
| | | { |
| | | var dt = CollectionTime.ObjectToDate(); |
| | | where = where.And(p => p.CollectionTime > dt); |
| | | } |
| | | } |
| | | //区域信息 varchar |
| | | var Region = Request.Form["Region"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Region)) |
| | | { |
| | | where = where.And(p => p.Region.Contains(Region)); |
| | | } |
| | | //详细地址 varchar |
| | | var Adder = Request.Form["Adder"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Adder)) |
| | | { |
| | | where = where.And(p => p.Adder.Contains(Adder)); |
| | | } |
| | | //类别 varchar |
| | | var Category = Request.Form["Category"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Category)) |
| | | { |
| | | where = where.And(p => p.Category.Contains(Category)); |
| | | } |
| | | //学校名称 varchar |
| | | var School = Request.Form["School"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(School)) |
| | | { |
| | | where = where.And(p => p.School.Contains(School)); |
| | | } |
| | | //经销商名称 varchar |
| | | var DealerName = Request.Form["DealerName"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(DealerName)) |
| | | { |
| | | where = where.And(p => p.DealerName.Contains(DealerName)); |
| | | } |
| | | //联系人姓名 varchar |
| | | var ContactPerson = Request.Form["ContactPerson"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(ContactPerson)) |
| | | { |
| | | where = where.And(p => p.ContactPerson.Contains(ContactPerson)); |
| | | } |
| | | //联系电话 varchar |
| | | var PhoneNumber = Request.Form["PhoneNumber"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(PhoneNumber)) |
| | | { |
| | | where = where.And(p => p.PhoneNumber.Contains(PhoneNumber)); |
| | | } |
| | | //店招图片地址 varchar |
| | | var StoreLogoUrl = Request.Form["StoreLogoUrl"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(StoreLogoUrl)) |
| | | { |
| | | where = where.And(p => p.StoreLogoUrl.Contains(StoreLogoUrl)); |
| | | } |
| | | //合作意向描述 varchar |
| | | var CooperationIntent = Request.Form["CooperationIntent"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(CooperationIntent)) |
| | | { |
| | | where = where.And(p => p.CooperationIntent.Contains(CooperationIntent)); |
| | | } |
| | | //业务经理姓名 varchar |
| | | var BusinessManager = Request.Form["BusinessManager"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(BusinessManager)) |
| | | { |
| | | where = where.And(p => p.BusinessManager.Contains(BusinessManager)); |
| | | } |
| | | //洽谈记录 varchar |
| | | var NegotiationRecord = Request.Form["NegotiationRecord"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(NegotiationRecord)) |
| | | { |
| | | where = where.And(p => p.NegotiationRecord.Contains(NegotiationRecord)); |
| | | } |
| | | //收集人ID varchar |
| | | var UserID = Request.Form["UserID"].FirstOrDefault().ToInt32OrDefault(); |
| | | if (UserID>0) |
| | | { |
| | | where = where.And(p => p.UserID==UserID); |
| | | } |
| | | //备注 varchar |
| | | var Remake = Request.Form["Remake"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Remake)) |
| | | { |
| | | where = where.And(p => p.Remake.Contains(Remake)); |
| | | } |
| | | //建立时间 datetime |
| | | var createTime = Request.Form["createTime"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(createTime)) |
| | | { |
| | | if (createTime.Contains("到")) |
| | | { |
| | | var dts = createTime.Split("到"); |
| | | var dtStart = dts[0].Trim().ObjectToDate(); |
| | | where = where.And(p => p.createTime > dtStart); |
| | | var dtEnd = dts[1].Trim().ObjectToDate(); |
| | | where = where.And(p => p.createTime < dtEnd); |
| | | } |
| | | else |
| | | { |
| | | var dt = createTime.ObjectToDate(); |
| | | where = where.And(p => p.createTime > dt); |
| | | } |
| | | } |
| | | //修改时间 datetime |
| | | var upDataTime = Request.Form["upDataTime"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(upDataTime)) |
| | | { |
| | | if (upDataTime.Contains("到")) |
| | | { |
| | | var dts = upDataTime.Split("到"); |
| | | var dtStart = dts[0].Trim().ObjectToDate(); |
| | | where = where.And(p => p.upDataTime > dtStart); |
| | | var dtEnd = dts[1].Trim().ObjectToDate(); |
| | | where = where.And(p => p.upDataTime < dtEnd); |
| | | } |
| | | else |
| | | { |
| | | var dt = upDataTime.ObjectToDate(); |
| | | where = where.And(p => p.upDataTime > dt); |
| | | } |
| | | } |
| | | //创建人 varchar |
| | | var createBy = Request.Form["createBy"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(createBy)) |
| | | { |
| | | where = where.And(p => p.createBy.Contains(createBy)); |
| | | } |
| | | //修改人 varchar |
| | | var upDataBy = Request.Form["upDataBy"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(upDataBy)) |
| | | { |
| | | where = where.And(p => p.upDataBy.Contains(upDataBy)); |
| | | } |
| | | //删除标志 bit |
| | | var isdelete = Request.Form["isdelete"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(isdelete) && isdelete.ToLowerInvariant() == "true") |
| | | { |
| | | where = where.And(p => p.isdelete == true); |
| | | } |
| | | else if (!string.IsNullOrEmpty(isdelete) && isdelete.ToLowerInvariant() == "false") |
| | | { |
| | | where = where.And(p => p.isdelete == false); |
| | | } |
| | | //获取数据 |
| | | var list = await _OfflineDistributorServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true); |
| | | |
| | | foreach (var item in list) |
| | | { |
| | | var d = await _coreCmsAreaServices.GetAreaFullName(item.Region?.Split(",").ToList().OrderDescending()?.FirstOrDefault()?.ToInt32OrDefault(0) ?? 0); |
| | | |
| | | if (d.status == true) |
| | | { |
| | | item.areaCodeName = d.data.ToString(); |
| | | item.meetingCount = await _unitOfWork.GetDbClient().Queryable<OfflineDistributorMeeting>().Where(x => x.OfflineDistributorID == item.Id && x.isdelete == false).CountAsync(); |
| | | item.money = await _unitOfWork.GetDbClient().Queryable<OfflineDistributorOder>().Where(x => x.OfflineDistributorID == item.Id && x.isdelete == false).SumAsync(x=>x.ActualPayment); |
| | | } |
| | | |
| | | } |
| | | |
| | | //返回数据 |
| | | jm.data = list; |
| | | jm.code = 0; |
| | | jm.count = list.TotalCount; |
| | | jm.msg = "数据调用成功!"; |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | #region 首页数据============================================================ |
| | | // POST: Api/OfflineDistributor/GetIndex |
| | | /// <summary> |
| | | /// 首页数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("首页数据")] |
| | | public AdminUiCallBack GetIndex() |
| | | { |
| | | //返回数据 |
| | | var jm = new AdminUiCallBack { code = 0 }; |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | #region 创建数据============================================================ |
| | | // POST: Api/OfflineDistributor/GetCreate |
| | | /// <summary> |
| | | /// 创建数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("创建数据")] |
| | | public AdminUiCallBack GetCreate() |
| | | { |
| | | //返回数据 |
| | | var jm = new AdminUiCallBack { code = 0 }; |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | #region 创建提交============================================================ |
| | | // POST: Api/OfflineDistributor/DoCreate |
| | | /// <summary> |
| | | /// 创建提交 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("创建提交")] |
| | | public async Task<AdminUiCallBack> DoCreate([FromBody]OfflineDistributor entity) |
| | | { |
| | | var jm = await _OfflineDistributorServices.InsertAsync(entity); |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | #region 编辑数据============================================================ |
| | | // POST: Api/OfflineDistributor/GetEdit |
| | | /// <summary> |
| | | /// 编辑数据 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("编辑数据")] |
| | | public async Task<AdminUiCallBack> GetEdit([FromBody]FMIntId entity) |
| | | { |
| | | |
| | | |
| | | return await _OfflineDistributorServices.GetInfo(entity.id); |
| | | |
| | | |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region 编辑提交============================================================ |
| | | // POST: Api/OfflineDistributor/Edit |
| | | /// <summary> |
| | | /// 编辑提交 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("编辑提交")] |
| | | public async Task<AdminUiCallBack> DoEdit([FromBody]OfflineDistributor entity) |
| | | { |
| | | var jm = await _OfflineDistributorServices.UpdateAsync(entity); |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | #region 删除数据============================================================ |
| | | // POST: Api/OfflineDistributor/DoDelete/10 |
| | | /// <summary> |
| | | /// 单选删除 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("单选删除")] |
| | | public async Task<AdminUiCallBack> DoDelete([FromBody]FMIntId entity) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var model = await _OfflineDistributorServices.ExistsAsync(p => p.Id == entity.id, true); |
| | | if (!model) |
| | | { |
| | | jm.msg = GlobalConstVars.DataisNo; |
| | | return jm; |
| | | } |
| | | jm = await _OfflineDistributorServices.DeleteByIdAsync(entity.id); |
| | | |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | #region 批量删除============================================================ |
| | | // POST: Api/OfflineDistributor/DoBatchDelete/10,11,20 |
| | | /// <summary> |
| | | /// 批量删除 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("批量删除")] |
| | | public async Task<AdminUiCallBack> DoBatchDelete([FromBody]FMArrayIntIds entity) |
| | | { |
| | | var jm = await _OfflineDistributorServices.DeleteByIdsAsync(entity.id); |
| | | return jm; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 预览数据============================================================ |
| | | // POST: Api/OfflineDistributor/GetDetails/10 |
| | | /// <summary> |
| | | /// 预览数据 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("预览数据")] |
| | | public async Task<AdminUiCallBack> GetDetails([FromBody]FMIntId entity) |
| | | { |
| | | //var jm = new AdminUiCallBack(); |
| | | var model = await _OfflineDistributorServices.GetInfo(entity.id); |
| | | if (model.code == 0) |
| | | { |
| | | var d = await _coreCmsAreaServices.GetAreaFullName((model.data as OfflineDistributor)?.Region?.Split(",").ToList().OrderDescending()?.FirstOrDefault()?.ToInt32OrDefault(0) ?? 0); |
| | | (model.data as OfflineDistributor).areaCodeName = d.data.ToString(); |
| | | } |
| | | |
| | | return model; |
| | | } |
| | | #endregion |
| | | |
| | | #region 选择导出============================================================ |
| | | // POST: Api/OfflineDistributor/SelectExportExcel/10 |
| | | /// <summary> |
| | | /// 选择导出 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("选择导出")] |
| | | public async Task<AdminUiCallBack> SelectExportExcel([FromBody]FMArrayIntIds entity) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | //创建Excel文件的对象 |
| | | var book = new HSSFWorkbook(); |
| | | //添加一个sheet |
| | | var mySheet = book.CreateSheet("Sheet1"); |
| | | //获取list数据 |
| | | var listModel = await _OfflineDistributorServices.QueryListByClauseAsync(p => entity.id.Contains(p.Id), p => p.Id, OrderByType.Asc, true); |
| | | //给sheet1添加第一行的头部标题 |
| | | var headerRow = mySheet.CreateRow(0); |
| | | var headerStyle = ExcelHelper.GetHeaderStyle(book); |
| | | var cellNum = 0; |
| | | |
| | | var cell0 = headerRow.CreateCell(cellNum); |
| | | cell0.SetCellValue("主键ID"); |
| | | cell0.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell1 = headerRow.CreateCell(cellNum); |
| | | cell1.SetCellValue("信息收集时间"); |
| | | cell1.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell2 = headerRow.CreateCell(cellNum); |
| | | cell2.SetCellValue("区域信息"); |
| | | cell2.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell3 = headerRow.CreateCell(cellNum); |
| | | cell3.SetCellValue("详细地址"); |
| | | cell3.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell4 = headerRow.CreateCell(cellNum); |
| | | cell4.SetCellValue("类别"); |
| | | cell4.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell5 = headerRow.CreateCell(cellNum); |
| | | cell5.SetCellValue("学校名称"); |
| | | cell5.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell6 = headerRow.CreateCell(cellNum); |
| | | cell6.SetCellValue("经销商名称"); |
| | | cell6.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell7 = headerRow.CreateCell(cellNum); |
| | | cell7.SetCellValue("联系人姓名"); |
| | | cell7.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell8 = headerRow.CreateCell(cellNum); |
| | | cell8.SetCellValue("联系电话"); |
| | | cell8.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell9 = headerRow.CreateCell(cellNum); |
| | | cell9.SetCellValue("店招图片地址"); |
| | | cell9.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell10 = headerRow.CreateCell(cellNum); |
| | | cell10.SetCellValue("合作意向描述"); |
| | | cell10.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell11 = headerRow.CreateCell(cellNum); |
| | | cell11.SetCellValue("业务经理姓名"); |
| | | cell11.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell12 = headerRow.CreateCell(cellNum); |
| | | cell12.SetCellValue("洽谈记录"); |
| | | cell12.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell13 = headerRow.CreateCell(cellNum); |
| | | cell13.SetCellValue("收集人ID"); |
| | | cell13.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell14 = headerRow.CreateCell(cellNum); |
| | | cell14.SetCellValue("备注"); |
| | | cell14.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell15 = headerRow.CreateCell(cellNum); |
| | | cell15.SetCellValue("建立时间"); |
| | | cell15.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell16 = headerRow.CreateCell(cellNum); |
| | | cell16.SetCellValue("修改时间"); |
| | | cell16.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell17 = headerRow.CreateCell(cellNum); |
| | | cell17.SetCellValue("创建人"); |
| | | cell17.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell18 = headerRow.CreateCell(cellNum); |
| | | cell18.SetCellValue("修改人"); |
| | | cell18.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell19 = headerRow.CreateCell(cellNum); |
| | | cell19.SetCellValue("删除标志"); |
| | | cell19.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | headerRow.Height = 30 * 20; |
| | | var commonCellStyle = ExcelHelper.GetCommonStyle(book); |
| | | |
| | | //将数据逐步写入sheet1各个行 |
| | | for (var i = 0; i < listModel.Count; i++) |
| | | { |
| | | var rowTemp = mySheet.CreateRow(i + 1); |
| | | var cellNumTemp = 0; |
| | | |
| | | var rowTemp0 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp0.SetCellValue(listModel[i].Id.ToString()); |
| | | rowTemp0.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp1 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp1.SetCellValue(listModel[i].CollectionTime.ToString()); |
| | | rowTemp1.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp2 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp2.SetCellValue(listModel[i].Region.ToString()); |
| | | rowTemp2.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp3 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp3.SetCellValue(listModel[i].Adder.ToString()); |
| | | rowTemp3.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp4 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp4.SetCellValue(listModel[i].Category.ToString()); |
| | | rowTemp4.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp5 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp5.SetCellValue(listModel[i].School.ToString()); |
| | | rowTemp5.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp6 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp6.SetCellValue(listModel[i].DealerName.ToString()); |
| | | rowTemp6.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp7 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp7.SetCellValue(listModel[i].ContactPerson.ToString()); |
| | | rowTemp7.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp8 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp8.SetCellValue(listModel[i].PhoneNumber.ToString()); |
| | | rowTemp8.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp9 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp9.SetCellValue(listModel[i].StoreLogoUrl.ToString()); |
| | | rowTemp9.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp10 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp10.SetCellValue(listModel[i].CooperationIntent.ToString()); |
| | | rowTemp10.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp11 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp11.SetCellValue(listModel[i].BusinessManager.ToString()); |
| | | rowTemp11.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp12 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp12.SetCellValue(listModel[i].NegotiationRecord.ToString()); |
| | | rowTemp12.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp13 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp13.SetCellValue(listModel[i].UserID.ToString()); |
| | | rowTemp13.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp14 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp14.SetCellValue(listModel[i].Remake.ToString()); |
| | | rowTemp14.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp15 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp15.SetCellValue(listModel[i].createTime.ToString()); |
| | | rowTemp15.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp16 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp16.SetCellValue(listModel[i].upDataTime.ToString()); |
| | | rowTemp16.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp17 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp17.SetCellValue(listModel[i].createBy.ToString()); |
| | | rowTemp17.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp18 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp18.SetCellValue(listModel[i].upDataBy.ToString()); |
| | | rowTemp18.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp19 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp19.SetCellValue(listModel[i].isdelete.ToString()); |
| | | rowTemp19.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | } |
| | | // 导出excel |
| | | string webRootPath = _webHostEnvironment.WebRootPath; |
| | | string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; |
| | | string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-OfflineDistributor导出(选择结果).xls"; |
| | | string filePath = webRootPath + tpath; |
| | | DirectoryInfo di = new DirectoryInfo(filePath); |
| | | if (!di.Exists) |
| | | { |
| | | di.Create(); |
| | | } |
| | | FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create); |
| | | book.Write(fileHssf); |
| | | fileHssf.Close(); |
| | | |
| | | jm.code = 0; |
| | | jm.msg = GlobalConstVars.ExcelExportSuccess; |
| | | jm.data = tpath + fileName; |
| | | |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | #region 查询导出============================================================ |
| | | // POST: Api/OfflineDistributor/QueryExportExcel/10 |
| | | /// <summary> |
| | | /// 查询导出 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("查询导出")] |
| | | public async Task<AdminUiCallBack> QueryExportExcel() |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var where = PredicateBuilder.True<OfflineDistributor>(); |
| | | //查询筛选 |
| | | |
| | | //主键ID int |
| | | var Id = Request.Form["Id"].FirstOrDefault().ObjectToInt(0); |
| | | if (Id > 0) |
| | | { |
| | | where = where.And(p => p.Id == Id); |
| | | } |
| | | //信息收集时间 datetime |
| | | var CollectionTime = Request.Form["CollectionTime"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(CollectionTime)) |
| | | { |
| | | if (CollectionTime.Contains("到")) |
| | | { |
| | | var dts = CollectionTime.Split("到"); |
| | | var dtStart = dts[0].Trim().ObjectToDate(); |
| | | where = where.And(p => p.CollectionTime > dtStart); |
| | | var dtEnd = dts[1].Trim().ObjectToDate(); |
| | | where = where.And(p => p.CollectionTime < dtEnd); |
| | | } |
| | | else |
| | | { |
| | | var dt = CollectionTime.ObjectToDate(); |
| | | where = where.And(p => p.CollectionTime > dt); |
| | | } |
| | | } |
| | | //区域信息 varchar |
| | | var Region = Request.Form["Region"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Region)) |
| | | { |
| | | where = where.And(p => p.Region.Contains(Region)); |
| | | } |
| | | //详细地址 varchar |
| | | var Adder = Request.Form["Adder"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Adder)) |
| | | { |
| | | where = where.And(p => p.Adder.Contains(Adder)); |
| | | } |
| | | //类别 varchar |
| | | var Category = Request.Form["Category"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Category)) |
| | | { |
| | | where = where.And(p => p.Category.Contains(Category)); |
| | | } |
| | | //学校名称 varchar |
| | | var School = Request.Form["School"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(School)) |
| | | { |
| | | where = where.And(p => p.School.Contains(School)); |
| | | } |
| | | //经销商名称 varchar |
| | | var DealerName = Request.Form["DealerName"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(DealerName)) |
| | | { |
| | | where = where.And(p => p.DealerName.Contains(DealerName)); |
| | | } |
| | | //联系人姓名 varchar |
| | | var ContactPerson = Request.Form["ContactPerson"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(ContactPerson)) |
| | | { |
| | | where = where.And(p => p.ContactPerson.Contains(ContactPerson)); |
| | | } |
| | | //联系电话 varchar |
| | | var PhoneNumber = Request.Form["PhoneNumber"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(PhoneNumber)) |
| | | { |
| | | where = where.And(p => p.PhoneNumber.Contains(PhoneNumber)); |
| | | } |
| | | //店招图片地址 varchar |
| | | var StoreLogoUrl = Request.Form["StoreLogoUrl"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(StoreLogoUrl)) |
| | | { |
| | | where = where.And(p => p.StoreLogoUrl.Contains(StoreLogoUrl)); |
| | | } |
| | | //合作意向描述 varchar |
| | | var CooperationIntent = Request.Form["CooperationIntent"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(CooperationIntent)) |
| | | { |
| | | where = where.And(p => p.CooperationIntent.Contains(CooperationIntent)); |
| | | } |
| | | //业务经理姓名 varchar |
| | | var BusinessManager = Request.Form["BusinessManager"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(BusinessManager)) |
| | | { |
| | | where = where.And(p => p.BusinessManager.Contains(BusinessManager)); |
| | | } |
| | | //洽谈记录 varchar |
| | | var NegotiationRecord = Request.Form["NegotiationRecord"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(NegotiationRecord)) |
| | | { |
| | | where = where.And(p => p.NegotiationRecord.Contains(NegotiationRecord)); |
| | | } |
| | | //收集人ID varchar |
| | | var UserID = Request.Form["UserID"].FirstOrDefault().ToInt32OrDefault(); |
| | | if (UserID>0) |
| | | { |
| | | where = where.And(p => p.UserID==UserID); |
| | | } |
| | | //备注 varchar |
| | | var Remake = Request.Form["Remake"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(Remake)) |
| | | { |
| | | where = where.And(p => p.Remake.Contains(Remake)); |
| | | } |
| | | //建立时间 datetime |
| | | var createTime = Request.Form["createTime"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(createTime)) |
| | | { |
| | | if (createTime.Contains("到")) |
| | | { |
| | | var dts = createTime.Split("到"); |
| | | var dtStart = dts[0].Trim().ObjectToDate(); |
| | | where = where.And(p => p.createTime > dtStart); |
| | | var dtEnd = dts[1].Trim().ObjectToDate(); |
| | | where = where.And(p => p.createTime < dtEnd); |
| | | } |
| | | else |
| | | { |
| | | var dt = createTime.ObjectToDate(); |
| | | where = where.And(p => p.createTime > dt); |
| | | } |
| | | } |
| | | //修改时间 datetime |
| | | var upDataTime = Request.Form["upDataTime"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(upDataTime)) |
| | | { |
| | | if (upDataTime.Contains("到")) |
| | | { |
| | | var dts = upDataTime.Split("到"); |
| | | var dtStart = dts[0].Trim().ObjectToDate(); |
| | | where = where.And(p => p.upDataTime > dtStart); |
| | | var dtEnd = dts[1].Trim().ObjectToDate(); |
| | | where = where.And(p => p.upDataTime < dtEnd); |
| | | } |
| | | else |
| | | { |
| | | var dt = upDataTime.ObjectToDate(); |
| | | where = where.And(p => p.upDataTime > dt); |
| | | } |
| | | } |
| | | //创建人 varchar |
| | | var createBy = Request.Form["createBy"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(createBy)) |
| | | { |
| | | where = where.And(p => p.createBy.Contains(createBy)); |
| | | } |
| | | //修改人 varchar |
| | | var upDataBy = Request.Form["upDataBy"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(upDataBy)) |
| | | { |
| | | where = where.And(p => p.upDataBy.Contains(upDataBy)); |
| | | } |
| | | //删除标志 bit |
| | | var isdelete = Request.Form["isdelete"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(isdelete) && isdelete.ToLowerInvariant() == "true") |
| | | { |
| | | where = where.And(p => p.isdelete == true); |
| | | } |
| | | else if (!string.IsNullOrEmpty(isdelete) && isdelete.ToLowerInvariant() == "false") |
| | | { |
| | | where = where.And(p => p.isdelete == false); |
| | | } |
| | | //获取数据 |
| | | //创建Excel文件的对象 |
| | | var book = new HSSFWorkbook(); |
| | | //添加一个sheet |
| | | var mySheet = book.CreateSheet("Sheet1"); |
| | | //获取list数据 |
| | | var listModel = await _OfflineDistributorServices.QueryListByClauseAsync(where, p => p.Id, OrderByType.Asc, true); |
| | | //给sheet1添加第一行的头部标题 |
| | | var headerRow = mySheet.CreateRow(0); |
| | | var headerStyle = ExcelHelper.GetHeaderStyle(book); |
| | | var cellNum = 0; |
| | | |
| | | var cell0 = headerRow.CreateCell(cellNum); |
| | | cell0.SetCellValue("主键ID"); |
| | | cell0.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell1 = headerRow.CreateCell(cellNum); |
| | | cell1.SetCellValue("信息收集时间"); |
| | | cell1.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell2 = headerRow.CreateCell(cellNum); |
| | | cell2.SetCellValue("区域信息"); |
| | | cell2.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell3 = headerRow.CreateCell(cellNum); |
| | | cell3.SetCellValue("详细地址"); |
| | | cell3.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell4 = headerRow.CreateCell(cellNum); |
| | | cell4.SetCellValue("类别"); |
| | | cell4.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell5 = headerRow.CreateCell(cellNum); |
| | | cell5.SetCellValue("学校名称"); |
| | | cell5.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell6 = headerRow.CreateCell(cellNum); |
| | | cell6.SetCellValue("经销商名称"); |
| | | cell6.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell7 = headerRow.CreateCell(cellNum); |
| | | cell7.SetCellValue("联系人姓名"); |
| | | cell7.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell8 = headerRow.CreateCell(cellNum); |
| | | cell8.SetCellValue("联系电话"); |
| | | cell8.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell9 = headerRow.CreateCell(cellNum); |
| | | cell9.SetCellValue("店招图片地址"); |
| | | cell9.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell10 = headerRow.CreateCell(cellNum); |
| | | cell10.SetCellValue("合作意向描述"); |
| | | cell10.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell11 = headerRow.CreateCell(cellNum); |
| | | cell11.SetCellValue("业务经理姓名"); |
| | | cell11.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell12 = headerRow.CreateCell(cellNum); |
| | | cell12.SetCellValue("洽谈记录"); |
| | | cell12.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell13 = headerRow.CreateCell(cellNum); |
| | | cell13.SetCellValue("收集人ID"); |
| | | cell13.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell14 = headerRow.CreateCell(cellNum); |
| | | cell14.SetCellValue("备注"); |
| | | cell14.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell15 = headerRow.CreateCell(cellNum); |
| | | cell15.SetCellValue("建立时间"); |
| | | cell15.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell16 = headerRow.CreateCell(cellNum); |
| | | cell16.SetCellValue("修改时间"); |
| | | cell16.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell17 = headerRow.CreateCell(cellNum); |
| | | cell17.SetCellValue("创建人"); |
| | | cell17.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell18 = headerRow.CreateCell(cellNum); |
| | | cell18.SetCellValue("修改人"); |
| | | cell18.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | var cell19 = headerRow.CreateCell(cellNum); |
| | | cell19.SetCellValue("删除标志"); |
| | | cell19.CellStyle = headerStyle; |
| | | mySheet.SetColumnWidth(cellNum, 10 * 256); |
| | | cellNum++; |
| | | |
| | | |
| | | headerRow.Height = 30 * 20; |
| | | var commonCellStyle = ExcelHelper.GetCommonStyle(book); |
| | | |
| | | //将数据逐步写入sheet1各个行 |
| | | for (var i = 0; i < listModel.Count; i++) |
| | | { |
| | | var rowTemp = mySheet.CreateRow(i + 1); |
| | | var cellNumTemp = 0; |
| | | |
| | | var rowTemp0 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp0.SetCellValue(listModel[i].Id.ToString()); |
| | | rowTemp0.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp1 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp1.SetCellValue(listModel[i].CollectionTime.ToString()); |
| | | rowTemp1.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp2 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp2.SetCellValue(listModel[i].Region.ToString()); |
| | | rowTemp2.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp3 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp3.SetCellValue(listModel[i].Adder.ToString()); |
| | | rowTemp3.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp4 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp4.SetCellValue(listModel[i].Category.ToString()); |
| | | rowTemp4.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp5 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp5.SetCellValue(listModel[i].School.ToString()); |
| | | rowTemp5.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp6 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp6.SetCellValue(listModel[i].DealerName.ToString()); |
| | | rowTemp6.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp7 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp7.SetCellValue(listModel[i].ContactPerson.ToString()); |
| | | rowTemp7.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp8 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp8.SetCellValue(listModel[i].PhoneNumber.ToString()); |
| | | rowTemp8.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp9 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp9.SetCellValue(listModel[i].StoreLogoUrl.ToString()); |
| | | rowTemp9.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp10 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp10.SetCellValue(listModel[i].CooperationIntent.ToString()); |
| | | rowTemp10.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp11 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp11.SetCellValue(listModel[i].BusinessManager.ToString()); |
| | | rowTemp11.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp12 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp12.SetCellValue(listModel[i].NegotiationRecord.ToString()); |
| | | rowTemp12.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp13 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp13.SetCellValue(listModel[i].UserID.ToString()); |
| | | rowTemp13.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp14 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp14.SetCellValue(listModel[i].Remake.ToString()); |
| | | rowTemp14.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp15 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp15.SetCellValue(listModel[i].createTime.ToString()); |
| | | rowTemp15.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp16 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp16.SetCellValue(listModel[i].upDataTime.ToString()); |
| | | rowTemp16.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp17 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp17.SetCellValue(listModel[i].createBy.ToString()); |
| | | rowTemp17.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp18 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp18.SetCellValue(listModel[i].upDataBy.ToString()); |
| | | rowTemp18.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | var rowTemp19 = rowTemp.CreateCell(cellNumTemp); |
| | | rowTemp19.SetCellValue(listModel[i].isdelete.ToString()); |
| | | rowTemp19.CellStyle = commonCellStyle; |
| | | cellNumTemp++; |
| | | |
| | | } |
| | | // 写入到excel |
| | | string webRootPath = _webHostEnvironment.WebRootPath; |
| | | string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; |
| | | string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-OfflineDistributor导出(查询结果).xls"; |
| | | string filePath = webRootPath + tpath; |
| | | DirectoryInfo di = new DirectoryInfo(filePath); |
| | | if (!di.Exists) |
| | | { |
| | | di.Create(); |
| | | } |
| | | FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create); |
| | | book.Write(fileHssf); |
| | | fileHssf.Close(); |
| | | |
| | | jm.code = 0; |
| | | jm.msg = GlobalConstVars.ExcelExportSuccess; |
| | | jm.data = tpath + fileName; |
| | | |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 设置删除标志============================================================ |
| | | // POST: Api/OfflineDistributor/DoSetisdelete/10 |
| | | /// <summary> |
| | | /// 设置删除标志 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("设置删除标志")] |
| | | public async Task<AdminUiCallBack> DoSetisdelete([FromBody]FMUpdateBoolDataByIntId entity) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var oldModel = await _OfflineDistributorServices.QueryByIdAsync(entity.id, false); |
| | | if (oldModel == null) |
| | | { |
| | | jm.msg = "不存在此信息"; |
| | | return jm; |
| | | } |
| | | oldModel.isdelete = (bool)entity.data; |
| | | |
| | | var bl = await _OfflineDistributorServices.UpdateAsync(p => new OfflineDistributor() { isdelete = oldModel.isdelete }, p => p.Id == oldModel.Id); |
| | | jm.code = bl ? 0 : 1; |
| | | jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; |
| | | |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | #endregion |
| | | #region 设置是否成为推广人员百分兵法 |
| | | /// <summary> |
| | | /// 设置是否成为推广人员 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("设置是否成为推广人员")] |
| | | public async Task<AdminUiCallBack> DoSetIsBaiFenBingfaP([FromBody] FMUpdateBoolDataByIntId entity) |
| | | { |
| | | var jm = new AdminUiCallBack(); |
| | | |
| | | var oldModel = await _coreCmsUserServices.QueryByIdAsync(entity.id); |
| | | if (oldModel == null) |
| | | { |
| | | jm.msg = "不存在此信息"; |
| | | return jm; |
| | | } |
| | | |
| | | oldModel.IsBaifenPromotion = entity.data; |
| | | |
| | | var bl = await _coreCmsUserServices.UpdateAsync(oldModel); |
| | | jm.code = bl ? 0 : 1; |
| | | jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; |
| | | |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | * @Author: 小飞侠 |
| | | * @Date: 2024-02-29 15:07:28 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2024-02-29 15:17:32 |
| | | * @LastEditTime: 2024-03-29 13:38:53 |
| | | * Copyright: 2024 MinTinge CO.,LTD. All Rights Reserved. |
| | | * @Descripttion: 通用函数库 |
| | | */ |
| | |
| | | const regex = /^-?\d+(\.\d+)?$/; // 匹配整数或小数,包括负数 |
| | | return regex.test(str); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | <script type="text/html" template lay-done="layui.data.done(d);"> |
| | | <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-OfflineDistributor-createForm" id="LAY-app-OfflineDistributor-createForm"> |
| | | |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="CollectionTime" class="layui-form-label layui-form-required">信息收集时间</label> |
| | | <div class="layui-input-block"> |
| | | <input name="CollectionTime" id="createTime-OfflineDistributor-CollectionTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入信息收集时间" lay-reqText="请输入信息收集时间" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label for="pUserID" class="layui-form-label ">推荐人</label> |
| | | <div class="layui-input-block"> |
| | | <select lay-search="" name="pUserID" id="CreatOfflinedisSelUserID"> |
| | | <option value="">请选择或搜索(设置区分大小写)</option> |
| | | |
| | | </select> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="Region" class="layui-form-label ">区域信息</label> |
| | | <div class="layui-input-block layui-inline-4 address-class" > |
| | | <input name="CreatofflinedisRegion" type="hidden" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label for="Adder" class="layui-form-label ">详细地址</label> |
| | | <div class="layui-input-block"> |
| | | <input name="Adder" lay-verType="tips" class="layui-input" placeholder="请输入详细地址" lay-reqText="请输入详细地址" /> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="Category" class="layui-form-label ">类别</label> |
| | | <div class="layui-input-block"> |
| | | <input name="Category" lay-verType="tips" class="layui-input" ID="CreatCatgory" placeholder="请输入类别" lay-reqText="请输入类别" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label for="School" class="layui-form-label ">学校名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="School" lay-verType="tips" class="layui-input" placeholder="请输入学校名称" lay-reqText="请输入学校名称" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="DealerName" class="layui-form-label layui-form-required">经销商名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="DealerName" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入经销商名称" lay-reqText="请输入经销商名称" /> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="ContactPerson" class="layui-form-label ">联系人姓名</label> |
| | | <div class="layui-input-block"> |
| | | <input name="ContactPerson" lay-verType="tips"class="layui-input" placeholder="请输入联系人姓名" lay-reqText="请输入联系人姓名" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="PhoneNumber" class="layui-form-label ">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="PhoneNumber" lay-verType="tips" class="layui-input" placeholder="请输入联系电话" lay-reqText="请输入联系电话" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- |
| | | <div class="layui-form-item"> |
| | | <label for="StoreLogoUrl" class="layui-form-label layui-form-required">店招图片地址</label> |
| | | <div class="layui-input-block"> |
| | | <input name="StoreLogoUrl" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入店招图片地址" lay-reqText="请输入店招图片地址" /> |
| | | </div> |
| | | </div> --> |
| | | |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="intentionDec" class="layui-form-label layui-form-required" |
| | | >合作意向</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="CooperationIntent" |
| | | lay-verType="tips" |
| | | lay-verify="required" |
| | | class="layui-input" |
| | | placeholder="请输入合作意向" |
| | | lay-reqText="请输入合作意向" |
| | | id="CooperationIntent" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="BusinessManager" class="layui-form-label ">业务经理</label> |
| | | <div class="layui-input-block"> |
| | | <input name="BusinessManager" lay-verType="tips" class="layui-input" placeholder="请输入业务经理姓名" lay-reqText="请输入业务经理姓名" /> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="storeLogoUrl">店招</label> |
| | | <div class="layui-input-inline layui-inline-6"> |
| | | <input name="storeLogoUrl" id="storeLogoUrl" size="15" autocomplete="off" class="layui-input" lay-reqText="请输入【缩略图】" /> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn" id="upBtnOriginalCreat">上传图像</button> |
| | | <div class="layui-input-inline"> |
| | | <img class="layui-upload-img" id="viewImgBox" src="{{ layui.setter.noImagePicUrl }}"> |
| | | <p id="viewTextBox"></p> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="Remake" class="layui-form-label ">备注</label> |
| | | <div class="layui-input-block"> |
| | | <input name="Remake" lay-verType="tips" class="layui-input" placeholder="请输入备注" lay-reqText="请输入备注" /> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | <div class="layui-form-item text-right core-hidden"> |
| | | <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-OfflineDistributor-createForm-submit" id="LAY-app-OfflineDistributor-createForm-submit" value="确认添加"> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | <script> |
| | | var debug = layui.setter.debug; |
| | | layui.data.done = function (d) { |
| | | //开启调试情况下获取接口赋值数据 |
| | | if (debug) { |
| | | console.log(d.params.data); |
| | | } |
| | | layui.use( |
| | | ["admin", "form", "laydate", "upload", "coreHelper", "cropperImg","dropdown","upload"], |
| | | function () { |
| | | var $ = layui.$, |
| | | form = layui.form, |
| | | admin = layui.admin, |
| | | laydate = layui.laydate, |
| | | upload = layui.upload, |
| | | cropperImg = layui.cropperImg, |
| | | coreHelper = layui.coreHelper, |
| | | upload = layui.upload, |
| | | dropdown=layui.dropdown; |
| | | formatAreaInPut(coreHelper, "CreatofflinedisRegion"); |
| | | formatUserSelInPut(coreHelper, form, "CreatOfflinedisSelUserID"); |
| | | //普通图片上传 |
| | | upload.render({ |
| | | elem: '#upBtnOriginalCreat' |
| | | , url: layui.setter.apiUrl + 'Api/Tools/UploadFiles' |
| | | , before: function (obj) { |
| | | obj.preview(function (index, file, result) { |
| | | $('#viewImgBox').attr('src', result); |
| | | }); |
| | | } |
| | | , done: function (res) { |
| | | if (res.code > 0) { return layer.msg('上传失败'); } |
| | | layer.msg('上传成功'); |
| | | $("#storeLogoUrl").val(res.data.fileUrl); |
| | | } |
| | | , error: function () { |
| | | var viewTextBox = $('#viewTextBox'); |
| | | viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>'); |
| | | viewTextBox.find('.demo-reload').on('click', function () { |
| | | uploadInst.upload(); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | dropdown.render({ |
| | | elem: "#CooperationIntent", |
| | | data: [ |
| | | { |
| | | title: "大", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "小", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "不确定", |
| | | id: 103, |
| | | } |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | dropdown.render({ |
| | | elem: "#CreatCatgory", |
| | | data: [ |
| | | { |
| | | title: "文具店", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "广告店", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "小卖部", |
| | | id: 103, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: "#createTime-OfflineDistributor-CollectionTime", |
| | | type: "datetime", |
| | | value: new Date(), |
| | | fullPanel: true, |
| | | }); |
| | | laydate.render({ |
| | | elem: "#createTime-OfflineDistributor-createTime", |
| | | type: "datetime", |
| | | value: new Date(), |
| | | fullPanel: true, |
| | | }); |
| | | laydate.render({ |
| | | elem: "#createTime-OfflineDistributor-upDataTime", |
| | | type: "datetime", |
| | | value: new Date(), |
| | | fullPanel: true, |
| | | }); |
| | | form.verify({}); |
| | | //重载form |
| | | form.render(null, "LAY-app-OfflineDistributor-createForm"); |
| | | } |
| | | ); |
| | | }; |
| | | </script> |
New file |
| | |
| | | <script type="text/html" template lay-done="layui.data.sendParams(d);"> |
| | | <div |
| | | class="layui-form coreshop-form layui-form-pane" |
| | | lay-filter="LAY-app-OfflineDistributor-editForm" |
| | | id="LAY-app-OfflineDistributor-editForm" |
| | | > |
| | | |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label |
| | | for="collectionTime" |
| | | class="layui-form-label layui-form-required" |
| | | >信息收集时间</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | disabled |
| | | name="collectionTime" |
| | | id="editTime-OfflineDistributor-CollectionTime" |
| | | type="text" |
| | | lay-verType="tips" |
| | | lay-verify="required|datetime" |
| | | class="layui-input" |
| | | placeholder="请输入信息收集时间" |
| | | lay-reqText="请输入信息收集时间" |
| | | value="{{d.params.data.collectionTime || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label for="pUserID" class="layui-form-label ">推荐人</label> |
| | | <div class="layui-input-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select lay-search="" name="pUserID" id="EditOfflinedisSelUserID" disabled> |
| | | <option value="">请选择或搜索(设置区分大小写)</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="" class="layui-form-label">区域信息</label> |
| | | <div class="layui-input-block"> |
| | | |
| | | <input |
| | | class="layui-input" |
| | | value="{{d.params.data.areaCodeName || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="Adder" class="layui-form-label ">详细地址</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="adder" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入详细地址" |
| | | lay-reqText="请输入详细地址" |
| | | value="{{d.params.data.adder || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="Category" class="layui-form-label ">类别</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="category" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入类别" |
| | | lay-reqText="请输入类别" |
| | | value="{{d.params.data.category || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="School" class="layui-form-label ">学校名称</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="school" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入学校名称" |
| | | lay-reqText="请输入学校名称" |
| | | value="{{d.params.data.school || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="DealerName" class="layui-form-label layui-form-required" |
| | | >经销商名称</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="dealerName" |
| | | lay-verType="tips" |
| | | lay-verify="required" |
| | | class="layui-input" |
| | | placeholder="请输入经销商名称" |
| | | lay-reqText="请输入经销商名称" |
| | | value="{{d.params.data.dealerName || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="ContactPerson" class="layui-form-label " |
| | | >联系人姓名</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="contactPerson" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入联系人姓名" |
| | | lay-reqText="请输入联系人姓名" |
| | | value="{{d.params.data.contactPerson || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="PhoneNumber" class="layui-form-label ">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="phoneNumber" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入联系电话" |
| | | lay-reqText="请输入联系电话" |
| | | value="{{d.params.data.phoneNumber || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label |
| | | for="cooperationIntent" |
| | | class="layui-form-label layui-form-required " |
| | | >合作意向</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="cooperationIntent" |
| | | id="EditCooperationIntent" |
| | | lay-verify="required" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入合作意向描述" |
| | | lay-reqText="请输入合作意向描述" |
| | | value="{{d.params.data.cooperationIntent || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="businessManager" class="layui-form-label " |
| | | >业务经理</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="businessManager" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入业务经理姓名" |
| | | lay-reqText="请输入业务经理姓名" |
| | | value="{{d.params.data.businessManager || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="StoreLogoUrl" class="layui-form-label ">店招</label> |
| | | <div class="layui-input-inline" style="width: 300px;"> |
| | | |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | |
| | | <div class="layui-input-inline" style="padding-left: 100px;" > |
| | | <img |
| | | class="layui-upload-img" |
| | | id="viewImgBoxEdit" |
| | | src="{{ d.params.data.storeLogoUrl || layui.setter.noImagePicUrl ||''}}" |
| | | /> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="Remake" class="layui-form-label ">备注</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="Remake" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入备注" |
| | | lay-reqText="请输入备注" |
| | | value="{{d.params.data.remake || '' }}" |
| | | disabled |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-xs6"> |
| | | <fieldset |
| | | style="color: rgb(80, 75, 9); border-color: bisque;" |
| | | class="layui-elem-field layui-field-title" |
| | | > |
| | | <legend>洽谈记录</legend> |
| | | </fieldset> |
| | | <table |
| | | class="layui-hide" |
| | | id="id-EditmeettingOffdisTab" |
| | | lay-filter="id-EditmeettingOffdisTab" |
| | | ></table> |
| | | <!-- 添加数据按钮 --> |
| | | |
| | | |
| | | </div> |
| | | <div class="layui-col-xs6"> |
| | | <fieldset |
| | | style="color: rgb(68, 59, 11);border-color: bisque;" |
| | | class="layui-elem-field layui-field-title" |
| | | > |
| | | <legend>合作记录</legend> |
| | | </fieldset> |
| | | <table |
| | | class="layui-hide" |
| | | id="id-EditoffdisOderTab" |
| | | lay-filter="id-EditoffdisOderTab" |
| | | ></table> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item text-right core-hidden"> |
| | | <input |
| | | type="button" |
| | | class="layui-btn" |
| | | lay-submit |
| | | lay-filter="LAY-app-OfflineDistributor-editForm-submit" |
| | | id="LAY-app-OfflineDistributor-editForm-submit" |
| | | value="确认编辑" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="TPL-laydate-Meetingdemo"> |
| | | <input |
| | | class="layui-input Meetinglaydate-demo" |
| | | placeholder="选择日期" |
| | | value="{{= d.time || '' }}" |
| | | tyle="height: 25px;" |
| | | lay-verType="tips" |
| | | lay-verify="required" |
| | | /> |
| | | </script> |
| | | <script> |
| | | var debug = layui.setter.debug; |
| | | layui.data.sendParams = function (d) { |
| | | //开启调试情况下获取接口赋值数据 |
| | | if (debug) { |
| | | console.log(d.params.data); |
| | | } |
| | | layui.use( |
| | | [ |
| | | "admin", |
| | | "form", |
| | | "laydate", |
| | | "upload", |
| | | "coreHelper", |
| | | "cropperImg", |
| | | "dropdown", |
| | | "table", |
| | | ], |
| | | function () { |
| | | var $ = layui.$, |
| | | form = layui.form, |
| | | admin = layui.admin, |
| | | laydate = layui.laydate, |
| | | upload = layui.upload, |
| | | cropperImg = layui.cropperImg, |
| | | dropdown = layui.dropdown, |
| | | table = layui.table, |
| | | coreHelper = layui.coreHelper; |
| | | |
| | | formatAreaInPut( |
| | | coreHelper, |
| | | "editOfflinedisRegion", |
| | | d.params.data.region |
| | | ); |
| | | formatUserSelInPut( |
| | | coreHelper, |
| | | form, |
| | | "EditOfflinedisSelUserID", |
| | | d.params.data.pUserID || "" |
| | | ); |
| | | //普通图片上传 |
| | | upload.render({ |
| | | elem: "#upBtnOriginalEdit", |
| | | url: layui.setter.apiUrl + "Api/Tools/UploadFiles", |
| | | before: function (obj) { |
| | | obj.preview(function (index, file, result) { |
| | | $("#viewImgBoxEdit").attr("src", result); |
| | | }); |
| | | }, |
| | | done: function (res) { |
| | | if (res.code > 0) { |
| | | return layer.msg("上传失败"); |
| | | } |
| | | layer.msg("上传成功"); |
| | | $("#upBtnOriginalEdit").val(res.data.fileUrl); |
| | | }, |
| | | error: function () { |
| | | var viewTextBox = $("#viewTextBoxEdit"); |
| | | viewTextBox.html( |
| | | '<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>' |
| | | ); |
| | | viewTextBox.find(".demo-reload").on("click", function () { |
| | | uploadInst.upload(); |
| | | }); |
| | | }, |
| | | }); |
| | | dropdown.render({ |
| | | elem: "#EditCooperationIntent", |
| | | data: [ |
| | | { |
| | | title: "大", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "小", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "不确定", |
| | | id: 103, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | |
| | | table.render({ |
| | | elem: "#id-EditmeettingOffdisTab", |
| | | // url: '/static/json/2/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口 |
| | | data: d.params.data.meetings, |
| | | page: false, |
| | | cols: [ |
| | | [ |
| | | { type: "numbers", title: "序号" }, |
| | | { |
| | | field: "time", |
| | | title: "洽谈时间", |
| | | |
| | | width: 150, |
| | | }, |
| | | { field: "dec", title: "洽谈内容"}, // 设置编辑类型为文本框 |
| | | |
| | | ], |
| | | ], |
| | | // initSort: { |
| | | // // 设置初始排序 |
| | | // field: "time", // 字段名 |
| | | // type: "desc", // 倒序 |
| | | // }, |
| | | height: 200, |
| | | done: function (res, curr, count) { |
| | | var options = this; |
| | | // 获取当前行数据 |
| | | table.getRowData = function (tableId, elem) { |
| | | var index = $(elem).closest("tr").data("index"); |
| | | return table.cache[tableId][index] || {}; |
| | | }; |
| | | laydate.render({ |
| | | elem: ".Meetinglaydate-demo", |
| | | type: "datetime", |
| | | trigger: "click", |
| | | fullPanel: true, |
| | | done: function (value, date, endDate) { |
| | | var data = table.getRowData(options.id, this.elem); // 获取当前行数据(如 id 等字段,以作为数据修改的索引) |
| | | // 更新数据中对应的字段 |
| | | data.time = value; |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
| | | |
| | | // 监听添加数据按钮点击事件 |
| | | $("#addOffDismeettingRow").on("click", function () { |
| | | var newRowData = { |
| | | id: 9999999, // 假设ID是一个时间戳 |
| | | dec: "", |
| | | time: new Date().Format("yyyy-MM-dd hh:mm:ss"), |
| | | }; |
| | | var allData = table.cache["id-EditmeettingOffdisTab"]; |
| | | allData.push(newRowData); |
| | | table.reload("id-EditmeettingOffdisTab", { |
| | | data: allData, |
| | | }); |
| | | }); |
| | | |
| | | // 为工具栏绑定事件 |
| | | table.on("tool(id-EditmeettingOffdisTab)", function (obj) { |
| | | var data = obj.data; // 获得当前行数据 |
| | | var dataIndex = obj.tr.data("index"); // 获取行索引(这里使用了numbers类型的列,它会自动赋予每行一个索引) |
| | | if (obj.event === "del") { |
| | | // 判断是否为删除事件 |
| | | layer.confirm( |
| | | "确定要删除这条记录吗?", |
| | | { icon: 3, title: "提示" }, |
| | | function (index) { |
| | | var allData = table.cache["id-EditmeettingOffdisTab"]; |
| | | // 在本地数据中移除该行数据 |
| | | allData.splice(dataIndex, 1); |
| | | |
| | | // 重新加载表格数据 |
| | | table.reload("id-EditmeettingOffdisTab", { data: allData }); |
| | | |
| | | layer.msg("删除成功"); |
| | | layer.close(index); // 关闭确认对话框 |
| | | } |
| | | ); |
| | | } |
| | | }); |
| | | |
| | | table.render({ |
| | | elem: "#id-EditoffdisOderTab", |
| | | // url: '/static/json/2/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口 |
| | | data: d.params.data.oders, |
| | | page: false, |
| | | cols: [ |
| | | [ |
| | | { type: "numbers", title: "序号" }, |
| | | { |
| | | field: "time", |
| | | title: "下单时间", |
| | | |
| | | |
| | | width: 150, |
| | | }, |
| | | // { field: "goodsName", title: "货物名称", edit: "text" }, // 设置编辑类型为文本框 |
| | | { field: "actualPayment", title: "金额(元)" }, // 设置编辑类型为文本框 |
| | | |
| | | ], |
| | | ], |
| | | // initSort: { |
| | | // // 设置初始排序 |
| | | // field: "time", // 字段名 |
| | | // type: "desc", // 倒序 |
| | | // }, |
| | | height: 200, |
| | | done: function (res, curr, count) { |
| | | var options = this; |
| | | // 获取当前行数据 |
| | | table.getRowData = function (tableId, elem) { |
| | | var index = $(elem).closest("tr").data("index"); |
| | | return table.cache[tableId][index] || {}; |
| | | }; |
| | | laydate.render({ |
| | | elem: ".Meetinglaydate-demo", |
| | | type: "datetime", |
| | | trigger: "click", |
| | | fullPanel: true, |
| | | done: function (value, date, endDate) { |
| | | var data = table.getRowData(options.id, this.elem); // 获取当前行数据(如 id 等字段,以作为数据修改的索引) |
| | | // 更新数据中对应的字段 |
| | | data.time = value; |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
| | | |
| | | // 监听添加数据按钮点击事件 |
| | | $("#addintentionsRow").on("click", function () { |
| | | var newRowData = { |
| | | id: 9999999, // 假设ID是一个时间戳 |
| | | actualPayment: 0, |
| | | |
| | | time: new Date().Format("yyyy-MM-dd hh:mm:ss"), |
| | | }; |
| | | var allData = table.cache["id-EditoffdisOderTab"]; |
| | | allData.push(newRowData); |
| | | table.reload("id-EditoffdisOderTab", { |
| | | data: allData, |
| | | }); |
| | | }); |
| | | |
| | | |
| | | // 为工具栏绑定事件 |
| | | table.on("tool(id-EditoffdisOderTab)", function (obj) { |
| | | var data = obj.data; // 获得当前行数据 |
| | | var dataIndex = obj.tr.data("index"); // 获取行索引(这里使用了numbers类型的列,它会自动赋予每行一个索引) |
| | | if (obj.event === "del") { |
| | | // 判断是否为删除事件 |
| | | layer.confirm( |
| | | "确定要删除这条记录吗?", |
| | | { icon: 3, title: "提示" }, |
| | | function (index) { |
| | | var allData = table.cache["id-EditoffdisOderTab"]; |
| | | // 在本地数据中移除该行数据 |
| | | allData.splice(dataIndex, 1); |
| | | |
| | | // 重新加载表格数据 |
| | | table.reload("id-EditoffdisOderTab", { data: allData }); |
| | | |
| | | layer.msg("删除成功"); |
| | | layer.close(index); // 关闭确认对话框 |
| | | } |
| | | ); |
| | | } |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: "#editTime-OfflineDistributor-CollectionTime", |
| | | type: "datetime", |
| | | fullPanel: true, |
| | | }); |
| | | laydate.render({ |
| | | elem: "#editTime-OfflineDistributor-createTime", |
| | | type: "datetime", |
| | | fullPanel: true, |
| | | }); |
| | | laydate.render({ |
| | | elem: "#editTime-OfflineDistributor-upDataTime", |
| | | type: "datetime", |
| | | fullPanel: true, |
| | | }); |
| | | form.verify({}); |
| | | //重载form |
| | | form.render(null, "LAY-app-OfflineDistributor-editForm"); |
| | | } |
| | | ); |
| | | }; |
| | | </script> |
| | | |
New file |
| | |
| | | <script type="text/html" template lay-done="layui.data.sendParams(d);"> |
| | | <div |
| | | class="layui-form coreshop-form layui-form-pane" |
| | | lay-filter="LAY-app-OfflineDistributor-editForm" |
| | | id="LAY-app-OfflineDistributor-editForm" |
| | | > |
| | | <div class="layui-form-item"> |
| | | <div class="layui-input-block" hidden> |
| | | <input |
| | | type="number" |
| | | min="0" |
| | | max="999999" |
| | | name="id" |
| | | lay-verType="tips" |
| | | lay-verify="required|number" |
| | | class="layui-input" |
| | | value="{{d.params.data.id || '' }}" |
| | | placeholder="请输入主键ID" |
| | | lay-reqText="请输入主键ID并为数字" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label |
| | | for="collectionTime" |
| | | class="layui-form-label layui-form-required" |
| | | >信息收集时间</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="collectionTime" |
| | | id="editTime-OfflineDistributor-CollectionTime" |
| | | type="text" |
| | | lay-verType="tips" |
| | | lay-verify="required|datetime" |
| | | class="layui-input" |
| | | placeholder="请输入信息收集时间" |
| | | lay-reqText="请输入信息收集时间" |
| | | value="{{d.params.data.collectionTime || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label for="pUserID" class="layui-form-label ">推荐人</label> |
| | | <div class="layui-input-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select lay-search="" name="pUserID" id="EditOfflinedisSelUserID"> |
| | | <option value="">请选择或搜索(设置区分大小写)</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="Region" class="layui-form-label ">区域信息</label> |
| | | <div class="layui-input-block layui-inline-4 address-class"> |
| | | <input |
| | | name="editOfflinedisRegion" |
| | | id="editOfflinedisRegion" |
| | | type="hidden" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="Adder" class="layui-form-label ">详细地址</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="adder" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入详细地址" |
| | | lay-reqText="请输入详细地址" |
| | | value="{{d.params.data.adder || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="category" class="layui-form-label ">类别</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="category" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入类别" |
| | | lay-reqText="请输入类别" |
| | | id="editCatgory" |
| | | value="{{d.params.data.category || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="School" class="layui-form-label ">学校名称</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="school" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入学校名称" |
| | | lay-reqText="请输入学校名称" |
| | | value="{{d.params.data.school || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label for="DealerName" class="layui-form-label layui-form-required" |
| | | >经销商名称</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="dealerName" |
| | | lay-verType="tips" |
| | | lay-verify="required" |
| | | class="layui-input" |
| | | placeholder="请输入经销商名称" |
| | | lay-reqText="请输入经销商名称" |
| | | value="{{d.params.data.dealerName || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="ContactPerson" class="layui-form-label " |
| | | >联系人姓名</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="contactPerson" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入联系人姓名" |
| | | lay-reqText="请输入联系人姓名" |
| | | value="{{d.params.data.contactPerson || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="PhoneNumber" class="layui-form-label ">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="phoneNumber" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入联系电话" |
| | | lay-reqText="请输入联系电话" |
| | | value="{{d.params.data.phoneNumber || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label |
| | | for="cooperationIntent" |
| | | class="layui-form-label layui-form-required " |
| | | >合作意向</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="cooperationIntent" |
| | | id="EditCooperationIntent" |
| | | lay-verify="required" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入合作意向描述" |
| | | lay-reqText="请输入合作意向描述" |
| | | value="{{d.params.data.cooperationIntent || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label for="businessManager" class="layui-form-label " |
| | | >业务经理</label |
| | | > |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="businessManager" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入业务经理姓名" |
| | | lay-reqText="请输入业务经理姓名" |
| | | value="{{d.params.data.businessManager || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="StoreLogoUrl" class="layui-form-label ">店招</label> |
| | | <div class="layui-input-inline" style="width: 300px;"> |
| | | <input |
| | | name="storeLogoUrl" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入店招图片地址" |
| | | lay-reqText="请输入店招图片地址" |
| | | value="{{d.params.data.storeLogoUrl || '' }}" |
| | | /> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn" id="upBtnOriginalEdit"> |
| | | 上传图像 |
| | | </button> |
| | | <div class="layui-input-inline"> |
| | | <img |
| | | class="layui-upload-img" |
| | | id="viewImgBoxEdit" |
| | | src="{{ d.params.data.storeLogoUrl || layui.setter.noImagePicUrl ||''}}" |
| | | /> |
| | | <div class="layui-input-inline"> |
| | | <div id="viewTextBoxEdit"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label for="Remake" class="layui-form-label ">备注</label> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="Remake" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入备注" |
| | | lay-reqText="请输入备注" |
| | | value="{{d.params.data.remake || '' }}" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-xs6"> |
| | | <fieldset |
| | | style="color: rgb(80, 75, 9); border-color: bisque;" |
| | | class="layui-elem-field layui-field-title" |
| | | > |
| | | <legend>洽谈记录</legend> |
| | | </fieldset> |
| | | <table |
| | | class="layui-hide" |
| | | id="id-EditmeettingOffdisTab" |
| | | lay-filter="id-EditmeettingOffdisTab" |
| | | ></table> |
| | | <!-- 添加数据按钮 --> |
| | | |
| | | <button class="layui-btn" id="addOffDismeettingRow"> |
| | | 添加洽谈记录 |
| | | </button> |
| | | </div> |
| | | <div class="layui-col-xs6"> |
| | | <fieldset |
| | | style="color: rgb(68, 59, 11);border-color: bisque;" |
| | | class="layui-elem-field layui-field-title" |
| | | > |
| | | <legend>合作记录</legend> |
| | | </fieldset> |
| | | <table |
| | | class="layui-hide" |
| | | id="id-EditoffdisOderTab" |
| | | lay-filter="id-EditoffdisOderTab" |
| | | ></table> |
| | | |
| | | <button class="layui-btn" id="addintentionsRow"> |
| | | 添加合作记录 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item text-right core-hidden"> |
| | | <input |
| | | type="button" |
| | | class="layui-btn" |
| | | lay-submit |
| | | lay-filter="LAY-app-OfflineDistributor-editForm-submit" |
| | | id="LAY-app-OfflineDistributor-editForm-submit" |
| | | value="确认编辑" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | <script type="text/html" id="LAY-app-bloggersInfo-EdittableintentionsBox-bar"> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del"> |
| | | 删除 |
| | | </button> |
| | | </script> |
| | | <script type="text/html" id="TPL-laydate-Meetingdemo"> |
| | | <input |
| | | class="layui-input Meetinglaydate-demo" |
| | | placeholder="选择日期" |
| | | value="{{= d.time || '' }}" |
| | | tyle="height: 25px;" |
| | | lay-verType="tips" |
| | | lay-verify="required" |
| | | /> |
| | | </script> |
| | | <script> |
| | | var debug = layui.setter.debug; |
| | | layui.data.sendParams = function (d) { |
| | | //开启调试情况下获取接口赋值数据 |
| | | if (debug) { |
| | | console.log(d.params.data); |
| | | } |
| | | layui.use( |
| | | [ |
| | | "admin", |
| | | "form", |
| | | "laydate", |
| | | "upload", |
| | | "coreHelper", |
| | | "cropperImg", |
| | | "dropdown", |
| | | "table", |
| | | ], |
| | | function () { |
| | | var $ = layui.$, |
| | | form = layui.form, |
| | | admin = layui.admin, |
| | | laydate = layui.laydate, |
| | | upload = layui.upload, |
| | | cropperImg = layui.cropperImg, |
| | | dropdown = layui.dropdown, |
| | | table = layui.table, |
| | | coreHelper = layui.coreHelper; |
| | | |
| | | formatAreaInPut( |
| | | coreHelper, |
| | | "editOfflinedisRegion", |
| | | d.params.data.region |
| | | ); |
| | | formatUserSelInPut( |
| | | coreHelper, |
| | | form, |
| | | "EditOfflinedisSelUserID", |
| | | d.params.data.pUserID || "" |
| | | ); |
| | | //普通图片上传 |
| | | upload.render({ |
| | | elem: "#upBtnOriginalEdit", |
| | | url: layui.setter.apiUrl + "Api/Tools/UploadFiles", |
| | | before: function (obj) { |
| | | obj.preview(function (index, file, result) { |
| | | $("#viewImgBoxEdit").attr("src", result); |
| | | }); |
| | | }, |
| | | done: function (res) { |
| | | if (res.code > 0) { |
| | | return layer.msg("上传失败"); |
| | | } |
| | | layer.msg("上传成功"); |
| | | $("#upBtnOriginalEdit").val(res.data.fileUrl); |
| | | }, |
| | | error: function () { |
| | | var viewTextBox = $("#viewTextBoxEdit"); |
| | | viewTextBox.html( |
| | | '<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>' |
| | | ); |
| | | viewTextBox.find(".demo-reload").on("click", function () { |
| | | uploadInst.upload(); |
| | | }); |
| | | }, |
| | | }); |
| | | dropdown.render({ |
| | | elem: "#EditCooperationIntent", |
| | | data: [ |
| | | { |
| | | title: "大", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "小", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "不确定", |
| | | id: 103, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | dropdown.render({ |
| | | elem: "#editCatgory", |
| | | data: [ |
| | | { |
| | | title: "文具店", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "广告店", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "小卖部", |
| | | id: 103, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | |
| | | table.render({ |
| | | elem: "#id-EditmeettingOffdisTab", |
| | | // url: '/static/json/2/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口 |
| | | data: d.params.data.meetings, |
| | | page: false, |
| | | cols: [ |
| | | [ |
| | | { type: "numbers", title: "序号" }, |
| | | { |
| | | field: "time", |
| | | title: "洽谈时间", |
| | | |
| | | templet: "#TPL-laydate-Meetingdemo", |
| | | width: 150, |
| | | }, |
| | | { field: "dec", title: "洽谈内容", edit: "text" }, // 设置编辑类型为文本框 |
| | | { |
| | | width: 100, |
| | | align: "center", |
| | | title: "操作", |
| | | fixed: "right", |
| | | toolbar: "#LAY-app-bloggersInfo-EdittableintentionsBox-bar", |
| | | }, |
| | | ], |
| | | ], |
| | | // initSort: { |
| | | // // 设置初始排序 |
| | | // field: "time", // 字段名 |
| | | // type: "desc", // 倒序 |
| | | // }, |
| | | height: 150, |
| | | done: function (res, curr, count) { |
| | | var options = this; |
| | | // 获取当前行数据 |
| | | table.getRowData = function (tableId, elem) { |
| | | var index = $(elem).closest("tr").data("index"); |
| | | return table.cache[tableId][index] || {}; |
| | | }; |
| | | laydate.render({ |
| | | elem: ".Meetinglaydate-demo", |
| | | type: "datetime", |
| | | trigger: "click", |
| | | fullPanel: true, |
| | | done: function (value, date, endDate) { |
| | | var data = table.getRowData(options.id, this.elem); // 获取当前行数据(如 id 等字段,以作为数据修改的索引) |
| | | // 更新数据中对应的字段 |
| | | data.time = value; |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
| | | |
| | | // 监听添加数据按钮点击事件 |
| | | $("#addOffDismeettingRow").on("click", function () { |
| | | var newRowData = { |
| | | id: 9999999, // 假设ID是一个时间戳 |
| | | dec: "", |
| | | time: new Date().Format("yyyy-MM-dd hh:mm:ss"), |
| | | }; |
| | | var allData = table.cache["id-EditmeettingOffdisTab"]; |
| | | allData.push(newRowData); |
| | | table.reload("id-EditmeettingOffdisTab", { |
| | | data: allData, |
| | | }); |
| | | }); |
| | | |
| | | // 为工具栏绑定事件 |
| | | table.on("tool(id-EditmeettingOffdisTab)", function (obj) { |
| | | var data = obj.data; // 获得当前行数据 |
| | | var dataIndex = obj.tr.data("index"); // 获取行索引(这里使用了numbers类型的列,它会自动赋予每行一个索引) |
| | | if (obj.event === "del") { |
| | | // 判断是否为删除事件 |
| | | layer.confirm( |
| | | "确定要删除这条记录吗?", |
| | | { icon: 3, title: "提示" }, |
| | | function (index) { |
| | | var allData = table.cache["id-EditmeettingOffdisTab"]; |
| | | // 在本地数据中移除该行数据 |
| | | allData.splice(dataIndex, 1); |
| | | |
| | | // 重新加载表格数据 |
| | | table.reload("id-EditmeettingOffdisTab", { data: allData }); |
| | | |
| | | layer.msg("删除成功"); |
| | | layer.close(index); // 关闭确认对话框 |
| | | } |
| | | ); |
| | | } |
| | | }); |
| | | |
| | | table.render({ |
| | | elem: "#id-EditoffdisOderTab", |
| | | // url: '/static/json/2/table/user.json', // 此处为静态模拟数据,实际使用时需换成真实接口 |
| | | data: d.params.data.oders, |
| | | page: false, |
| | | cols: [ |
| | | [ |
| | | { type: "numbers", title: "序号" }, |
| | | { |
| | | field: "time", |
| | | title: "下单时间", |
| | | |
| | | templet: "#TPL-laydate-Meetingdemo", |
| | | width: 150, |
| | | }, |
| | | // { field: "goodsName", title: "货物名称", edit: "text" }, // 设置编辑类型为文本框 |
| | | { field: "actualPayment", title: "金额", edit: "number" }, // 设置编辑类型为文本框 |
| | | { |
| | | width: 100, |
| | | align: "center", |
| | | title: "操作", |
| | | fixed: "right", |
| | | toolbar: "#LAY-app-bloggersInfo-EdittableintentionsBox-bar", |
| | | }, |
| | | ], |
| | | ], |
| | | // initSort: { |
| | | // // 设置初始排序 |
| | | // field: "time", // 字段名 |
| | | // type: "desc", // 倒序 |
| | | // }, |
| | | height: 150, |
| | | done: function (res, curr, count) { |
| | | var options = this; |
| | | // 获取当前行数据 |
| | | table.getRowData = function (tableId, elem) { |
| | | var index = $(elem).closest("tr").data("index"); |
| | | return table.cache[tableId][index] || {}; |
| | | }; |
| | | laydate.render({ |
| | | elem: ".Meetinglaydate-demo", |
| | | type: "datetime", |
| | | trigger: "click", |
| | | fullPanel: true, |
| | | done: function (value, date, endDate) { |
| | | var data = table.getRowData(options.id, this.elem); // 获取当前行数据(如 id 等字段,以作为数据修改的索引) |
| | | // 更新数据中对应的字段 |
| | | data.time = value; |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
| | | |
| | | // 监听添加数据按钮点击事件 |
| | | $("#addintentionsRow").on("click", function () { |
| | | var newRowData = { |
| | | id: 9999999, // 假设ID是一个时间戳 |
| | | actualPayment: 0, |
| | | |
| | | time: new Date().Format("yyyy-MM-dd hh:mm:ss"), |
| | | }; |
| | | var allData = table.cache["id-EditoffdisOderTab"]; |
| | | allData.push(newRowData); |
| | | table.reload("id-EditoffdisOderTab", { |
| | | data: allData, |
| | | }); |
| | | }); |
| | | |
| | | |
| | | // 为工具栏绑定事件 |
| | | table.on("tool(id-EditoffdisOderTab)", function (obj) { |
| | | var data = obj.data; // 获得当前行数据 |
| | | var dataIndex = obj.tr.data("index"); // 获取行索引(这里使用了numbers类型的列,它会自动赋予每行一个索引) |
| | | if (obj.event === "del") { |
| | | // 判断是否为删除事件 |
| | | layer.confirm( |
| | | "确定要删除这条记录吗?", |
| | | { icon: 3, title: "提示" }, |
| | | function (index) { |
| | | var allData = table.cache["id-EditoffdisOderTab"]; |
| | | // 在本地数据中移除该行数据 |
| | | allData.splice(dataIndex, 1); |
| | | |
| | | // 重新加载表格数据 |
| | | table.reload("id-EditoffdisOderTab", { data: allData }); |
| | | |
| | | layer.msg("删除成功"); |
| | | layer.close(index); // 关闭确认对话框 |
| | | } |
| | | ); |
| | | } |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: "#editTime-OfflineDistributor-CollectionTime", |
| | | type: "datetime", |
| | | fullPanel: true, |
| | | }); |
| | | laydate.render({ |
| | | elem: "#editTime-OfflineDistributor-createTime", |
| | | type: "datetime", |
| | | fullPanel: true, |
| | | }); |
| | | laydate.render({ |
| | | elem: "#editTime-OfflineDistributor-upDataTime", |
| | | type: "datetime", |
| | | fullPanel: true, |
| | | }); |
| | | form.verify({}); |
| | | //重载form |
| | | form.render(null, "LAY-app-OfflineDistributor-editForm"); |
| | | } |
| | | ); |
| | | }; |
| | | </script> |
New file |
| | |
| | | <title>线下经销商采集</title> |
| | | <!--当前位置开始--> |
| | | <div class="layui-card layadmin-header"> |
| | | <div class="layui-breadcrumb" lay-filter="breadcrumb"> |
| | | <script |
| | | type="text/html" |
| | | template |
| | | lay-done="layui.data.updateMainBreadcrumb();" |
| | | ></script> |
| | | </div> |
| | | </div> |
| | | <!--当前位置结束--> |
| | | <style> |
| | | /* 重写样式 */ |
| | | </style> |
| | | <script |
| | | type="text/html" |
| | | template |
| | | lay-type="Post" |
| | | lay-url="Api/OfflineDistributor/GetIndex" |
| | | lay-done="layui.data.done(d);" |
| | | ></script> |
| | | <div class="table-body"> |
| | | <table |
| | | id="LAY-app-OfflineDistributor-tableBox" |
| | | lay-filter="LAY-app-OfflineDistributor-tableBox" |
| | | ></table> |
| | | </div> |
| | | |
| | | <script type="text/html" id="LAY-app-OfflineDistributor-toolbar"> |
| | | <div class="layui-form coreshop-toolbar-search-form"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="Category">类别</label> |
| | | <div class="layui-input-inline"> |
| | | <input |
| | | type="text" |
| | | name="category" |
| | | placeholder="请输入类别" |
| | | class="layui-input" |
| | | id="searchCatgory" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="CollectionTime" |
| | | >信息收集时间</label |
| | | > |
| | | <div class="layui-input-inline" style="width: 260px;"> |
| | | <input |
| | | type="text" |
| | | name="collectionTime" |
| | | id="searchTime-OfflineDistributor-CollectionTime" |
| | | placeholder="请输入信息收集时间" |
| | | class="layui-input" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline areaCode"> |
| | | <label class="layui-form-label " for="Region">区域信息</label> |
| | | <div class="layui-input-inline" style="width: 300px;"> |
| | | <input type="text" name="SesRegion" hidden /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="Adder">详细地址</label> |
| | | <div class="layui-input-inline"> |
| | | <input |
| | | type="text" |
| | | name="adder" |
| | | placeholder="请输入详细地址" |
| | | class="layui-input" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="school">学校名称</label> |
| | | <div class="layui-input-inline"> |
| | | <input |
| | | type="text" |
| | | name="school" |
| | | placeholder="请输入学校名称" |
| | | class="layui-input" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="DealerName">经销商名称</label> |
| | | <div class="layui-input-inline"> |
| | | <input |
| | | type="text" |
| | | name="dealerName" |
| | | placeholder="请输入经销商名称" |
| | | class="layui-input" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="CooperationIntent">合作意向</label> |
| | | <div class="layui-input-inline"> |
| | | <input |
| | | name="cooperationIntent" |
| | | class="layui-input" |
| | | placeholder="请输入合作意向" |
| | | lay-reqText="请输入合作意向" |
| | | id="SeCooperationIntent" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <button |
| | | class="layui-btn layui-btn-sm" |
| | | lay-submit |
| | | lay-filter="LAY-app-OfflineDistributor-search" |
| | | > |
| | | <i class="layui-icon layui-icon-search"></i>筛选 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="LAY-app-OfflineDistributor-pagebar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" lay-event="addData"> |
| | | <i class="layui-icon layui-icon-add-1"></i>添加数据 |
| | | </button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="batchDelete"> |
| | | <i class="layui-icon layui-icon-delete"></i>批量删除 |
| | | </button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="selectExportExcel"> |
| | | <i class="layui-icon layui-icon-add-circle"></i>选择导出 |
| | | </button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="queryExportExcel"> |
| | | <i class="layui-icon layui-icon-download-circle"></i>查询导出 |
| | | </button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="LAY-app-OfflineDistributor-tableBox-bar"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail" |
| | | >查看</a |
| | | > |
| | | <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> |
| | | <a |
| | | class="layui-btn layui-btn-danger layui-btn-xs" |
| | | data-dropdown="#OfflineDistributorTbDelDrop{{d.LAY_INDEX}}" |
| | | no-shade="true" |
| | | >删除</a |
| | | > |
| | | <div |
| | | class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" |
| | | id="OfflineDistributorTbDelDrop{{d.LAY_INDEX}}" |
| | | style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;" |
| | | > |
| | | <div class="dropdown-anchor"></div> |
| | | <div class="dropdown-popconfirm-title"> |
| | | <i class="layui-icon layui-icon-help"></i> |
| | | 确定要删除吗? |
| | | </div> |
| | | <div class="dropdown-popconfirm-btn"> |
| | | <a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a> |
| | | <a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <script> |
| | | var indexData; |
| | | var debug = layui.setter.debug; |
| | | layui.data.done = function (d) { |
| | | //开启调试情况下获取接口赋值数据 |
| | | if (debug) { |
| | | console.log(d); |
| | | } |
| | | |
| | | indexData = d.data; |
| | | layui.use( |
| | | [ |
| | | "index", |
| | | "table", |
| | | "laydate", |
| | | "util", |
| | | "coredropdown", |
| | | "coreHelper", |
| | | "dropdown", |
| | | ], |
| | | function () { |
| | | var $ = layui.$, |
| | | admin = layui.admin, |
| | | table = layui.table, |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | setter = layui.setter, |
| | | coreHelper = layui.coreHelper, |
| | | util = layui.util, |
| | | dropdown = layui.dropdown, |
| | | view = layui.view; |
| | | |
| | | var searchwhere; |
| | | formatAreaInPut(coreHelper, "SesRegion"); |
| | | |
| | | //监听搜索 |
| | | form.on("submit(LAY-app-OfflineDistributor-search)", function (data) { |
| | | var field = data.field; |
| | | field.region = GetAreaCodeFormFileid(field, "SesRegion"); |
| | | searchwhere = field; |
| | | //执行重载 |
| | | table.reloadData("LAY-app-OfflineDistributor-tableBox", { |
| | | where: field, |
| | | }); |
| | | }); |
| | | //数据绑定 |
| | | table.render({ |
| | | elem: "#LAY-app-OfflineDistributor-tableBox", |
| | | url: layui.setter.apiUrl + "Api/OfflineDistributor/GetPageList", |
| | | method: "POST", |
| | | toolbar: "#LAY-app-OfflineDistributor-toolbar", |
| | | pagebar: "#LAY-app-OfflineDistributor-pagebar", |
| | | className: "pagebarbox", |
| | | defaultToolbar: ["filter", "print", "exports"], |
| | | height: "full-127", //面包屑142px,搜索框4行172,3行137,2行102,1行67 |
| | | page: true, |
| | | limit: 30, |
| | | limits: [10, 15, 20, 25, 30, 50, 100, 200], |
| | | text: { none: "暂无相关数据" }, |
| | | cols: [ |
| | | [ |
| | | { type: "checkbox", fixed: "left" }, |
| | | { type: "numbers", title: "序号" }, |
| | | { |
| | | field: "collectionTime", |
| | | title: "信息收集时间", |
| | | width: 130, |
| | | sort: false, |
| | | }, |
| | | { field: "category", title: "类别", sort: false, width: 105 }, |
| | | { |
| | | field: "areaCodeName", |
| | | title: "区域", |
| | | sort: false, |
| | | width: 200, |
| | | }, |
| | | { field: "adder", title: "详细地址", sort: false, width: 200 }, |
| | | { |
| | | field: "cooperationIntent", |
| | | title: "合作意向", |
| | | sort: false, |
| | | width: 105, |
| | | }, |
| | | { field: "school", title: "学校名称", sort: false, width: 105 }, |
| | | { field: "dealerName", title: "经销商名称", sort: false ,width: 105}, |
| | | { |
| | | field: "contactPerson", |
| | | title: "联系人姓名", |
| | | sort: false, |
| | | width: 105, |
| | | }, |
| | | { |
| | | field: "phoneNumber", |
| | | title: "联系电话", |
| | | sort: false, |
| | | width: 105, |
| | | }, |
| | | |
| | | { |
| | | field: "businessManager", |
| | | title: "业务经理", |
| | | sort: false, |
| | | width: 105, |
| | | }, |
| | | { |
| | | field: "meetingCount", |
| | | title: "洽谈记录", |
| | | sort: false, |
| | | width: 105, |
| | | templet: "#OffdismeetingCountTmp", |
| | | }, |
| | | { |
| | | field: "money", |
| | | title: "订货记录", |
| | | sort: false, |
| | | width: 105, |
| | | templet: "#OffdismoneyTmp", |
| | | }, |
| | | { field: "remake", title: "备注", sort: false, width: 105 }, |
| | | |
| | | { |
| | | width: 162, |
| | | align: "center", |
| | | title: "操作", |
| | | fixed: "right", |
| | | toolbar: "#LAY-app-OfflineDistributor-tableBox-bar", |
| | | }, |
| | | ], |
| | | ], |
| | | }); |
| | | //监听排序事件 |
| | | table.on("sort(LAY-app-OfflineDistributor-tableBox)", function (obj) { |
| | | table.reloadData("LAY-app-OfflineDistributor-tableBox", { |
| | | initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。 |
| | | where: { |
| | | //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式) |
| | | orderField: obj.field, //排序字段 |
| | | orderDirection: obj.type, //排序方式 |
| | | }, |
| | | }); |
| | | }); |
| | | //监听行双击事件 |
| | | table.on( |
| | | "rowDouble(LAY-app-OfflineDistributor-tableBox)", |
| | | function (obj) { |
| | | //查看详情 |
| | | doDetails(obj); |
| | | } |
| | | ); |
| | | //头工具栏事件 |
| | | table.on( |
| | | "pagebar(LAY-app-OfflineDistributor-tableBox)", |
| | | function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch (obj.event) { |
| | | case "addData": |
| | | doCreate(); |
| | | break; |
| | | case "batchDelete": |
| | | doBatchDelete(checkStatus); |
| | | break; |
| | | case "selectExportExcel": |
| | | doSelectExportExcel(checkStatus); |
| | | break; |
| | | case "queryExportExcel": |
| | | doQueryExportexcel(); |
| | | break; |
| | | } |
| | | } |
| | | ); |
| | | dropdown.render({ |
| | | elem: "#SeCooperationIntent", |
| | | data: [ |
| | | { |
| | | title: "大", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "小", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "不确定", |
| | | id: 103, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | |
| | | dropdown.render({ |
| | | elem: "#searchCatgory", |
| | | data: [ |
| | | { |
| | | title: "文具店", |
| | | id: 101, |
| | | }, |
| | | { |
| | | title: "广告店", |
| | | id: 102, |
| | | }, |
| | | { |
| | | title: "小卖部", |
| | | id: 103, |
| | | }, |
| | | ], |
| | | click: function (obj) { |
| | | this.elem.val(obj.title); |
| | | }, |
| | | style: "min-width: 235px;", |
| | | }); |
| | | //监听工具条 |
| | | table.on("tool(LAY-app-OfflineDistributor-tableBox)", function (obj) { |
| | | if (obj.event === "detail") { |
| | | doDetails(obj); |
| | | } else if (obj.event === "del") { |
| | | doDelete(obj); |
| | | } else if (obj.event === "edit") { |
| | | doEdit(obj); |
| | | } |
| | | }); |
| | | //执行创建操作 |
| | | function doCreate() { |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/GetCreate", |
| | | null, |
| | | function (e) { |
| | | if (e.code === 0) { |
| | | admin.popup({ |
| | | shadeClose: false, |
| | | title: "创建数据", |
| | | area: ["1200px", "90%"], |
| | | id: "LAY-popup-OfflineDistributor-create", |
| | | success: function (layero, index) { |
| | | view(this.id) |
| | | .render("baifenbingfa/OfflineDistributor/create", { |
| | | data: e.data, |
| | | }) |
| | | .done(function () { |
| | | //监听提交 |
| | | form.on( |
| | | "submit(LAY-app-OfflineDistributor-createForm-submit)", |
| | | function (data) { |
| | | var field = data.field; //获取提交的字段 |
| | | |
| | | field.isdelete = field.isdelete == "on"; |
| | | field.region = GetAreaCodeFormFileid( |
| | | field, |
| | | "CreatofflinedisRegion" |
| | | ); |
| | | |
| | | if (debug) { |
| | | console.log(field); |
| | | } //开启调试返回数据 |
| | | //提交 Ajax 成功后,关闭当前弹层并重载表格 |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/DoCreate", |
| | | field, |
| | | function (e) { |
| | | console.log(e); |
| | | if (e.code === 0) { |
| | | layui.table.reloadData( |
| | | "LAY-app-OfflineDistributor-tableBox" |
| | | ); //重载表格 |
| | | layer.close(index); //再执行关闭 |
| | | layer.msg(e.msg); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | ); |
| | | }); |
| | | // 禁止弹窗出现滚动条 |
| | | $(layero) |
| | | .children(".layui-layer-content") |
| | | .css("overflow", "visible"); |
| | | }, |
| | | btn: ["确定", "取消"], |
| | | yes: function (index, layero) { |
| | | layero |
| | | .contents() |
| | | .find("#LAY-app-OfflineDistributor-createForm-submit") |
| | | .click(); |
| | | }, |
| | | }); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | //执行编辑操作 |
| | | function doEdit(obj) { |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/GetEdit", |
| | | { id: obj.data.id }, |
| | | function (e) { |
| | | if (e.code === 0) { |
| | | |
| | | admin.popup({ |
| | | shadeClose: false, |
| | | title: "编辑数据", |
| | | area: ["1200px", "90%"], |
| | | id: "LAY-popup-OfflineDistributor-edit", |
| | | success: function (layero, index) { |
| | | view(this.id) |
| | | .render("baifenbingfa/OfflineDistributor/edit", { |
| | | data: e.data, |
| | | }) |
| | | .done(function () { |
| | | //监听提交 |
| | | form.on( |
| | | "submit(LAY-app-OfflineDistributor-editForm-submit)", |
| | | function (data) { |
| | | var field = data.field; //获取提交的字段 |
| | | |
| | | field.isdelete = field.isdelete == "on"; |
| | | field.region = GetAreaCodeFormFileid( |
| | | field, |
| | | "editOfflinedisRegion" |
| | | ); |
| | | |
| | | field.meetings = |
| | | table.cache["id-EditmeettingOffdisTab"]; |
| | | field.Oders = table.cache["id-EditoffdisOderTab"]; |
| | | if (debug) { |
| | | console.log(field); |
| | | } //开启调试返回数据 |
| | | //提交 Ajax 成功后,关闭当前弹层并重载表格 |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/DoEdit", |
| | | field, |
| | | function (e) { |
| | | console.log(e); |
| | | if (e.code === 0) { |
| | | layui.table.reloadData( |
| | | "LAY-app-OfflineDistributor-tableBox" |
| | | ); //重载表格 |
| | | layer.close(index); //再执行关闭 |
| | | layer.msg(e.msg); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | ); |
| | | }); |
| | | // 禁止弹窗出现滚动条 |
| | | $(layero) |
| | | .children(".layui-layer-content") |
| | | .css("overflow", "visible"); |
| | | }, |
| | | btn: ["确定", "取消"], |
| | | yes: function (index, layero) { |
| | | layero |
| | | .contents() |
| | | .find("#LAY-app-OfflineDistributor-editForm-submit") |
| | | .click(); |
| | | }, |
| | | }); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | //执行预览操作 |
| | | function doDetails(obj) { |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/GetDetails", |
| | | { id: obj.data.id }, |
| | | function (e) { |
| | | if (e.code === 0) { |
| | | admin.popup({ |
| | | shadeClose: false, |
| | | title: "查看详情", |
| | | area: ["1200px", "90%"], |
| | | id: "LAY-popup-OfflineDistributor-details", |
| | | success: function (layero, index) { |
| | | view(this.id) |
| | | .render("baifenbingfa/OfflineDistributor/details", { |
| | | data: e.data, |
| | | }) |
| | | .done(function () { |
| | | form.render(); |
| | | }); |
| | | // 禁止弹窗出现滚动条 |
| | | $(layero) |
| | | .children(".layui-layer-content") |
| | | .css("overflow", "visible"); |
| | | }, |
| | | }); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | //执行单个删除 |
| | | function doDelete(obj) { |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/DoDelete", |
| | | { id: obj.data.id }, |
| | | function (e) { |
| | | if (debug) { |
| | | console.log(e); |
| | | } //开启调试返回数据 |
| | | table.reloadData("LAY-app-OfflineDistributor-tableBox"); |
| | | layer.msg(e.msg); |
| | | } |
| | | ); |
| | | } |
| | | //执行批量删除 |
| | | function doBatchDelete(checkStatus) { |
| | | var checkData = checkStatus.data; |
| | | if (checkData.length === 0) { |
| | | return layer.msg("请选择要删除的数据"); |
| | | } |
| | | layer.confirm("确定删除吗?删除后将无法恢复。", function (index) { |
| | | var delidsStr = []; |
| | | layui.each(checkData, function (index, item) { |
| | | delidsStr.push(item.id); |
| | | }); |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/DoBatchDelete", |
| | | { id: delidsStr }, |
| | | function (e) { |
| | | if (debug) { |
| | | console.log(e); |
| | | } //开启调试返回数据 |
| | | table.reloadData("LAY-app-OfflineDistributor-tableBox"); |
| | | layer.msg(e.msg); |
| | | } |
| | | ); |
| | | }); |
| | | } |
| | | //执行查询条件导出excel |
| | | function doQueryExportexcel() { |
| | | layer.confirm("确定根据当前的查询条件导出数据吗?", function (index) { |
| | | var field = searchwhere; |
| | | coreHelper.PostForm( |
| | | "Api/OfflineDistributor/QueryExportExcel", |
| | | field, |
| | | function (e) { |
| | | if (debug) { |
| | | console.log(e); |
| | | } //开启调试返回数据 |
| | | if (e.code === 0) { |
| | | window.open(e.data); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | } |
| | | ); |
| | | }); |
| | | } |
| | | //执行选择目录导出数据 |
| | | function doSelectExportExcel(checkStatus) { |
| | | var checkData = checkStatus.data; |
| | | if (checkData.length === 0) { |
| | | return layer.msg("请选择您要导出的数据"); |
| | | } |
| | | layer.confirm("确定导出选择的内容吗?", function (index) { |
| | | var delidsStr = []; |
| | | layui.each(checkData, function (index, item) { |
| | | delidsStr.push(item.id); |
| | | }); |
| | | layer.close(index); |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/SelectExportExcel", |
| | | { id: delidsStr }, |
| | | function (e) { |
| | | if (debug) { |
| | | console.log(e); |
| | | } //开启调试返回数据 |
| | | if (e.code === 0) { |
| | | window.open(e.data); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | } |
| | | ); |
| | | }); |
| | | } |
| | | |
| | | laydate.render({ |
| | | elem: "#searchTime-OfflineDistributor-CollectionTime", |
| | | type: "datetime", |
| | | range: "到", |
| | | }); |
| | | laydate.render({ |
| | | elem: "#searchTime-OfflineDistributor-createTime", |
| | | type: "datetime", |
| | | range: "到", |
| | | }); |
| | | laydate.render({ |
| | | elem: "#searchTime-OfflineDistributor-upDataTime", |
| | | type: "datetime", |
| | | range: "到", |
| | | }); |
| | | |
| | | //监听 表格复选框操作 |
| | | |
| | | layui.form.on("switch(switch_isdelete)", function (obj) { |
| | | coreHelper.Post( |
| | | "Api/OfflineDistributor/DoSetisdelete", |
| | | { id: this.value, data: obj.elem.checked }, |
| | | function (e) { |
| | | if (debug) { |
| | | console.log(e); |
| | | } //开启调试返回数据 |
| | | //table.reloadData('LAY-app-OfflineDistributor-tableBox'); |
| | | layer.msg(e.msg); |
| | | } |
| | | ); |
| | | }); |
| | | |
| | | //重载form |
| | | form.render(); |
| | | } |
| | | ); |
| | | }; |
| | | </script> |
| | | |
| | | <!--设置删除标志--> |
| | | <script type="text/html" id="switch_isdelete"> |
| | | <input type="checkbox" name="switch_isdelete" value="{{d.id}}" |
| | | lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isdelete" {{ |
| | | d.isdelete ? 'checked' : '' }}> |
| | | </script> |
| | | |
| | | <script src="/views/liao.js"></script> |
| | | <style> |
| | | .areaCode .select-address { |
| | | padding: 5px !important ; |
| | | width: 30%; |
| | | } |
| | | </style> |
| | | |
| | | |
| | | <!--洽谈记录--> |
| | | <script type="text/html" id="nicknameTmp"> |
| | | <a lay-event="edit" style="color: blue;">{{d.nickname}}</a> |
| | | |
| | | <!-- <input type="checkbox" name="switch_isdelete" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isdelete" {{ d.isdelete ? 'checked' : '' }}> --> |
| | | </script> |
| | |
| | | field: "nickname", |
| | | title: "网名", |
| | | sort: false, |
| | | templet: "#nickname", |
| | | templet: "#nicknameTmp", |
| | | width: 105, |
| | | }, |
| | | { |
| | |
| | | </script> |
| | | |
| | | <!--洽谈记录--> |
| | | <script type="text/html" id="nickname"> |
| | | <script type="text/html" id="nicknameTmp"> |
| | | <a lay-event="edit" style="color: blue;">{{d.nickname}}</a> |
| | | |
| | | <!-- <input type="checkbox" name="switch_isdelete" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isdelete" {{ d.isdelete ? 'checked' : '' }}> --> |
| | |
| | | * @Author: 小飞侠 |
| | | * @Date: 2024-03-01 09:11:24 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2024-03-21 09:47:04 |
| | | * @LastEditTime: 2024-04-01 12:39:54 |
| | | * Copyright: 2024 MinTinge CO.,LTD. All Rights Reserved. |
| | | * @Descripttion: 写入你的描述 |
| | | */ |
| | |
| | | * @LastEditTime: Do not Edit |
| | | */ |
| | | function filterTreeWithjQuery(tree, predicate) { |
| | | var results = []; |
| | | var results = []; |
| | | |
| | | function traverse(node) { |
| | | if (predicate(node)) { |
| | | results.push(node); |
| | | function traverse(node) { |
| | | if (predicate(node)) { |
| | | results.push(node); |
| | | } |
| | | if (node.children && Array.isArray(node.children)) { |
| | | $.each(node.children, traverse); |
| | | } |
| | | } |
| | | if (node.children && Array.isArray(node.children)) { |
| | | $.each(node.children, traverse); |
| | | } |
| | | } |
| | | |
| | | $.each(tree, traverse); |
| | | $.each(tree, traverse); |
| | | |
| | | return results; |
| | | return results; |
| | | } |
| | | /** |
| | | * @description: 判断一个字符串是不是数字字符串 |
| | |
| | | * @LastEditTime: Do not Edit |
| | | */ |
| | | function isNumericString(str) { |
| | | const regex = /^-?\d+(\.\d+)?$/; // 匹配整数或小数,包括负数 |
| | | return regex.test(str); |
| | | const regex = /^-?\d+(\.\d+)?$/; // 匹配整数或小数,包括负数 |
| | | return regex.test(str); |
| | | } |
| | | |
| | | |
| | |
| | | * 当使用了formatAreaInPut 后 可使用此函数获取一个由地址id组成的areaId 字符串,用,号分割 |
| | | * @param {Object} field -表单。 |
| | | */ |
| | | function GetAreaCodeFormFileid(field,idname) { |
| | | let areaCode=""; |
| | | if (isNumericString(field[`${idname}_1`])) { |
| | | areaCode+=`${field[`${idname}_1`]}`; |
| | | if (isNumericString(field[`${idname}_2`])) |
| | | areaCode+=`,${field[`${idname}_2`]}`; |
| | | if (isNumericString(field[`${idname}_3`])) |
| | | areaCode+=`,${field[`${idname}_3`]}`; |
| | | } else { |
| | | |
| | | } |
| | | return areaCode; |
| | | function GetAreaCodeFormFileid(field, idname) { |
| | | let areaCode = ""; |
| | | if (isNumericString(field[`${idname}_1`])) { |
| | | areaCode += `${field[`${idname}_1`]}`; |
| | | if (isNumericString(field[`${idname}_2`])) |
| | | areaCode += `,${field[`${idname}_2`]}`; |
| | | if (isNumericString(field[`${idname}_3`])) |
| | | areaCode += `,${field[`${idname}_3`]}`; |
| | | } else { |
| | | |
| | | } |
| | | return areaCode; |
| | | } |
| | | |
| | | /** |
| | |
| | | * 会生成几个areaId-1,areaId-3,areaId-3 |
| | | * @param {Object} coreHelper - 核心辅助对象,用于执行HTTP请求等操作。 |
| | | */ |
| | | function formatAreaInPut(coreHelper,idname,areaid="") { |
| | | let area=0; |
| | | if(areaid!=="") |
| | | area= areaid.split(",").reverse()[0]; |
| | | |
| | | coreHelper.Post("Api/Tools/GetAreaCheckedList", { id: Number(area) }, function (data) { |
| | | if (debug) { console.log(data); } //开启调试返回数据 |
| | | var str = ""; |
| | | $.each(data, function (i, n) { |
| | | str += `<select lay-ignore name='${idname}_` + (i + 1) + "' dep='" + (i + 1) + "' class='select-address'>"; |
| | | str += "<option value='' >请选择</option>"; |
| | | $.each(n.list, function (h, z) { |
| | | if (n.hasOwnProperty('info') && n.info?.id == z.id) { |
| | | str += "<option value='" + z.id + "' selected='selected'>" + z.name + "</option>"; |
| | | } else { |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | function formatAreaInPut(coreHelper, idname, areaid = "") { |
| | | let area = 0; |
| | | if ((areaid !== "")&&(areaid!==null) &&(areaid!==0)) |
| | | area = areaid.split(",").reverse()[0]; |
| | | |
| | | coreHelper.Post("Api/Tools/GetAreaCheckedList", { id: Number(area) }, function (data) { |
| | | if (debug) { console.log(data); } //开启调试返回数据 |
| | | var str = ""; |
| | | $.each(data, function (i, n) { |
| | | str += `<select lay-ignore name='${idname}_` + (i + 1) + "' dep='" + (i + 1) + "' class='select-address'>"; |
| | | str += "<option value='' >请选择</option>"; |
| | | $.each(n.list, function (h, z) { |
| | | if (n.hasOwnProperty('info') && n.info?.id == z.id) { |
| | | str += "<option value='" + z.id + "' selected='selected'>" + z.name + "</option>"; |
| | | } else { |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | } |
| | | }); |
| | | str += "</select>"; |
| | | }); |
| | | $(`input[name='${idname}']`).after(str); |
| | | //以上数据输出完,以下绑定事件 |
| | | $.each(data, function (i, n) { |
| | | if (i < (data.length)) { |
| | | $(`select[name='${idname}_` + (i + 1) + "']").change(function () { |
| | | changeareaIdArea(i + 1, data.length, idname); |
| | | }); |
| | | } |
| | | }); |
| | | str += "</select>"; |
| | | }); |
| | | $(`input[name='${idname}']`).after(str); |
| | | //以上数据输出完,以下绑定事件 |
| | | $.each(data, function (i, n) { |
| | | if (i < (data.length)) { |
| | | $(`select[name='${idname}_` + (i + 1) + "']").change(function () { |
| | | changeareaIdArea(i + 1, data.length,idname); |
| | | }); |
| | | function changeareaIdArea(i, max_i, idname) { |
| | | //清除后面节点 |
| | | for (var x = i + 1; x <= 6; x++) { //最多6层,足够了 |
| | | $(`select[name='${idname}_` + x + "']").remove(); |
| | | } |
| | | }); |
| | | }); |
| | | function changeareaIdArea(i, max_i,idname) { |
| | | //清除后面节点 |
| | | for (var x = i + 1; x <= 6; x++) { //最多6层,足够了 |
| | | $(`select[name='${idname}_` + x + "']").remove(); |
| | | } |
| | | var val = $(`select[name='${idname}_` + i + "']").val(); |
| | | if (val != "") { |
| | | //取子节点数据,然后显示下一级 |
| | | coreHelper.Post("Api/Tools/GetAreaChildren", { id: val }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | var val = $(`select[name='${idname}_` + i + "']").val(); |
| | | if (val != "") { |
| | | //取子节点数据,然后显示下一级 |
| | | coreHelper.Post("Api/Tools/GetAreaChildren", { id: val }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | |
| | | if (e.length > 0) { |
| | | var str = ""; |
| | | str += `<select lay-ignore name='${idname}_` + (i + 1) + "' dep='" + (i + 1) + "' class='select-address'>"; |
| | | str += "<option value='' >请选择</option>"; |
| | | $.each(e, function (h, z) { |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | }); |
| | | str += "</select>"; |
| | | $(`select[name='${idname}_` + i + "']").after(str); |
| | | //以上数据输出完,以下绑定事件 |
| | | $(`select[name='${idname}_` + (i+1) + "']").change(function () { |
| | | changeareaIdArea(i + 1, i + 2,idname); |
| | | }); |
| | | if (e.length > 0) { |
| | | var str = ""; |
| | | str += `<select lay-ignore name='${idname}_` + (i + 1) + "' dep='" + (i + 1) + "' class='select-address'>"; |
| | | str += "<option value='' >请选择</option>"; |
| | | $.each(e, function (h, z) { |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | }); |
| | | str += "</select>"; |
| | | $(`select[name='${idname}_` + i + "']").after(str); |
| | | //以上数据输出完,以下绑定事件 |
| | | $(`select[name='${idname}_` + (i + 1) + "']").change(function () { |
| | | changeareaIdArea(i + 1, i + 2, idname); |
| | | }); |
| | | |
| | | //如果有返回值,就说明省市区没有选择到最终节点 |
| | | if (1 == 1) { |
| | | $(`input[name='${idname}']`).val(""); |
| | | //如果有返回值,就说明省市区没有选择到最终节点 |
| | | if (1 == 1) { |
| | | $(`input[name='${idname}']`).val(""); |
| | | } else { |
| | | $(`input[name='${idname}']`).val($(`select[name='${idname}_` + i + "']").val()); |
| | | } |
| | | } else { |
| | | $(`input[name='${idname}']`).val($(`select[name='${idname}_` + i + "']").val()); |
| | | } |
| | | } else { |
| | | $(`input[name='${idname}']`).val($(`select[name='${idname}_` + i + "']").val()); |
| | | } |
| | | }); |
| | | } else { |
| | | if (1 == 1) { |
| | | $(`input[name='${idname}']`).val(""); |
| | | }); |
| | | } else { |
| | | //第一级的元素就直接赋值为空就是了 |
| | | if (i == 1) { |
| | | if (1 == 1) { |
| | | $(`input[name='${idname}']`).val(""); |
| | | } else { |
| | | i--; |
| | | $(`input[name='${idname}']`).val($(`select[name='${idname}` + i + "']").val()); |
| | | } |
| | | //第一级的元素就直接赋值为空就是了 |
| | | if (i == 1) { |
| | | $(`input[name='${idname}']`).val(""); |
| | | } else { |
| | | i--; |
| | | $(`input[name='${idname}']`).val($(`select[name='${idname}` + i + "']").val()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 根据用户选择,格式化并更新 select 输入元素中的选项。 |
| | | * @param {object} coreHelper 核心辅助对象,用于执行 post 请求等操作。 |
| | | * @param {object} form 表单对象,用于重新渲染 select 元素。 |
| | | * @param {string} idname select 元素的 id 名称。 |
| | | */ |
| | | |
| | | function formatUserSelInPut(coreHelper, form, idname,selectedID="") { |
| | | |
| | | // 向服务器发送请求,获取用户列表 |
| | | coreHelper.PostForm("Api/CommonAPI/GetUserList", { sKey: "" }, function (data) { |
| | | if (debug) { console.log(data); } // 如果处于调试模式,打印返回的数据 |
| | | |
| | | if (data.code == 0) { |
| | | // 获取指定 id 的 select 元素 |
| | | var selectElement = document.getElementById(idname); |
| | | |
| | | // 遍历返回的用户数据,为 select 元素创建并添加新的 option 选项 |
| | | for (var i = 0; i < data.data.length; i++) { |
| | | var option = document.createElement('option'); |
| | | option.value = data.data[i].id; |
| | | if(selectedID==data.data[i].id){ |
| | | option.selected=true; |
| | | } |
| | | option.innerHTML = data.data[i].name; |
| | | selectElement.appendChild(option); |
| | | } |
| | | |
| | | // 重新渲染 select 元素,确保新的选项生效 |
| | | form.render('select'); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | Date.prototype.Format = function (fmt) { |
| | | //author: meizz |
| | | var o = { |
| | | "M+": this.getMonth() + 1, //月份 |
| | | "d+": this.getDate(), //日 |
| | | "h+": this.getHours(), //小时 |
| | | "m+": this.getMinutes(), //分 |
| | | "s+": this.getSeconds(), //秒 |
| | | "q+": Math.floor((this.getMonth() + 3) / 3), //季度 |
| | | }; |
| | | if (/(y+)/.test(fmt)) |
| | | fmt = fmt.replace( |
| | | RegExp.$1, |
| | | (this.getFullYear() + "").substr(4 - RegExp.$1.length) |
| | | ); |
| | | for (var k in o) |
| | | if (new RegExp("(" + k + ")").test(fmt)) |
| | | fmt = fmt.replace( |
| | | RegExp.$1, |
| | | RegExp.$1.length == 1 |
| | | ? o[k] |
| | | : ("00" + o[k]).substr(("" + o[k]).length) |
| | | ); |
| | | return fmt; |
| | | }; |
| | |
| | | <div class="col-lg-5 d-flex align-items-md-baseline py-5 background--light vh-md-100 overflow-auto"> |
| | | <div class="w-75 mt-3 mt-md-5 mx-auto overflow-hidden px-md-5 px-lg-3"> |
| | | <header class="mb-5"> |
| | | <img src='/static/images/common/logo.png' style="height: 80px; object-fit: contain;"> |
| | | <img src='/static/images/common/logo.png' style="height: 80px;width:100%; object-fit: contain;"> |
| | | </header> |
| | | <main class="main"> |
| | | <div class="form-validate layui-form"> |
| | |
| | | } |
| | | } |
| | | }, |
| | | { field: 'isBaifenPromotion', title: '推广人员', width: 120, templet: '#switch_IsBaifenPromotion', sort: false, unresize: true }, |
| | | //{ field: 'isDelete', title: '删除标志', width: 105, templet: '#switch_isDelete', sort: false, unresize: true }, |
| | | { width: 282, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsUser-tableBox-bar' } |
| | | ] |
| | |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | layui.form.on('switch(switch_IsBaifenPromotion)', function (obj) { |
| | | coreHelper.Post("Api/CoreCmsUser/DoSetIsBaiFenBingfaP", { id: this.value, data: obj.elem.checked }, function (e) { |
| | | |
| | | layer.msg(e.msg); |
| | | }); |
| | | }); |
| | | //监听 表格复选框操作 |
| | | |
| | | layui.form.on('switch(switch_isDelete)', function (obj) { |
| | |
| | | <!--设置删除标志 有数据就是删除--> |
| | | <script type="text/html" id="switch_isDelete"> |
| | | <input type="checkbox" name="switch_isDelete" value="{{d.id}}" lay-skin="switch" lay-text="已删除|正常" lay-filter="switch_isDelete" {{ d.isDelete ? 'checked' : '' }}> |
| | | </script> |
| | | |
| | | <!--设置是否热门--> |
| | | <script type="text/html" id="switch_IsBaifenPromotion"> |
| | | <input type="checkbox" name="switch_IsBaifenPromotion" value="{{d.id}}" lay-skin="switch" lay-text="是|否" lay-filter="switch_IsBaifenPromotion" {{ d.isBaifenPromotion? 'checked' : '' }}> |
| | | </script> |
New file |
| | |
| | | using CoreCms.Net.Auth.HttpContextUser; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.IServices; |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor; |
| | | using System.Collections.Generic; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.Model.FromBody; |
| | | using CoreCms.Net.Services; |
| | | using System.ComponentModel; |
| | | |
| | | namespace CoreCms.Net.Web.WebApi.Controllers |
| | | { |
| | | /// <summary> |
| | | /// 百分兵法线上 |
| | | /// </summary> |
| | | [Route("api/[controller]/[action]")] |
| | | [ApiController] |
| | | public class OfflineDistributorController : ControllerBase |
| | | { |
| | | private readonly IWebHostEnvironment _webHostEnvironment; |
| | | private readonly IOfflineDistributorServices _OfflineDistributorServices; |
| | | private readonly ICoreCmsAreaServices _coreCmsAreaServices; |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | | ///</summary> |
| | | public OfflineDistributorController(IWebHostEnvironment webHostEnvironment |
| | | , IOfflineDistributorServices OfflineDistributorServices |
| | | , ICoreCmsAreaServices CoreCmsAreaServices |
| | | , IUnitOfWork unitOfWork |
| | | ) |
| | | { |
| | | _webHostEnvironment = webHostEnvironment; |
| | | _OfflineDistributorServices = OfflineDistributorServices; |
| | | _coreCmsAreaServices = CoreCmsAreaServices; |
| | | _unitOfWork = unitOfWork; |
| | | } |
| | | |
| | | |
| | | [HttpPost] |
| | | [Description("输入供应商")] |
| | | |
| | | public async Task<WebApiCallBack> addOfflineDistributor([FromBody] addOfflineDistributorIn param) |
| | | { |
| | | var item = new OfflineDistributor |
| | | { |
| | | Adder = param.Adder, |
| | | BusinessManager = param.BusinessManager, |
| | | Category = param.Category, |
| | | CollectionTime = param.time, |
| | | ContactPerson = param.ContactPerson, |
| | | CooperationIntent = param.CooperationIntent, |
| | | DealerName = param.DistributorName, |
| | | PhoneNumber = param.PhoneNumber, |
| | | School=param.School, |
| | | |
| | | meetings = new List<OfflineDistributorMeeting>() |
| | | { |
| | | new OfflineDistributorMeeting |
| | | { |
| | | createBy="用户采集", |
| | | createTime= param.time, |
| | | time=param.time, |
| | | Dec= param.NegotiationNotes, |
| | | |
| | | } |
| | | }, |
| | | PUserID = param.UserID, |
| | | Region = param.RegionCode, |
| | | Remake = param.Remake, |
| | | StoreLogoUrl = param.StoreImage, |
| | | |
| | | |
| | | }; |
| | | var jm = new WebApiCallBack(); |
| | | var ret = await _OfflineDistributorServices.UserInsertAsync(item); |
| | | jm.code = ret.code; |
| | | jm.status = true; |
| | | jm.msg = ret.msg; |
| | | jm.data = ret.data; |
| | | return jm; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 采集输入 |
| | | /// </summary> |
| | | public class addOfflineDistributorIn |
| | | { |
| | | public int UserID { get; set; } |
| | | /// <summary> |
| | | /// 采集时间 |
| | | /// </summary> |
| | | public DateTime time { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 区域 |
| | | /// </summary> |
| | | public string RegionCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 地址 |
| | | /// </summary> |
| | | public string Adder { get; set; } |
| | | /// <summary> |
| | | /// 学校 |
| | | /// </summary> |
| | | public string School { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 类别 |
| | | /// </summary> |
| | | public string Category { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商名称 |
| | | /// </summary> |
| | | public string DistributorName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 联系人 |
| | | /// </summary> |
| | | public string ContactPerson { get; set; } |
| | | /// <summary> |
| | | /// 联系电话 |
| | | /// </summary> |
| | | public string PhoneNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 店招图片 |
| | | /// </summary> |
| | | public string StoreImage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 合作意向 |
| | | /// </summary> |
| | | public string CooperationIntent { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 洽谈记录 |
| | | /// </summary> |
| | | public string NegotiationNotes { get; set; } |
| | | /// <summary> |
| | | /// 业务经理 |
| | | /// </summary> |
| | | public string BusinessManager { get; set; } |
| | | public string Remake { get; set; } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | user.status, |
| | | user.parentId, |
| | | user.passWord, |
| | | user.IsBaifenPromotion, |
| | | gradeName = userGrade != null ? userGrade.title : "", |
| | | gradeKey= userGrade != null ? userGrade.valueKey:"", |
| | | userCouponCount, |
| | |
| | | </None> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Controllers\baifenbingfa\" /> |
| | | </ItemGroup> |
| | | |
| | | <ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions> |
| | | |
| | | |
| | |
| | | <PropertyGroup> |
| | | <ActiveDebugProfile>CoreCms.Net.Web.WebApi</ActiveDebugProfile> |
| | | <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> |
| | | <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> |
| | | <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | <param name="entity"></param> |
| | | <returns></returns> |
| | | </member> |
| | | <member name="T:CoreCms.Net.Web.WebApi.Controllers.OfflineDistributorController"> |
| | | <summary> |
| | | 百分兵法线上 |
| | | </summary> |
| | | </member> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.OfflineDistributorController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.IOfflineDistributorServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IRepository.UnitOfWork.IUnitOfWork)"> |
| | | <summary> |
| | | 构造函数 |
| | | </summary> |
| | | </member> |
| | | <member name="T:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn"> |
| | | <summary> |
| | | 采集输入 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.time"> |
| | | <summary> |
| | | 采集时间 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.RegionCode"> |
| | | <summary> |
| | | 区域 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.Adder"> |
| | | <summary> |
| | | 地址 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.School"> |
| | | <summary> |
| | | 学校 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.Category"> |
| | | <summary> |
| | | 类别 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.DistributorName"> |
| | | <summary> |
| | | 经销商名称 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.ContactPerson"> |
| | | <summary> |
| | | 联系人 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.PhoneNumber"> |
| | | <summary> |
| | | 联系电话 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.StoreImage"> |
| | | <summary> |
| | | 店招图片 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.CooperationIntent"> |
| | | <summary> |
| | | 合作意向 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.NegotiationNotes"> |
| | | <summary> |
| | | 洽谈记录 |
| | | </summary> |
| | | </member> |
| | | <member name="P:CoreCms.Net.Web.WebApi.Controllers.addOfflineDistributorIn.BusinessManager"> |
| | | <summary> |
| | | 业务经理 |
| | | </summary> |
| | | </member> |
| | | <member name="T:CoreCms.Net.Web.WebApi.Controllers.OrderController"> |
| | | <summary> |
| | | 订单调用接口数据 |