202507071753

This commit is contained in:
张潘 2025-07-07 17:54:04 +08:00
parent 1a8a62321a
commit 6b153719e3
17 changed files with 2630 additions and 2537 deletions

View File

@ -1,445 +0,0 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 服务内容对象 service_goods
*
* @author ruoyi
* @date 2025-05-13
*/
public class ServiceGoods extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 标题 */
@Excel(name = "标题")
private String title;
/** 图标 */
@Excel(name = "图标")
private String icon;
/** 轮播图 */
@Excel(name = "轮播图")
private String imgs;
/** 副标题 */
@Excel(name = "副标题")
private String subTitle;
/** 简介 */
@Excel(name = "简介")
private String info;
/** 价格 */
@Excel(name = "价格")
private BigDecimal price;
/** 列表价格显示 */
@Excel(name = "列表价格显示")
private String priceZn;
/** 销量 */
@Excel(name = "销量")
private Long sales;
/** 库存 */
@Excel(name = "库存")
private Long stock;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 详情 */
@Excel(name = "详情")
private String description;
/** 规格类型 1单规格 2多规格 */
@Excel(name = "规格类型 1单规格 2多规格")
private Integer skuType;
/** 规格 */
@Excel(name = "规格")
private String sku;
/** 经度 */
@Excel(name = "经度")
private String latitude;
/** 纬度 */
@Excel(name = "纬度")
private String longitude;
/** 1:服务 2商品 */
@Excel(name = "1:服务 2商品")
private Integer type;
/** 分类 */
@Excel(name = "分类")
private Long cateId;
/** 服务项目 */
@Excel(name = "服务项目")
private String project;
/** 排序 */
@Excel(name = "排序")
private Integer sort;
/** 物料费用 */
@Excel(name = "物料费用")
private String material;
/** 邮费 */
@Excel(name = "邮费")
private BigDecimal postage;
/** 基检现象 */
@Excel(name = "基检现象")
private String basic;
/** 保证金 */
@Excel(name = "保证金")
private BigDecimal margin;
/** 所需技能 */
@Excel(name = "所需技能")
private String skillIds;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date createdAt;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date updatedAt;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date deletedAt;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public String getIcon()
{
return icon;
}
public void setImgs(String imgs)
{
this.imgs = imgs;
}
public String getImgs()
{
return imgs;
}
public void setSubTitle(String subTitle)
{
this.subTitle = subTitle;
}
public String getSubTitle()
{
return subTitle;
}
public void setInfo(String info)
{
this.info = info;
}
public String getInfo()
{
return info;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}
public BigDecimal getPrice()
{
return price;
}
public void setPriceZn(String priceZn)
{
this.priceZn = priceZn;
}
public String getPriceZn()
{
return priceZn;
}
public void setSales(Long sales)
{
this.sales = sales;
}
public Long getSales()
{
return sales;
}
public void setStock(Long stock)
{
this.stock = stock;
}
public Long getStock()
{
return stock;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setSkuType(Integer skuType)
{
this.skuType = skuType;
}
public Integer getSkuType()
{
return skuType;
}
public void setSku(String sku)
{
this.sku = sku;
}
public String getSku()
{
return sku;
}
public void setLatitude(String latitude)
{
this.latitude = latitude;
}
public String getLatitude()
{
return latitude;
}
public void setLongitude(String longitude)
{
this.longitude = longitude;
}
public String getLongitude()
{
return longitude;
}
public void setType(Integer type)
{
this.type = type;
}
public Integer getType()
{
return type;
}
public void setCateId(Long cateId)
{
this.cateId = cateId;
}
public Long getCateId()
{
return cateId;
}
public void setProject(String project)
{
this.project = project;
}
public String getProject()
{
return project;
}
public void setSort(Integer sort)
{
this.sort = sort;
}
public Integer getSort()
{
return sort;
}
public void setMaterial(String material)
{
this.material = material;
}
public String getMaterial()
{
return material;
}
public void setPostage(BigDecimal postage)
{
this.postage = postage;
}
public BigDecimal getPostage()
{
return postage;
}
public void setBasic(String basic)
{
this.basic = basic;
}
public String getBasic()
{
return basic;
}
public void setMargin(BigDecimal margin)
{
this.margin = margin;
}
public BigDecimal getMargin()
{
return margin;
}
public void setSkillIds(String skillIds)
{
this.skillIds = skillIds;
}
public String getSkillIds()
{
return skillIds;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public void setDeletedAt(Date deletedAt)
{
this.deletedAt = deletedAt;
}
public Date getDeletedAt()
{
return deletedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("title", getTitle())
.append("icon", getIcon())
.append("imgs", getImgs())
.append("subTitle", getSubTitle())
.append("info", getInfo())
.append("price", getPrice())
.append("priceZn", getPriceZn())
.append("sales", getSales())
.append("stock", getStock())
.append("status", getStatus())
.append("description", getDescription())
.append("skuType", getSkuType())
.append("sku", getSku())
.append("latitude", getLatitude())
.append("longitude", getLongitude())
.append("type", getType())
.append("cateId", getCateId())
.append("project", getProject())
.append("sort", getSort())
.append("material", getMaterial())
.append("postage", getPostage())
.append("basic", getBasic())
.append("margin", getMargin())
.append("skillIds", getSkillIds())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.append("deletedAt", getDeletedAt())
.toString();
}
}

View File

@ -1,450 +0,0 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 服务内容对象 service_goods
*
* @author ruoyi
* @date 2025-05-13
*/
public class ServiceGoods extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 标题 */
@Excel(name = "标题")
private String title;
/** 图标 */
@Excel(name = "图标")
private String icon;
/** 轮播图 */
@Excel(name = "轮播图")
private String imgs;
/** 副标题 */
@Excel(name = "副标题")
private String subTitle;
/** 简介 */
@Excel(name = "简介")
private String info;
/** 价格 */
@Excel(name = "价格")
private BigDecimal price;
/** 列表价格显示 */
@Excel(name = "列表价格显示")
private String priceZn;
/** 销量 */
@Excel(name = "销量")
private Long sales;
/** 库存 */
@Excel(name = "库存")
private Long stock;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 详情 */
@Excel(name = "详情")
private String description;
/** 规格类型 1单规格 2多规格 */
@Excel(name = "规格类型 1单规格 2多规格")
private Integer skuType;
/** 规格 */
@Excel(name = "规格")
private String sku;
/** 经度 */
@Excel(name = "经度")
private String latitude;
/** 纬度 */
@Excel(name = "纬度")
private String longitude;
/** 1:服务 2商品 */
@Excel(name = "1:服务 2商品")
private Integer type;
/** 分类 */
@Excel(name = "分类")
private Long cateId;
/** 分类 */
@Excel(name = "分类名称")
private Long cateName;
/** 服务项目 */
@Excel(name = "服务项目")
private String project;
/** 排序 */
@Excel(name = "排序")
private Integer sort;
/** 物料费用 */
@Excel(name = "物料费用")
private String material;
/** 邮费 */
@Excel(name = "邮费")
private BigDecimal postage;
/** 基检现象 */
@Excel(name = "基检现象")
private String basic;
/** 保证金 */
@Excel(name = "保证金")
private BigDecimal margin;
/** 所需技能 */
@Excel(name = "所需技能")
private String skillIds;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date createdAt;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date updatedAt;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date deletedAt;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public String getIcon()
{
return icon;
}
public void setImgs(String imgs)
{
this.imgs = imgs;
}
public String getImgs()
{
return imgs;
}
public void setSubTitle(String subTitle)
{
this.subTitle = subTitle;
}
public String getSubTitle()
{
return subTitle;
}
public void setInfo(String info)
{
this.info = info;
}
public String getInfo()
{
return info;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}
public BigDecimal getPrice()
{
return price;
}
public void setPriceZn(String priceZn)
{
this.priceZn = priceZn;
}
public String getPriceZn()
{
return priceZn;
}
public void setSales(Long sales)
{
this.sales = sales;
}
public Long getSales()
{
return sales;
}
public void setStock(Long stock)
{
this.stock = stock;
}
public Long getStock()
{
return stock;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setSkuType(Integer skuType)
{
this.skuType = skuType;
}
public Integer getSkuType()
{
return skuType;
}
public void setSku(String sku)
{
this.sku = sku;
}
public String getSku()
{
return sku;
}
public void setLatitude(String latitude)
{
this.latitude = latitude;
}
public String getLatitude()
{
return latitude;
}
public void setLongitude(String longitude)
{
this.longitude = longitude;
}
public String getLongitude()
{
return longitude;
}
public void setType(Integer type)
{
this.type = type;
}
public Integer getType()
{
return type;
}
public void setCateId(Long cateId)
{
this.cateId = cateId;
}
public Long getCateId()
{
return cateId;
}
public void setProject(String project)
{
this.project = project;
}
public String getProject()
{
return project;
}
public void setSort(Integer sort)
{
this.sort = sort;
}
public Integer getSort()
{
return sort;
}
public void setMaterial(String material)
{
this.material = material;
}
public String getMaterial()
{
return material;
}
public void setPostage(BigDecimal postage)
{
this.postage = postage;
}
public BigDecimal getPostage()
{
return postage;
}
public void setBasic(String basic)
{
this.basic = basic;
}
public String getBasic()
{
return basic;
}
public void setMargin(BigDecimal margin)
{
this.margin = margin;
}
public BigDecimal getMargin()
{
return margin;
}
public void setSkillIds(String skillIds)
{
this.skillIds = skillIds;
}
public String getSkillIds()
{
return skillIds;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public void setDeletedAt(Date deletedAt)
{
this.deletedAt = deletedAt;
}
public Date getDeletedAt()
{
return deletedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("title", getTitle())
.append("icon", getIcon())
.append("imgs", getImgs())
.append("subTitle", getSubTitle())
.append("info", getInfo())
.append("price", getPrice())
.append("priceZn", getPriceZn())
.append("sales", getSales())
.append("stock", getStock())
.append("status", getStatus())
.append("description", getDescription())
.append("skuType", getSkuType())
.append("sku", getSku())
.append("latitude", getLatitude())
.append("longitude", getLongitude())
.append("type", getType())
.append("cateId", getCateId())
.append("project", getProject())
.append("sort", getSort())
.append("material", getMaterial())
.append("postage", getPostage())
.append("basic", getBasic())
.append("margin", getMargin())
.append("skillIds", getSkillIds())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.append("deletedAt", getDeletedAt())
.toString();
}
}

View File

@ -1,450 +0,0 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 服务内容对象 service_goods
*
* @author ruoyi
* @date 2025-05-13
*/
public class ServiceGoods extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 标题 */
@Excel(name = "标题")
private String title;
/** 图标 */
@Excel(name = "图标")
private String icon;
/** 轮播图 */
@Excel(name = "轮播图")
private String imgs;
/** 副标题 */
@Excel(name = "副标题")
private String subTitle;
/** 简介 */
@Excel(name = "简介")
private String info;
/** 价格 */
@Excel(name = "价格")
private BigDecimal price;
/** 列表价格显示 */
@Excel(name = "列表价格显示")
private String priceZn;
/** 销量 */
@Excel(name = "销量")
private Long sales;
/** 库存 */
@Excel(name = "库存")
private Long stock;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 详情 */
@Excel(name = "详情")
private String description;
/** 规格类型 1单规格 2多规格 */
@Excel(name = "规格类型 1单规格 2多规格")
private Integer skuType;
/** 规格 */
@Excel(name = "规格")
private String sku;
/** 经度 */
@Excel(name = "经度")
private String latitude;
/** 纬度 */
@Excel(name = "纬度")
private String longitude;
/** 1:服务 2商品 */
@Excel(name = "1:服务 2商品")
private Integer type;
/** 分类 */
@Excel(name = "分类")
private Long cateId;
/** 分类 */
@Excel(name = "分类名称")
private String cateName;
/** 服务项目 */
@Excel(name = "服务项目")
private String project;
/** 排序 */
@Excel(name = "排序")
private Integer sort;
/** 物料费用 */
@Excel(name = "物料费用")
private String material;
/** 邮费 */
@Excel(name = "邮费")
private BigDecimal postage;
/** 基检现象 */
@Excel(name = "基检现象")
private String basic;
/** 保证金 */
@Excel(name = "保证金")
private BigDecimal margin;
/** 所需技能 */
@Excel(name = "所需技能")
private String skillIds;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date createdAt;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date updatedAt;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date deletedAt;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public String getIcon()
{
return icon;
}
public void setImgs(String imgs)
{
this.imgs = imgs;
}
public String getImgs()
{
return imgs;
}
public void setSubTitle(String subTitle)
{
this.subTitle = subTitle;
}
public String getSubTitle()
{
return subTitle;
}
public void setInfo(String info)
{
this.info = info;
}
public String getInfo()
{
return info;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}
public BigDecimal getPrice()
{
return price;
}
public void setPriceZn(String priceZn)
{
this.priceZn = priceZn;
}
public String getPriceZn()
{
return priceZn;
}
public void setSales(Long sales)
{
this.sales = sales;
}
public Long getSales()
{
return sales;
}
public void setStock(Long stock)
{
this.stock = stock;
}
public Long getStock()
{
return stock;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setSkuType(Integer skuType)
{
this.skuType = skuType;
}
public Integer getSkuType()
{
return skuType;
}
public void setSku(String sku)
{
this.sku = sku;
}
public String getSku()
{
return sku;
}
public void setLatitude(String latitude)
{
this.latitude = latitude;
}
public String getLatitude()
{
return latitude;
}
public void setLongitude(String longitude)
{
this.longitude = longitude;
}
public String getLongitude()
{
return longitude;
}
public void setType(Integer type)
{
this.type = type;
}
public Integer getType()
{
return type;
}
public void setCateId(Long cateId)
{
this.cateId = cateId;
}
public Long getCateId()
{
return cateId;
}
public void setProject(String project)
{
this.project = project;
}
public String getProject()
{
return project;
}
public void setSort(Integer sort)
{
this.sort = sort;
}
public Integer getSort()
{
return sort;
}
public void setMaterial(String material)
{
this.material = material;
}
public String getMaterial()
{
return material;
}
public void setPostage(BigDecimal postage)
{
this.postage = postage;
}
public BigDecimal getPostage()
{
return postage;
}
public void setBasic(String basic)
{
this.basic = basic;
}
public String getBasic()
{
return basic;
}
public void setMargin(BigDecimal margin)
{
this.margin = margin;
}
public BigDecimal getMargin()
{
return margin;
}
public void setSkillIds(String skillIds)
{
this.skillIds = skillIds;
}
public String getSkillIds()
{
return skillIds;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public void setDeletedAt(Date deletedAt)
{
this.deletedAt = deletedAt;
}
public Date getDeletedAt()
{
return deletedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("title", getTitle())
.append("icon", getIcon())
.append("imgs", getImgs())
.append("subTitle", getSubTitle())
.append("info", getInfo())
.append("price", getPrice())
.append("priceZn", getPriceZn())
.append("sales", getSales())
.append("stock", getStock())
.append("status", getStatus())
.append("description", getDescription())
.append("skuType", getSkuType())
.append("sku", getSku())
.append("latitude", getLatitude())
.append("longitude", getLongitude())
.append("type", getType())
.append("cateId", getCateId())
.append("project", getProject())
.append("sort", getSort())
.append("material", getMaterial())
.append("postage", getPostage())
.append("basic", getBasic())
.append("margin", getMargin())
.append("skillIds", getSkillIds())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.append("deletedAt", getDeletedAt())
.toString();
}
}

View File

@ -1,453 +0,0 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 服务内容对象 service_goods
*
* @author ruoyi
* @date 2025-05-13
*/
public class ServiceGoods extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 标题 */
@Excel(name = "标题")
private String title;
/** 图标 */
@Excel(name = "图标")
private String icon;
/** 轮播图 */
@Excel(name = "轮播图")
private String imgs;
/** 副标题 */
@Excel(name = "副标题")
private String subTitle;
/** 简介 */
@Excel(name = "简介")
private String info;
/** 价格 */
@Excel(name = "价格")
private BigDecimal price;
/** 列表价格显示 */
@Excel(name = "列表价格显示")
private String priceZn;
/** 销量 */
@Excel(name = "销量")
private Long sales;
/** 库存 */
@Excel(name = "库存")
private Long stock;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 详情 */
@Excel(name = "详情")
private String description;
/** 规格类型 1单规格 2多规格 */
@Excel(name = "规格类型 1单规格 2多规格")
private Integer skuType;
/** 规格 */
@Excel(name = "规格")
private String sku;
/** 经度 */
@Excel(name = "经度")
private String latitude;
/** 纬度 */
@Excel(name = "纬度")
private String longitude;
/** 1:服务 2商品 */
@Excel(name = "1:服务 2商品")
private Integer type;
/** 分类 */
@Excel(name = "分类")
private Long cateId;
/** 分类 */
@Excel(name = "分类名称")
private String cateName;
/** 服务项目 */
@Excel(name = "服务项目")
private String project;
/** 排序 */
@Excel(name = "排序")
private Integer sort;
/** 物料费用 */
@Excel(name = "物料费用")
private String material;
/** 邮费 */
@Excel(name = "邮费")
private BigDecimal postage;
/** 基检现象 */
@Excel(name = "基检现象")
private String basic;
/** 保证金 */
@Excel(name = "保证金")
private BigDecimal margin;
/** 所需技能 */
@Excel(name = "所需技能")
private String skillIds;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date createdAt;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date updatedAt;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date deletedAt;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public String getIcon()
{
return icon;
}
public void setImgs(String imgs)
{
this.imgs = imgs;
}
public String getImgs()
{
return imgs;
}
public void setSubTitle(String subTitle)
{
this.subTitle = subTitle;
}
public String getSubTitle()
{
return subTitle;
}
public void setInfo(String info)
{
this.info = info;
}
public String getInfo()
{
return info;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}
public BigDecimal getPrice()
{
return price;
}
public void setPriceZn(String priceZn)
{
this.priceZn = priceZn;
}
public String getPriceZn()
{
return priceZn;
}
public void setSales(Long sales)
{
this.sales = sales;
}
public Long getSales()
{
return sales;
}
public void setStock(Long stock)
{
this.stock = stock;
}
public Long getStock()
{
return stock;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setSkuType(Integer skuType)
{
this.skuType = skuType;
}
public Integer getSkuType()
{
return skuType;
}
public void setSku(String sku)
{
this.sku = sku;
}
public String getSku()
{
return sku;
}
public void setLatitude(String latitude)
{
this.latitude = latitude;
}
public String getLatitude()
{
return latitude;
}
public void setLongitude(String longitude)
{
this.longitude = longitude;
}
public String getLongitude()
{
return longitude;
}
public void setType(Integer type)
{
this.type = type;
}
public Integer getType()
{
return type;
}
public void setCateId(Long cateId)
{
this.cateId = cateId;
}
public Long getCateId()
{
return cateId;
}
public void setProject(String project)
{
this.project = project;
}
public String getProject()
{
return project;
}
public void setSort(Integer sort)
{
this.sort = sort;
}
public Integer getSort()
{
return sort;
}
public void setMaterial(String material)
{
this.material = material;
}
public String getMaterial()
{
return material;
}
public void setPostage(BigDecimal postage)
{
this.postage = postage;
}
public BigDecimal getPostage()
{
return postage;
}
public void setBasic(String basic)
{
this.basic = basic;
}
public String getBasic()
{
return basic;
}
public void setMargin(BigDecimal margin)
{
this.margin = margin;
}
public BigDecimal getMargin()
{
return margin;
}
public void setSkillIds(String skillIds)
{
this.skillIds = skillIds;
}
public String getSkillIds()
{
return skillIds;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public void setDeletedAt(Date deletedAt)
{
this.deletedAt = deletedAt;
}
public Date getDeletedAt()
{
return deletedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("title", getTitle())
.append("icon", getIcon())
.append("imgs", getImgs())
.append("subTitle", getSubTitle())
.append("info", getInfo())
.append("price", getPrice())
.append("priceZn", getPriceZn())
.append("sales", getSales())
.append("stock", getStock())
.append("status", getStatus())
.append("description", getDescription())
.append("skuType", getSkuType())
.append("sku", getSku())
.append("latitude", getLatitude())
.append("longitude", getLongitude())
.append("type", getType())
.append("cateId", getCateId())
.append("project", getProject())
.append("sort", getSort())
.append("material", getMaterial())
.append("postage", getPostage())
.append("basic", getBasic())
.append("margin", getMargin())
.append("skillIds", getSkillIds())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.append("deletedAt", getDeletedAt())
.toString();
}
}

View File

@ -881,9 +881,9 @@ public class ApplePayController extends BaseController {
Map<String, Object> payResult = wechatPayUtil.createBatchOrderAndPay( Map<String, Object> payResult = wechatPayUtil.createBatchOrderAndPay(
user.getOpenid(), user.getOpenid(),
String.valueOf(order_id), String.valueOf(order_id),
new BigDecimal(0.01), new BigDecimal("0.01"),
1, 1,
wechatPayUtil.PAY_FH+"api/order/amount/pay/notify"); WechatPayUtil.PAY_FH +"api/order/amount/pay/notify");
if (payResult != null && Boolean.TRUE.equals(payResult.get("success"))) { if (payResult != null && Boolean.TRUE.equals(payResult.get("success"))) {
Map<String, Object> responseData = new HashMap<>(); Map<String, Object> responseData = new HashMap<>();
responseData.put("mainOrderId", order_id); responseData.put("mainOrderId", order_id);

View File

@ -2,8 +2,8 @@ package com.ruoyi.system.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import com.ruoyi.system.domain.QuoteMaterialType;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -24,7 +24,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* 服务分类Controller * 服务分类Controller二级分类管理
* *
* @author ruoyi * @author ruoyi
* @date 2025-05-13 * @date 2025-05-13
@ -41,11 +41,23 @@ public class ServiceCateController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:ServiceCate:list')") @PreAuthorize("@ss.hasPermi('system:ServiceCate:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(ServiceCate serviceCate) public TableDataInfo list(ServiceCate serviceCate, HttpServletRequest request)
{ {
startPage(); // 如果pageSize大于1000说明是要获取所有数据不分页
List<ServiceCate> list = serviceCateService.selectServiceCateList(serviceCate); String pageSizeStr = request.getParameter("pageSize");
return getDataTable(list); if (pageSizeStr != null && Integer.parseInt(pageSizeStr) > 1000) {
// 不分页查询
List<ServiceCate> list = serviceCateService.selectServiceCateList(serviceCate);
TableDataInfo dataTable = new TableDataInfo();
dataTable.setRows(list);
dataTable.setTotal(list.size());
return dataTable;
} else {
// 正常分页查询
startPage();
List<ServiceCate> list = serviceCateService.selectServiceCateList(serviceCate);
return getDataTable(list);
}
} }
/** /**
@ -79,6 +91,28 @@ public class ServiceCateController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ServiceCate serviceCate) public AjaxResult add(@RequestBody ServiceCate serviceCate)
{ {
// 验证分类级别只允许二级分类
if (serviceCate.getParentId() == null) {
serviceCate.setParentId(0L); // 一级分类
} else {
// 检查父级分类是否为一级分类
ServiceCate parent = serviceCateService.selectServiceCateById(serviceCate.getParentId());
if (parent == null) {
return error("父级分类不存在");
}
if (parent.getParentId() != 0L) {
return error("只支持二级分类,不能在二级分类下创建子分类");
}
}
// 设置默认值
if (serviceCate.getSort() == null) {
serviceCate.setSort(0L);
}
if (serviceCate.getBrowse() == null) {
serviceCate.setBrowse(0L);
}
return toAjax(serviceCateService.insertServiceCate(serviceCate)); return toAjax(serviceCateService.insertServiceCate(serviceCate));
} }
@ -90,28 +124,56 @@ public class ServiceCateController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody ServiceCate serviceCate) public AjaxResult edit(@RequestBody ServiceCate serviceCate)
{ {
// 不能将自己设为父级
if (serviceCate.getId() != null && serviceCate.getId().equals(serviceCate.getParentId())) {
return error("不能将自己设为父级分类");
}
// 如果修改了父级分类需要验证
if (serviceCate.getParentId() != null && serviceCate.getParentId() != 0L) {
ServiceCate parent = serviceCateService.selectServiceCateById(serviceCate.getParentId());
if (parent == null) {
return error("父级分类不存在");
}
if (parent.getParentId() != 0L) {
return error("只支持二级分类,不能设置三级分类");
}
}
return toAjax(serviceCateService.updateServiceCate(serviceCate)); return toAjax(serviceCateService.updateServiceCate(serviceCate));
} }
/** /**
* 定时任务状态修改 * 分类状态修改
*/ */
@PreAuthorize("@ss.hasPermi('system:ServiceCate:changeStatus')") @PreAuthorize("@ss.hasPermi('system:ServiceCate:changeStatus')")
@Log(title = "修改状态", businessType = BusinessType.UPDATE) @Log(title = "修改状态", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus") @PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody ServiceCate serviceCate) public AjaxResult changeStatus(@RequestBody ServiceCate serviceCate)
{ {
ServiceCate newserviceCate = serviceCateService.selectServiceCateById(serviceCate.getId()); ServiceCate newServiceCate = serviceCateService.selectServiceCateById(serviceCate.getId());
newserviceCate.setStatus(serviceCate.getStatus()); newServiceCate.setStatus(serviceCate.getStatus());
return toAjax(serviceCateService.updateServiceCate(newserviceCate)); return toAjax(serviceCateService.updateServiceCate(newServiceCate));
} }
/** /**
* 删除服务分类 * 删除服务分类
*/ */
@PreAuthorize("@ss.hasPermi('system:ServiceCate:remove')") @PreAuthorize("@ss.hasPermi('system:ServiceCate:remove')")
@Log(title = "服务分类", businessType = BusinessType.DELETE) @Log(title = "服务分类", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
// 检查是否有子分类
for (Long id : ids) {
ServiceCate childQuery = new ServiceCate();
childQuery.setParentId(id);
List<ServiceCate> children = serviceCateService.selectServiceCateList(childQuery);
if (children != null && children.size() > 0) {
ServiceCate parent = serviceCateService.selectServiceCateById(id);
return error("分类【" + parent.getTitle() + "】存在子分类,不能删除");
}
}
return toAjax(serviceCateService.deleteServiceCateByIds(ids)); return toAjax(serviceCateService.deleteServiceCateByIds(ids));
} }
} }

View File

@ -111,6 +111,9 @@ public class ServiceGoodsController extends BaseController {
// 验证和处理基检现象数据格式 // 验证和处理基检现象数据格式
validateAndProcessBasicField(serviceGoods); validateAndProcessBasicField(serviceGoods);
// 处理一级和二级分类ID
processCategoryIds(serviceGoods);
return toAjax(serviceGoodsService.insertServiceGoods(serviceGoods)); return toAjax(serviceGoodsService.insertServiceGoods(serviceGoods));
} }
@ -124,6 +127,9 @@ public class ServiceGoodsController extends BaseController {
// 验证和处理基检现象数据格式 // 验证和处理基检现象数据格式
validateAndProcessBasicField(serviceGoods); validateAndProcessBasicField(serviceGoods);
// 处理一级和二级分类ID
processCategoryIds(serviceGoods);
return toAjax(serviceGoodsService.updateServiceGoods(serviceGoods)); return toAjax(serviceGoodsService.updateServiceGoods(serviceGoods));
} }
@ -201,4 +207,44 @@ public class ServiceGoodsController extends BaseController {
} }
} }
} }
/**
* 处理一级和二级分类ID
* 根据选择的分类自动设置一级和二级分类ID
* 如果选择的是一级分类则一级分类ID记录二级分类ID设为0
* 如果选择的是二级分类则记录一级分类ID和二级分类ID
*/
private void processCategoryIds(ServiceGoods serviceGoods) {
Long cateId = serviceGoods.getCateId();
if (cateId != null && cateId > 0) {
try {
// 查询当前选择的分类信息
ServiceCate currentCate = serviceCateService.selectServiceCateById(cateId);
if (currentCate != null) {
// 判断是否为一级分类parentId为null或0
if (currentCate.getParentId() == null || currentCate.getParentId() == 0) {
// 选择的是一级分类
serviceGoods.setFirstCateId(cateId);
serviceGoods.setSecondCateId(0L);
} else {
// 选择的是二级分类
serviceGoods.setFirstCateId(currentCate.getParentId());
serviceGoods.setSecondCateId(cateId);
}
} else {
// 分类不存在设置为null
serviceGoods.setFirstCateId(null);
serviceGoods.setSecondCateId(null);
}
} catch (Exception e) {
// 异常情况下设置为null
serviceGoods.setFirstCateId(null);
serviceGoods.setSecondCateId(null);
}
} else {
// 没有选择分类
serviceGoods.setFirstCateId(null);
serviceGoods.setSecondCateId(null);
}
}
} }

View File

@ -1,6 +1,7 @@
package com.ruoyi.system.domain; package com.ruoyi.system.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -44,6 +45,13 @@ public class ServiceCate extends BaseEntity
@Excel(name = "类型1服务 2商城") @Excel(name = "类型1服务 2商城")
private Long type; private Long type;
/** 父级分类ID */
@Excel(name = "父级分类ID")
private Long parentId;
/** 子分类列表 */
private List<ServiceCate> children;
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date createdAt; private Date createdAt;
@ -126,6 +134,26 @@ public class ServiceCate extends BaseEntity
return type; return type;
} }
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
public Long getParentId()
{
return parentId;
}
public void setChildren(List<ServiceCate> children)
{
this.children = children;
}
public List<ServiceCate> getChildren()
{
return children;
}
public void setCreatedAt(Date createdAt) public void setCreatedAt(Date createdAt)
{ {
this.createdAt = createdAt; this.createdAt = createdAt;
@ -166,6 +194,7 @@ public class ServiceCate extends BaseEntity
.append("status", getStatus()) .append("status", getStatus())
.append("browse", getBrowse()) .append("browse", getBrowse())
.append("type", getType()) .append("type", getType())
.append("parentId", getParentId())
.append("createdAt", getCreatedAt()) .append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt()) .append("updatedAt", getUpdatedAt())
.append("deletedAt", getDeletedAt()) .append("deletedAt", getDeletedAt())

View File

@ -94,6 +94,14 @@ public class ServiceGoods extends BaseEntity
@Excel(name = "分类") @Excel(name = "分类")
private Long cateId; private Long cateId;
/** 一级分类ID */
@Excel(name = "一级分类ID")
private Long firstCateId;
/** 二级分类ID */
@Excel(name = "二级分类ID")
private Long secondCateId;
/** 分类 */ /** 分类 */
@Excel(name = "分类名称") @Excel(name = "分类名称")
private String cateName; private String cateName;
@ -377,6 +385,26 @@ private String cateName;
return cateId; return cateId;
} }
public void setFirstCateId(Long firstCateId)
{
this.firstCateId = firstCateId;
}
public Long getFirstCateId()
{
return firstCateId;
}
public void setSecondCateId(Long secondCateId)
{
this.secondCateId = secondCateId;
}
public Long getSecondCateId()
{
return secondCateId;
}
public void setProject(String project) public void setProject(String project)
{ {
this.project = project; this.project = project;

View File

@ -12,13 +12,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="status" column="status" /> <result property="status" column="status" />
<result property="browse" column="browse" /> <result property="browse" column="browse" />
<result property="type" column="type" /> <result property="type" column="type" />
<result property="parentId" column="parent_id" />
<result property="createdAt" column="created_at" /> <result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" /> <result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" /> <result property="deletedAt" column="deleted_at" />
</resultMap> </resultMap>
<sql id="selectServiceCateVo"> <sql id="selectServiceCateVo">
select id, title, icon, sort, status, browse, type, created_at, updated_at, deleted_at from service_cate select id, title, icon, sort, status, browse, type, parent_id, created_at, updated_at, deleted_at from service_cate
</sql> </sql>
<select id="selectServiceCateList" parameterType="ServiceCate" resultMap="ServiceCateResult"> <select id="selectServiceCateList" parameterType="ServiceCate" resultMap="ServiceCateResult">
@ -27,19 +28,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if> <if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if>
<if test="status != null and status != ''"> and status=#{status}</if> <if test="status != null and status != ''"> and status=#{status}</if>
<if test="type != null and type != ''"> and type=#{type}</if> <if test="type != null and type != ''"> and type=#{type}</if>
<if test="parentId != null"> and parent_id=#{parentId}</if>
</where> </where>
order by sort ASC order by parent_id ASC, sort ASC
</select> </select>
<select id="selectServiceCateCiKaList" resultMap="ServiceCateResult"> <select id="selectServiceCateCiKaList" resultMap="ServiceCateResult">
<include refid="selectServiceCateVo"/> <include refid="selectServiceCateVo"/>
where id in (select card.type from user_secondary_card card where card.status='1' ) where id in (select card.type from user_secondary_card card where card.status='1' )
order by sort ASC order by parent_id ASC, sort ASC
</select> </select>
<select id="selectServiceCateById" parameterType="Long" resultMap="ServiceCateResult"> <select id="selectServiceCateById" parameterType="Long" resultMap="ServiceCateResult">
<include refid="selectServiceCateVo"/> <include refid="selectServiceCateVo"/>
where id = #{id} where id = #{id}
@ -54,10 +53,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="browse != null">browse,</if> <if test="browse != null">browse,</if>
<if test="type != null">type,</if> <if test="type != null">type,</if>
<if test="parentId != null">parent_id,</if>
<if test="deletedAt != null">deleted_at,</if> <if test="deletedAt != null">deleted_at,</if>
created_at, created_at,
updated_at updated_at
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">#{title},</if> <if test="title != null and title != ''">#{title},</if>
@ -66,10 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="browse != null">#{browse},</if> <if test="browse != null">#{browse},</if>
<if test="type != null">#{type},</if> <if test="type != null">#{type},</if>
<if test="parentId != null">#{parentId},</if>
<if test="deletedAt != null">#{deletedAt},</if> <if test="deletedAt != null">#{deletedAt},</if>
NOW(), NOW(),
NOW() NOW()
</trim> </trim>
</insert> </insert>
@ -82,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="browse != null">browse = #{browse},</if> <if test="browse != null">browse = #{browse},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="deletedAt != null">deleted_at = #{deletedAt},</if> <if test="deletedAt != null">deleted_at = #{deletedAt},</if>
updated_at = NOW() updated_at = NOW()
</trim> </trim>

View File

@ -28,6 +28,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="longitude" column="longitude" /> <result property="longitude" column="longitude" />
<result property="type" column="type" /> <result property="type" column="type" />
<result property="cateId" column="cate_id" /> <result property="cateId" column="cate_id" />
<result property="firstCateId" column="first_cate_id" />
<result property="secondCateId" column="second_cate_id" />
<result property="project" column="project" /> <result property="project" column="project" />
<result property="sort" column="sort" /> <result property="sort" column="sort" />
<result property="material" column="material" /> <result property="material" column="material" />
@ -51,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectServiceGoodsVo"> <sql id="selectServiceGoodsVo">
select id, title, icon, imgs, sub_title, info, price,questions, price_zn, sales,servicetype, stock, status, description, sku_type,groupnum,sku, latitude, longitude, type, cate_id, project, sort, material, postage, basic, margin, skill_ids, created_at, updated_at, deleted_at, isgroup, groupprice, isonce, onceprice, commissiontype, commission, dispatchtype, workerids, isfixed, fixedprice from service_goods select id, title, icon, imgs, sub_title, info, price,questions, price_zn, sales,servicetype, stock, status, description, sku_type,groupnum,sku, latitude, longitude, type, cate_id, first_cate_id, second_cate_id, project, sort, material, postage, basic, margin, skill_ids, created_at, updated_at, deleted_at, isgroup, groupprice, isonce, onceprice, commissiontype, commission, dispatchtype, workerids, isfixed, fixedprice from service_goods
</sql> </sql>
<select id="selectServiceGoodsList" parameterType="ServiceGoods" resultMap="ServiceGoodsResult"> <select id="selectServiceGoodsList" parameterType="ServiceGoods" resultMap="ServiceGoodsResult">
@ -67,6 +69,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and created_at BETWEEN #{createdStart} AND #{createdEnd} and created_at BETWEEN #{createdStart} AND #{createdEnd}
</if> </if>
<if test="cateId != null "> and cate_id = #{cateId}</if> <if test="cateId != null "> and cate_id = #{cateId}</if>
<if test="firstCateId != null "> and first_cate_id = #{firstCateId}</if>
<if test="secondCateId != null "> and second_cate_id = #{secondCateId}</if>
<if test="type != null "> and type = #{type}</if> <if test="type != null "> and type = #{type}</if>
</where> </where>
@ -130,6 +134,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null and longitude != ''">longitude,</if> <if test="longitude != null and longitude != ''">longitude,</if>
<if test="type != null">type,</if> <if test="type != null">type,</if>
<if test="cateId != null">cate_id,</if> <if test="cateId != null">cate_id,</if>
<if test="firstCateId != null">first_cate_id,</if>
<if test="secondCateId != null">second_cate_id,</if>
<if test="project != null">project,</if> <if test="project != null">project,</if>
<if test="sort != null">sort,</if> <if test="sort != null">sort,</if>
<if test="material != null">material,</if> <if test="material != null">material,</if>
@ -174,6 +180,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null and longitude != ''">#{longitude},</if> <if test="longitude != null and longitude != ''">#{longitude},</if>
<if test="type != null">#{type},</if> <if test="type != null">#{type},</if>
<if test="cateId != null">#{cateId},</if> <if test="cateId != null">#{cateId},</if>
<if test="firstCateId != null">#{firstCateId},</if>
<if test="secondCateId != null">#{secondCateId},</if>
<if test="project != null">#{project},</if> <if test="project != null">#{project},</if>
<if test="sort != null">#{sort},</if> <if test="sort != null">#{sort},</if>
<if test="material != null">#{material},</if> <if test="material != null">#{material},</if>
@ -221,6 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null and longitude != ''">longitude = #{longitude},</if> <if test="longitude != null and longitude != ''">longitude = #{longitude},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
<if test="cateId != null">cate_id = #{cateId},</if> <if test="cateId != null">cate_id = #{cateId},</if>
<if test="firstCateId != null">first_cate_id = #{firstCateId},</if>
<if test="secondCateId != null">second_cate_id = #{secondCateId},</if>
<if test="project != null">project = #{project},</if> <if test="project != null">project = #{project},</if>
<if test="sort != null">sort = #{sort},</if> <if test="sort != null">sort = #{sort},</if>
<if test="material != null">material = #{material},</if> <if test="material != null">material = #{material},</if>

View File

@ -53,3 +53,15 @@ export function delServiceCate(id) {
method: 'delete' method: 'delete'
}) })
} }
// 获取所有分类列表(用于下拉选择,不分页)
export function getAllServiceCateList() {
return request({
url: '/system/ServiceCate/list',
method: 'get',
params: {
pageNum: 1,
pageSize: 10000 // 设置大于1000的值后端会返回所有数据不分页
}
})
}

View File

@ -145,9 +145,10 @@
</el-form-item> </el-form-item>
<el-form-item label="位置" prop="type" required> <el-form-item label="位置" prop="type" required>
<el-radio-group v-model="form.type"> <el-radio-group v-model="form.type">
<el-radio :label="0">首页团队</el-radio> <el-radio :label="1">首页团队</el-radio>
<el-radio :label="1">首页宣传</el-radio> <el-radio :label="2">首页宣传</el-radio>
<el-radio :label="2">积分商城</el-radio> <el-radio :label="3">积分商城</el-radio>
<el-radio :label="4">商城轮播</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="图片" prop="image" required> <el-form-item label="图片" prop="image" required>

File diff suppressed because it is too large Load Diff

View File

@ -2,13 +2,34 @@
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="分类" prop="cateId"> <el-form-item label="分类" prop="cateId">
<el-select v-model="queryParams.cateId" placeholder="请选择分类" clearable> <el-select v-model="queryParams.cateId" placeholder="请选择分类" clearable filterable>
<el-option <el-option-group
v-for="cate in serviceCateList" v-for="group in groupedServiceCateList"
:key="cate.id" :key="group.parentId || 'top'"
:label="cate.title" :label="group.label"
:value="cate.id" >
/> <el-option
v-for="cate in group.children"
:key="cate.id"
:label="formatCateLabel(cate)"
:value="cate.id"
>
<span style="display: flex; align-items: center; justify-content: space-between;">
<span>
<i :class="getCateIcon(cate)" style="margin-right: 6px; color: #909399;"></i>
{{ cate.title }}
</span>
<el-tag
:type="getCateTagType(cate)"
size="mini"
effect="light"
style="margin-left: 8px;"
>
{{ getCateLevel(cate) }}
</el-tag>
</span>
</el-option>
</el-option-group>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -104,7 +125,16 @@
<el-table v-loading="loading" :data="ServiceGoodsList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="ServiceGoodsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" width="55" prop="id" /> <el-table-column label="ID" align="center" width="55" prop="id" />
<el-table-column label="分类" align="center" prop="cateName"/> <el-table-column label="分类" align="center" prop="cateName" width="120">
<template slot-scope="scope">
<div>
<div>{{ scope.row.title }}</div>
<div style="font-size: 11px; color: #999; margin-top: 2px;">
一级: {{ getFirstCateName(scope.row.firstCateId) }} | 二级: {{ getSecondCateName(scope.row.secondCateId) }}
</div>
</div>
</template>
</el-table-column>
<el-table-column label="标题" align="center" prop="title" /> <el-table-column label="标题" align="center" prop="title" />
<el-table-column label="图标" align="center" prop="icon" width="100"> <el-table-column label="图标" align="center" prop="icon" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
@ -269,9 +299,63 @@
<el-input v-model="form.priceZn" placeholder="请输入列表价格显示" /> <el-input v-model="form.priceZn" placeholder="请输入列表价格显示" />
</el-form-item> </el-form-item>
<el-form-item label="分类" prop="cateId"> <el-form-item label="分类" prop="cateId">
<el-select v-model="form.cateId" placeholder="请选择分类"> <div style="display: flex; align-items: center; gap: 8px;">
<el-option v-for="cate in serviceCateList" :key="cate.id" :label="cate.title" :value="cate.id" /> <el-select
</el-select> v-model="form.cateId"
placeholder="请选择分类"
filterable
clearable
style="flex: 1;"
@change="handleCateChange"
>
<el-option-group
v-for="group in groupedServiceCateList"
:key="group.parentId || 'top'"
:label="group.label"
>
<el-option
v-for="cate in group.children"
:key="cate.id"
:label="formatCateLabel(cate)"
:value="cate.id"
>
<span style="display: flex; align-items: center; justify-content: space-between;">
<span>
<i :class="getCateIcon(cate)" style="margin-right: 6px; color: #909399;"></i>
{{ cate.title }}
</span>
<el-tag
:type="getCateTagType(cate)"
size="mini"
effect="light"
style="margin-left: 8px;"
>
{{ getCateLevel(cate) }}
</el-tag>
</span>
</el-option>
</el-option-group>
</el-select>
<el-tooltip content="快速添加分类" placement="top">
<el-button
type="primary"
size="mini"
icon="el-icon-plus"
circle
@click="showQuickAddCate = true"
></el-button>
</el-tooltip>
</div>
<div v-if="selectedCateInfo" style="margin-top: 5px; font-size: 12px; color: #909399;">
<i class="el-icon-info"></i>
已选择{{ selectedCateInfo.level }}分类{{ selectedCateInfo.name }}
<span v-if="selectedCateInfo.parent"> 所属{{ selectedCateInfo.parent }}</span>
<br/>
<span style="color: #67C23A;">
一级分类: {{ getFirstCateName(form.firstCateId) }} |
二级分类: {{ getSecondCateName(form.secondCateId) }}
</span>
</div>
</el-form-item> </el-form-item>
<el-form-item label="保证金" prop="margin"> <el-form-item label="保证金" prop="margin">
<el-input v-model="form.margin" placeholder="请输入保证金" /> <el-input v-model="form.margin" placeholder="请输入保证金" />
@ -553,17 +637,91 @@
<el-button type="primary" @click="saveEditField">保存</el-button> <el-button type="primary" @click="saveEditField">保存</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 快速添加分类对话框 -->
<el-dialog :visible.sync="showQuickAddCate" title="快速添加分类" width="500px">
<el-form ref="quickCateForm" :model="quickCateForm" :rules="quickCateRules" label-width="100px">
<el-form-item label="分类层级" prop="level">
<el-radio-group v-model="quickCateForm.level" @change="handleQuickCateLevelChange">
<el-radio :label="1">
<i class="el-icon-folder" style="color: #409EFF;"></i>
一级分类
</el-radio>
<el-radio :label="2">
<i class="el-icon-document" style="color: #67C23A;"></i>
二级分类
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if="quickCateForm.level === 2"
label="上级分类"
prop="parentId"
>
<el-select
v-model="quickCateForm.parentId"
placeholder="请选择上级分类"
style="width: 100%;"
>
<el-option
v-for="cate in firstLevelCateList"
:key="cate.id"
:label="cate.title"
:value="cate.id"
>
<span style="display: flex; align-items: center;">
<i class="el-icon-folder" style="margin-right: 6px; color: #409EFF;"></i>
{{ cate.title }}
</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="分类名称" prop="title">
<el-input
v-model="quickCateForm.title"
placeholder="请输入分类名称"
maxlength="50"
show-word-limit
/>
</el-form-item>
<el-form-item label="分类类型" prop="type">
<el-radio-group v-model="quickCateForm.type">
<el-radio
v-for="dict in dict.type.service_sate_type"
:key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="quickCateForm.sort"
:min="0"
:max="9999"
style="width: 200px;"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuickAddCate">取消</el-button>
<el-button type="primary" @click="saveQuickAddCate" :loading="quickCateSubmitting">
<i class="el-icon-plus"></i>
保存并选择
</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listServiceGoods, getServiceGoods, delServiceGoods, addServiceGoods, updateServiceGoods ,changefenleiStatus,selectServiceCateList,getSiteSkillList,getlistworkerlist} from "@/api/system/ServiceGoods" import { listServiceGoods, getServiceGoods, delServiceGoods, addServiceGoods, updateServiceGoods ,changefenleiStatus,selectServiceCateList,getSiteSkillList,getlistworkerlist} from "@/api/system/ServiceGoods"
import { getAllServiceCateList, addServiceCate } from "@/api/system/ServiceCate"
import Editor from '@/components/Editor' import Editor from '@/components/Editor'
export default { export default {
name: "ServiceGoods", name: "ServiceGoods",
dicts: ['service_goods_status', 'fixed', 'service_commissiontype', 'service_dispatch','servicetype'], dicts: ['service_goods_status', 'fixed', 'service_commissiontype', 'service_dispatch','servicetype', 'service_sate_type'],
components: { Editor }, components: { Editor },
data() { data() {
return { return {
@ -580,12 +738,45 @@ export default {
// //
listworkerlist: [], listworkerlist: [],
serviceCateList: [], serviceCateList: [],
//
groupedServiceCateList: [],
//
firstLevelCateList: [],
//
selectedCateInfo: null,
siteSkillList : [], siteSkillList : [],
// //
basicOptions: [], basicOptions: [],
//
showQuickAddCate: false,
quickCateSubmitting: false,
quickCateForm: {
level: 1,
parentId: null,
title: '',
type: 1,
sort: 50,
status: 1
},
quickCateRules: {
title: [
{ required: true, message: "分类名称不能为空", trigger: "blur" },
{ min: 2, max: 50, message: "分类名称长度在2到50个字符", trigger: "blur" }
],
type: [
{ required: true, message: "分类类型不能为空", trigger: "change" }
],
parentId: [
{ required: true, message: "请选择上级分类", trigger: "change" }
],
sort: [
{ required: true, message: "排序不能为空", trigger: "blur" }
]
},
total: 0, total: 0,
// //
ServiceGoodsList: [], ServiceGoodsList: [],
@ -611,6 +802,8 @@ export default {
// //
form: { form: {
questionsArray: [], // questionsArray: [], //
firstCateId: null, // ID
secondCateId: null, // ID
}, },
// //
rules: { rules: {
@ -730,6 +923,8 @@ export default {
longitude: null, longitude: null,
type: 1, type: 1,
cateId: null, cateId: null,
firstCateId: null, // ID
secondCateId: null, // ID
project: null, project: null,
sort: 50, sort: 50,
material: null, material: null,
@ -768,6 +963,8 @@ export default {
this.skuType = 1; this.skuType = 1;
// //
this.activeTab = 'base'; this.activeTab = 'base';
//
this.selectedCateInfo = null;
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -834,6 +1031,9 @@ export default {
this.form.workerids = []; this.form.workerids = [];
// //
this.$set(this.form, 'questionsArray', []); this.$set(this.form, 'questionsArray', []);
// ID
this.$set(this.form, 'firstCateId', null);
this.$set(this.form, 'secondCateId', null);
console.log('新增时初始化form:', this.form); console.log('新增时初始化form:', this.form);
// //
@ -1049,6 +1249,15 @@ export default {
console.log('编辑时的规格类型:', this.skuType); console.log('编辑时的规格类型:', this.skuType);
console.log('编辑时的规格数据:', this.form.sku); console.log('编辑时的规格数据:', this.form.sku);
// ID
if (this.form.cateId) {
this.handleCateChange(this.form.cateId);
} else {
// ID
this.form.firstCateId = null;
this.form.secondCateId = null;
}
// Vue // Vue
this.$nextTick(() => { this.$nextTick(() => {
console.log('=== 编辑数据初始化完成后的状态 ==='); console.log('=== 编辑数据初始化完成后的状态 ===');
@ -1175,6 +1384,9 @@ export default {
submitData.workerids = JSON.stringify(arr); submitData.workerids = JSON.stringify(arr);
} }
// ID
console.log('一级分类ID:', submitData.firstCateId);
console.log('二级分类ID:', submitData.secondCateId);
console.log('最终提交的表单数据:', submitData); console.log('最终提交的表单数据:', submitData);
// //
@ -1219,9 +1431,77 @@ export default {
}); });
}, },
getserviceCateList(){ getserviceCateList(){
selectServiceCateList().then(response => { //
this.serviceCateList = response.data getAllServiceCateList().then(response => {
}) this.serviceCateList = response.rows || []
this.processServiceCateList()
}).catch(error => {
console.error('获取分类列表失败:', error)
// 使
selectServiceCateList().then(response => {
this.serviceCateList = response.data || []
this.processServiceCateList()
}).catch(err => {
console.error('降级获取分类列表也失败:', err)
this.$message.error('获取分类列表失败,请刷新重试')
})
})
},
//
processServiceCateList() {
console.log('开始处理分类数据:', this.serviceCateList)
if (!this.serviceCateList || this.serviceCateList.length === 0) {
console.warn('分类列表为空')
this.firstLevelCateList = []
this.groupedServiceCateList = []
return
}
const firstLevel = this.serviceCateList.filter(cate => cate.parentId === 0 || cate.parentId === null || !cate.parentId)
const secondLevel = this.serviceCateList.filter(cate => cate.parentId && cate.parentId > 0)
console.log('分类数据分组:', {
总数: this.serviceCateList.length,
一级分类: firstLevel,
二级分类: secondLevel
})
//
this.firstLevelCateList = firstLevel
//
this.groupedServiceCateList = []
//
if (firstLevel.length > 0) {
this.groupedServiceCateList.push({
parentId: 0,
label: '📁 一级分类',
children: firstLevel
})
}
//
firstLevel.forEach(parent => {
const children = secondLevel.filter(child => child.parentId === parent.id)
if (children.length > 0) {
this.groupedServiceCateList.push({
parentId: parent.id,
label: `📄 ${parent.title} - 二级分类`,
children: children
})
}
})
console.log('分类数据处理完成:', {
总数: this.serviceCateList.length,
一级分类: firstLevel.length,
二级分类: secondLevel.length,
分组数: this.groupedServiceCateList.length,
分组详情: this.groupedServiceCateList
})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -1597,6 +1877,185 @@ export default {
this.silentSave(); this.silentSave();
}, 1000); // 1 }, 1000); // 1
}, },
// ========== ==========
//
handleCateChange(cateId) {
if (cateId) {
const cate = this.serviceCateList.find(c => c.id === cateId)
if (cate) {
const isFirstLevel = !cate.parentId || cate.parentId === 0
// ID
if (isFirstLevel) {
//
this.form.firstCateId = cateId
this.form.secondCateId = 0
} else {
//
this.form.firstCateId = cate.parentId
this.form.secondCateId = cateId
}
this.selectedCateInfo = {
name: cate.title,
level: isFirstLevel ? '一级' : '二级',
parent: isFirstLevel ? null : this.getParentCateName(cate.parentId)
}
console.log('分类选择变化:', {
选择的分类ID: cateId,
一级分类ID: this.form.firstCateId,
二级分类ID: this.form.secondCateId,
分类信息: this.selectedCateInfo
})
} else {
this.selectedCateInfo = null
this.form.firstCateId = null
this.form.secondCateId = null
}
} else {
this.selectedCateInfo = null
this.form.firstCateId = null
this.form.secondCateId = null
}
},
//
getParentCateName(parentId) {
const parent = this.serviceCateList.find(c => c.id === parentId)
return parent ? parent.title : ''
},
//
formatCateLabel(cate) {
const isFirstLevel = !cate.parentId || cate.parentId === 0
return isFirstLevel ? cate.title : `${cate.title}`
},
//
getCateIcon(cate) {
const isFirstLevel = !cate.parentId || cate.parentId === 0
return isFirstLevel ? 'el-icon-folder' : 'el-icon-document'
},
//
getCateTagType(cate) {
const isFirstLevel = !cate.parentId || cate.parentId === 0
return isFirstLevel ? 'primary' : 'success'
},
//
getCateLevel(cate) {
const isFirstLevel = !cate.parentId || cate.parentId === 0
return isFirstLevel ? '一级' : '二级'
},
// ID
getFirstCateName(firstCateId) {
if (!firstCateId) {
return '无'
}
const cate = this.serviceCateList.find(c => c.id === firstCateId)
return cate ? cate.title : '无'
},
// ID
getSecondCateName(secondCateId) {
if (!secondCateId || secondCateId === 0) {
return '无'
}
const cate = this.serviceCateList.find(c => c.id === secondCateId)
return cate ? cate.title : '无'
},
// ========== ==========
//
handleQuickCateLevelChange(level) {
if (level === 1) {
this.quickCateForm.parentId = null
// parentId
this.$refs.quickCateForm && this.$refs.quickCateForm.clearValidate('parentId')
} else {
// parentId
this.$nextTick(() => {
if (this.$refs.quickCateForm) {
this.$refs.quickCateForm.validateField('parentId')
}
})
}
},
//
cancelQuickAddCate() {
this.showQuickAddCate = false
this.resetQuickCateForm()
},
//
resetQuickCateForm() {
this.quickCateForm = {
level: 1,
parentId: null,
title: '',
type: 1,
sort: 50,
status: 1
}
if (this.$refs.quickCateForm) {
this.$refs.quickCateForm.resetFields()
}
},
//
saveQuickAddCate() {
this.$refs.quickCateForm.validate(valid => {
if (valid) {
this.quickCateSubmitting = true
//
const submitData = {
title: this.quickCateForm.title,
type: this.quickCateForm.type,
sort: this.quickCateForm.sort,
status: this.quickCateForm.status,
parentId: this.quickCateForm.level === 1 ? 0 : this.quickCateForm.parentId,
icon: null,
browse: 0
}
console.log('快速添加分类数据:', submitData)
addServiceCate(submitData).then(response => {
this.$message.success('分类添加成功')
//
this.getserviceCateList()
//
if (response.data && response.data.id) {
this.$nextTick(() => {
this.form.cateId = response.data.id
this.handleCateChange(response.data.id)
})
}
//
this.showQuickAddCate = false
this.resetQuickCateForm()
}).catch(error => {
console.error('快速添加分类失败:', error)
this.$message.error('添加分类失败,请重试')
}).finally(() => {
this.quickCateSubmitting = false
})
} else {
this.$message.error('请完善分类信息')
}
})
},
} }
} }
</script> </script>
@ -1677,4 +2136,47 @@ export default {
.qa-item :deep(.el-divider--horizontal) { .qa-item :deep(.el-divider--horizontal) {
margin: 10px 0; margin: 10px 0;
} }
/* 快速添加分类对话框样式 */
.el-dialog__body .el-form-item__label {
font-weight: 500;
}
.el-radio-group .el-radio {
margin-bottom: 8px;
}
.el-radio-group .el-radio:last-child {
margin-bottom: 0;
}
/* 分类选择下拉框样式优化 */
.el-select-group__title {
padding: 8px 12px;
font-size: 12px;
font-weight: 600;
color: #606266;
background: #f5f7fa;
border-bottom: 1px solid #e4e7ed;
}
.el-option-group .el-option {
padding-left: 24px;
}
/* 分类选择信息提示样式 */
.cate-info-tip {
background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
border: 1px solid #0ea5e9;
border-radius: 6px;
padding: 8px 12px;
margin-top: 8px;
font-size: 12px;
color: #0369a1;
}
.cate-info-tip i {
margin-right: 6px;
color: #0ea5e9;
}
</style> </style>

View File

@ -195,56 +195,140 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="首页轮播图" name="config_banner"> <el-tab-pane label="通知公告" name="config_banner">
<el-form label-width="120px" class="tab-form"> <div class="notice-container">
<div class="banner-list"> <!-- 页面头部操作区 -->
<div v-for="(item, index) in bannerForm.banner" :key="index" class="banner-item"> <div class="notice-header">
<el-card> <div class="notice-title">
<div class="banner-content"> <h3>通知公告管理</h3>
<div class="banner-image"> <p class="notice-desc">管理首页展示的通知公告支持富文本编辑和状态控制</p>
<el-upload </div>
class="banner-uploader" <div class="notice-header-actions">
:action="uploadImgUrl" <el-button type="primary" icon="el-icon-plus" @click="addNotice">添加公告</el-button>
:headers="headers" <el-button type="success" icon="el-icon-check" @click="saveAllConfig('notice')">保存全部</el-button>
:show-file-list="false" <el-button icon="el-icon-refresh" @click="resetNotice">重置</el-button>
:on-success="(response, file) => handleBannerSuccess(response, file, index)" </div>
:on-error="handleBannerError" </div>
:before-upload="beforeBannerUpload"
> <!-- 公告列表 -->
<div v-if="item.imageUrl" class="banner-img-container"> <div class="notice-list">
<img :src="item.imageUrl" class="banner-img"> <div v-if="noticeForm.notice.length === 0" class="notice-empty">
<div class="banner-img-mask"> <el-empty description="暂无公告数据">
<div class="banner-img-actions"> <el-button type="primary" @click="addNotice">添加第一条公告</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh">更换图片</el-button> </el-empty>
</div> </div>
</div>
</div> <div v-for="(item, index) in noticeForm.notice" :key="index" class="notice-item">
<i v-else class="el-icon-plus banner-uploader-icon"></i> <el-card shadow="hover" :class="['notice-card', { 'notice-offline': item.status === 0 }]">
</el-upload> <!-- 卡片头部 -->
<div slot="header" class="notice-card-header">
<div class="notice-card-title">
<span class="notice-index">{{ index + 1 }}</span>
<el-tag :type="item.status === 1 ? 'success' : 'danger'" size="small">
{{ item.status === 1 ? '已上线' : '已下线' }}
</el-tag>
<span class="notice-sort-badge">排序: {{ item.sort || 0 }}</span>
</div> </div>
<div class="banner-form"> <div class="notice-card-actions">
<div class="banner-form-fields"> <el-switch
<el-form-item label="跳转链接" class="banner-link-item"> v-model="item.status"
<el-input v-model="item.link" placeholder="请输入跳转链接"></el-input> :active-value="1"
</el-form-item> :inactive-value="0"
<div class="banner-form-right"> active-text="上线"
<el-form-item label="排序" class="banner-sort-item"> inactive-text="下线"
<el-input-number v-model="item.sort" :min="0" :max="99"></el-input-number> active-color="#67C23A"
inactive-color="#F56C6C">
</el-switch>
<el-button
type="danger"
icon="el-icon-delete"
size="small"
circle
@click="removeNotice(index)"
style="margin-left: 10px;">
</el-button>
</div>
</div>
<!-- 卡片内容 -->
<div class="notice-card-content">
<el-form label-width="80px" label-position="top">
<div class="notice-form-grid">
<!-- 第一行标题 -->
<div class="notice-form-row full-width">
<el-form-item label="公告标题" class="notice-title-item">
<el-input
v-model="item.title"
placeholder="请输入公告标题"
maxlength="100"
show-word-limit
clearable>
</el-input>
</el-form-item>
</div>
<!-- 第二行内容 -->
<div class="notice-form-row full-width">
<el-form-item label="公告内容" class="notice-content-item">
<quill-editor
v-model="item.content"
:options="editorOptions"
class="notice-editor" />
</el-form-item>
</div>
<!-- 第三行链接和排序 -->
<div class="notice-form-row two-columns">
<el-form-item label="跳转链接" class="notice-link-item">
<el-input
v-model="item.link"
placeholder="请输入跳转链接(可选)"
clearable>
<template slot="prepend">
<i class="el-icon-link"></i>
</template>
</el-input>
</el-form-item>
<el-form-item label="排序" class="notice-sort-item">
<el-input-number
v-model="item.sort"
:min="0"
:max="999"
controls-position="right"
placeholder="排序值">
</el-input-number>
</el-form-item> </el-form-item>
<el-button type="danger" icon="el-icon-delete" circle @click="removeBanner(index)"></el-button>
</div> </div>
</div> </div>
</div> </el-form>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
<div class="banner-actions">
<el-button type="primary" icon="el-icon-plus" @click="addBanner">添加轮播图</el-button> <!-- 底部操作区 -->
<el-button type="primary" @click="saveAllConfig('banner')">保存</el-button> <div class="notice-footer" v-if="noticeForm.notice.length > 0">
<el-button @click="resetBanner">重置</el-button> <el-divider></el-divider>
<div class="notice-footer-actions">
<el-button type="primary" icon="el-icon-plus" @click="addNotice">添加公告</el-button>
<el-button type="success" icon="el-icon-check" @click="saveAllConfig('notice')">保存全部</el-button>
<el-button icon="el-icon-refresh" @click="resetNotice">重置</el-button>
</div>
<div class="notice-footer-tips">
<el-alert
title="温馨提示"
type="info"
:closable="false"
show-icon>
<div slot="description">
<p> 只有状态为"上线"的公告才会在前端显示</p>
<p> 公告按排序值升序排列数值越小越靠前</p>
<p> 保存后需要前端重新请求接口才能看到最新内容</p>
</div>
</el-alert>
</div>
</div> </div>
</el-form> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-button type="primary" style="margin-top: 24px;" @click="saveAllConfig">保存全部配置</el-button> <el-button type="primary" style="margin-top: 24px;" @click="saveAllConfig">保存全部配置</el-button>
@ -277,6 +361,12 @@ export default {
config_five: {}, config_five: {},
config_six: {}, config_six: {},
total: 0, // total: 0, //
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
status: null
},
// //
baseForm: { baseForm: {
phone: '', phone: '',
@ -319,18 +409,27 @@ export default {
cancelOrderDays: 7 cancelOrderDays: 7
}, },
editorOptions: { editorOptions: {
placeholder: '请输入质保金说明...' placeholder: '请输入公告内容,支持富文本格式...',
theme: 'snow',
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
[{ 'script': 'sub'}, { 'script': 'super' }],
[{ 'color': [] }, { 'background': [] }],
[{ 'align': [] }],
['link'],
['clean']
]
}
}, },
config_seven: {}, config_seven: {},
bannerForm: { noticeForm: {
banner: [] notice: []
}, },
//
uploadImgUrl: process.env.VUE_APP_BASE_API + "/api/public/upload/file",
//
headers: {
Authorization: 'Bearer ' + getToken()
}
} }
}, },
created() { created() {
@ -421,11 +520,11 @@ export default {
} }
} }
// config_seven // config_seven
this.config_seven = response.rows.find(item => item.name === 'config_seven') this.config_seven = response.rows.find(item => item.name === 'config_seven')
if (this.config_seven && this.config_seven.value) { if (this.config_seven && this.config_seven.value) {
const configBannerObj = JSON.parse(this.config_seven.value) const configNoticeObj = JSON.parse(this.config_seven.value)
this.bannerForm.banner = configBannerObj.banner || [] this.noticeForm.notice = configNoticeObj.notice || []
} }
this.total = response.total this.total = response.total
@ -553,10 +652,12 @@ export default {
}; };
// config_seven // config_seven
const config_seven = { const config_seven = {
banner: this.bannerForm.banner.map(item => ({ notice: this.noticeForm.notice.map(item => ({
imageUrl: item.imageUrl, title: item.title,
content: item.content,
link: item.link, link: item.link,
sort: item.sort sort: item.sort,
status: item.status
})).sort((a, b) => a.sort - b.sort) })).sort((a, b) => a.sort - b.sort)
}; };
try { try {
@ -576,7 +677,7 @@ export default {
} else { } else {
await updateSiteConfig({ name: 'config_six', id: this.config_six.id, value: JSON.stringify(config_six) }); await updateSiteConfig({ name: 'config_six', id: this.config_six.id, value: JSON.stringify(config_six) });
} }
}else if(e=='banner'){ }else if(e=='notice'){
if (!this.config_seven || !this.config_seven.id) { if (!this.config_seven || !this.config_seven.id) {
await addSiteConfig({ name: 'config_seven', value: JSON.stringify(config_seven), status: 1 }); await addSiteConfig({ name: 'config_seven', value: JSON.stringify(config_seven), status: 1 });
} else { } else {
@ -590,46 +691,38 @@ export default {
this.$message.error('保存失败,请重试'); this.$message.error('保存失败,请重试');
} }
}, },
handleBannerSuccess(response, file, index) { addNotice() {
if (response.code === 200) { //
this.bannerForm.banner[index].imageUrl = response.data.full_path const maxSort = this.noticeForm.notice.length > 0
this.$message.success('图片上传成功') ? Math.max(...this.noticeForm.notice.map(item => item.sort || 0))
} else { : -1;
this.$message.error(response.msg)
}
},
handleBannerError(err) {
this.$message.error('图片上传失败')
console.error('上传失败:', err)
},
beforeBannerUpload(file) {
const isImg = file.type.startsWith('image/')
const isLt5M = file.size / 1024 / 1024 < 5
if (!isImg) { this.noticeForm.notice.push({
this.$message.error('只能上传图片格式!') title: '',
} content: '',
if (!isLt5M) {
this.$message.error('上传图片大小不能超过 5MB!')
}
return isImg && isLt5M
},
addBanner() {
this.bannerForm.banner.push({
imageUrl: '',
link: '', link: '',
sort: this.bannerForm.banner.length sort: maxSort + 1,
status: 1
}) })
}, },
removeBanner(index) { removeNotice(index) {
this.bannerForm.banner.splice(index, 1) this.$confirm('确定删除这条公告吗?', '提示', {
// confirmButtonText: '确定',
this.bannerForm.banner.forEach((item, idx) => { cancelButtonText: '取消',
item.sort = idx type: 'warning'
}).then(() => {
this.noticeForm.notice.splice(index, 1)
//
this.noticeForm.notice.forEach((item, idx) => {
item.sort = idx
})
this.$message.success('删除成功')
}).catch(() => {
this.$message.info('已取消删除')
}) })
}, },
resetBanner() { resetNotice() {
this.bannerForm.banner = [] this.noticeForm.notice = []
} }
} }
} }
@ -667,101 +760,242 @@ export default {
color: #8c939d; color: #8c939d;
} }
/* 轮播图样式 */ /* 通知公告容器样式 */
.banner-list { .notice-container {
margin-bottom: 20px; background: #f8f9fa;
min-height: 600px;
padding: 0;
} }
.banner-item {
/* 页面头部样式 */
.notice-header {
background: #fff;
padding: 24px;
border-radius: 8px;
margin-bottom: 20px; margin-bottom: 20px;
} box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
.banner-content {
display: flex; display: flex;
align-items: flex-start; justify-content: space-between;
gap: 20px; align-items: center;
width: 100%;
} }
.banner-image {
flex-shrink: 0; .notice-title h3 {
margin: 0 0 8px 0;
color: #303133;
font-size: 20px;
font-weight: 600;
} }
.banner-form {
flex-grow: 1; .notice-desc {
width: calc(100% - 380px); /* 360px for image + 20px gap */ margin: 0;
color: #909399;
font-size: 14px;
line-height: 1.5;
} }
.banner-form-fields {
.notice-header-actions {
display: flex;
gap: 12px;
}
/* 空状态样式 */
.notice-empty {
background: #fff;
border-radius: 8px;
padding: 40px;
text-align: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
/* 公告列表样式 */
.notice-list {
margin-bottom: 20px;
}
.notice-item {
margin-bottom: 20px;
}
/* 公告卡片样式 */
.notice-card {
border-radius: 12px;
border: 1px solid #e4e7ed;
transition: all 0.3s ease;
}
.notice-card:hover {
border-color: #409EFF;
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(64, 158, 255, 0.12);
}
.notice-card.notice-offline {
background: #fafafa;
border-color: #f0f0f0;
}
.notice-card.notice-offline:hover {
border-color: #d9d9d9;
transform: none;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
/* 卡片头部样式 */
.notice-card-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0;
}
.notice-card-title {
display: flex;
align-items: center;
gap: 12px;
}
.notice-index {
background: #409EFF;
color: #fff;
width: 24px;
height: 24px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 600;
}
.notice-sort-badge {
background: #f0f2f5;
color: #606266;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
}
.notice-card-actions {
display: flex;
align-items: center;
gap: 8px;
}
/* 卡片内容样式 */
.notice-card-content {
padding: 0;
}
.notice-form-grid {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 15px; gap: 20px;
}
.notice-form-row.full-width {
width: 100%; width: 100%;
} }
.banner-link-item {
margin-bottom: 0; .notice-form-row.two-columns {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 20px;
align-items: start;
}
.notice-title-item .el-form-item__content {
width: 100%; width: 100%;
} }
.banner-form-right {
display: flex; .notice-content-item .el-form-item__content {
align-items: center; width: 100%;
gap: 15px;
} }
.banner-sort-item {
margin-bottom: 0; .notice-link-item .el-form-item__content {
width: 100%;
} }
.banner-form .el-form-item__content {
width: calc(100% - 120px); /* 120px is label width */ .notice-sort-item .el-form-item__content {
width: 100%;
} }
.banner-uploader {
border: 1px dashed #d9d9d9; /* 富文本编辑器样式 */
border-radius: 6px; .notice-editor {
cursor: pointer; border-radius: 8px;
position: relative;
overflow: hidden; overflow: hidden;
width: 360px;
height: 200px;
} }
.banner-uploader:hover {
border-color: #409EFF; .notice-editor .ql-toolbar {
border-top: 1px solid #e4e7ed;
border-left: 1px solid #e4e7ed;
border-right: 1px solid #e4e7ed;
background: #fafbfc;
} }
.banner-img-container {
position: relative; .notice-editor .ql-container {
width: 360px; border-bottom: 1px solid #e4e7ed;
height: 200px; border-left: 1px solid #e4e7ed;
border-right: 1px solid #e4e7ed;
min-height: 200px;
font-size: 14px;
} }
.banner-img {
width: 360px; .notice-editor .ql-editor {
height: 200px; padding: 16px;
display: block; line-height: 1.6;
object-fit: cover;
} }
.banner-img-mask {
position: absolute; /* 底部操作区样式 */
top: 0; .notice-footer {
left: 0; background: #fff;
width: 100%; border-radius: 8px;
height: 100%; padding: 24px;
background-color: rgba(0, 0, 0, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.notice-footer-actions {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; gap: 12px;
opacity: 0; margin-bottom: 20px;
transition: opacity 0.3s;
} }
.banner-img-container:hover .banner-img-mask {
opacity: 1; .notice-footer-tips {
margin-top: 16px;
} }
.banner-img-actions {
text-align: center; .notice-footer-tips .el-alert {
border-radius: 8px;
} }
.banner-img-actions .el-button {
margin: 0 5px; .notice-footer-tips .el-alert__description p {
margin: 4px 0;
color: #606266;
font-size: 13px;
line-height: 1.5;
} }
.banner-uploader-icon {
font-size: 28px; /* 响应式设计 */
color: #8c939d; @media (max-width: 768px) {
width: 360px; .notice-header {
height: 200px; flex-direction: column;
line-height: 200px; align-items: flex-start;
text-align: center; gap: 16px;
} }
.banner-actions {
margin-top: 20px; .notice-header-actions {
width: 100%;
justify-content: flex-start;
}
.notice-form-row.two-columns {
grid-template-columns: 1fr;
gap: 16px;
}
.notice-footer-actions {
flex-direction: column;
align-items: stretch;
}
} }
</style> </style>