202507031526
This commit is contained in:
parent
419e0f18a4
commit
b3eeffe6ad
|
|
@ -1814,14 +1814,16 @@ public class AppletController extends BaseController {
|
||||||
String content = (String) param.get("content");
|
String content = (String) param.get("content");
|
||||||
Integer num = param.get("num") != null ? Integer.parseInt(param.get("num").toString()) : null;
|
Integer num = param.get("num") != null ? Integer.parseInt(param.get("num").toString()) : null;
|
||||||
Object imagesObj = param.get("images");
|
Object imagesObj = param.get("images");
|
||||||
|
Object labels = param.get("labels");
|
||||||
|
|
||||||
if (orderId == null || orderId.isEmpty()) {
|
if (orderId == null || orderId.isEmpty()) {
|
||||||
return AjaxResult.error("请选择评价的订单");
|
return AppletControllerUtil.appletWarning("请选择评价的订单");
|
||||||
}
|
}
|
||||||
if (content == null || content.isEmpty()) {
|
if (content == null || content.isEmpty()) {
|
||||||
return AjaxResult.error("请输入评价内容");
|
return AppletControllerUtil.appletWarning("请输入评价内容");
|
||||||
}
|
}
|
||||||
if (num == null) {
|
if (num == null) {
|
||||||
return AjaxResult.error("请打分");
|
return AppletControllerUtil.appletWarning("请打分");
|
||||||
}
|
}
|
||||||
// 获取当前登录用户(假设有token或session,示例用1L)
|
// 获取当前登录用户(假设有token或session,示例用1L)
|
||||||
Long uid = 1L;
|
Long uid = 1L;
|
||||||
|
|
@ -1832,13 +1834,13 @@ public class AppletController extends BaseController {
|
||||||
query.setOrderId(orderId);
|
query.setOrderId(orderId);
|
||||||
List<GoodsOrder> orderList = goodsOrderService.selectGoodsOrderList(query);
|
List<GoodsOrder> orderList = goodsOrderService.selectGoodsOrderList(query);
|
||||||
if (orderList == null || orderList.isEmpty()) {
|
if (orderList == null || orderList.isEmpty()) {
|
||||||
return AjaxResult.error("订单不存在");
|
return AppletControllerUtil.appletWarning("订单不存在");
|
||||||
}
|
}
|
||||||
goodsOrder = orderList.get(0);
|
goodsOrder = orderList.get(0);
|
||||||
}
|
}
|
||||||
int count = orderCommentService.selectCountOrderCommentByOid(goodsOrder.getId());
|
int count = orderCommentService.selectCountOrderCommentByOid(goodsOrder.getId());
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
return AjaxResult.error("请勿重复提交");
|
return AppletControllerUtil.appletWarning("请勿重复提交");
|
||||||
}
|
}
|
||||||
// 评分类型
|
// 评分类型
|
||||||
long numType = num == 1 ? 3 : ((num == 2 || num == 3) ? 2 : 1);
|
long numType = num == 1 ? 3 : ((num == 2 || num == 3) ? 2 : 1);
|
||||||
|
|
@ -1848,6 +1850,7 @@ public class AppletController extends BaseController {
|
||||||
comment.setOrderId(orderId);
|
comment.setOrderId(orderId);
|
||||||
comment.setProductId(goodsOrder.getProductId());
|
comment.setProductId(goodsOrder.getProductId());
|
||||||
comment.setContent(content);
|
comment.setContent(content);
|
||||||
|
comment.setLabels(labels != null ? JSON.toJSONString(labels) : null );
|
||||||
comment.setNum((long) num);
|
comment.setNum((long) num);
|
||||||
comment.setUid(goodsOrder.getUid()); // 或uid
|
comment.setUid(goodsOrder.getUid()); // 或uid
|
||||||
comment.setImages(imagesObj != null ? JSON.toJSONString(imagesObj) : null);
|
comment.setImages(imagesObj != null ? JSON.toJSONString(imagesObj) : null);
|
||||||
|
|
@ -1861,7 +1864,7 @@ public class AppletController extends BaseController {
|
||||||
goodsOrderService.updateGoodsOrder(goodsOrder);
|
goodsOrderService.updateGoodsOrder(goodsOrder);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("操作失败");
|
return AppletControllerUtil.appletWarning("操作失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
@ -6752,11 +6755,119 @@ public class AppletController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证用户图像和昵称是否为系统默认
|
* 服务订单评价
|
||||||
*
|
*
|
||||||
* @param request HTTP请求对象
|
* @param request HTTP请求对象
|
||||||
* @return 验证结果
|
* @return 验证结果
|
||||||
*/
|
*/
|
||||||
|
@PostMapping("/api/service/order/comment")
|
||||||
|
public AjaxResult serviceOrderComment(@RequestBody Map<String, Object> params, HttpServletRequest request) {
|
||||||
|
try {
|
||||||
|
// 1. 验证用户登录状态
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
Map<String, Object> userValidation = AppletLoginUtil.validateUserToken(token, usersService);
|
||||||
|
if (!(Boolean) userValidation.get("valid")) {
|
||||||
|
return AppletControllerUtil.appletWarning("用户未登录或token无效");
|
||||||
|
}
|
||||||
|
// 2. 获取用户信息
|
||||||
|
Users user = (Users) userValidation.get("user");
|
||||||
|
if (user == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("用户信息获取失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 参数验证
|
||||||
|
if (!params.containsKey("order_id") || !params.containsKey("content") || !params.containsKey("num")) {
|
||||||
|
return AppletControllerUtil.appletWarning("参数错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
String orderId = params.get("order_id").toString();
|
||||||
|
String content = params.get("content").toString();
|
||||||
|
Integer num = Integer.parseInt(params.get("num").toString());
|
||||||
|
//
|
||||||
|
// // 检查是否已经评价过
|
||||||
|
// OrderComment existComment = orderCommentService.selectOrderCommentByOrderIdAndUserId(orderId, user.getId());
|
||||||
|
// if (existComment != null) {
|
||||||
|
// return AjaxResult.error("请勿重复提交");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 获取订单信息
|
||||||
|
Order order = orderService.selectOrderByOrderId(orderId);
|
||||||
|
if (order == null) {
|
||||||
|
return AppletControllerUtil.appletWarning("订单不存在");
|
||||||
|
}
|
||||||
|
int count = orderCommentService.selectCountOrderCommentByOid(order.getId());
|
||||||
|
if (count > 0) {
|
||||||
|
return AppletControllerUtil.appletWarning("请勿重复提交");
|
||||||
|
}
|
||||||
|
// 计算评分类型
|
||||||
|
Integer numType;
|
||||||
|
if (num == 1) {
|
||||||
|
numType = 3; // 差评
|
||||||
|
} else if (num == 2 || num == 3) {
|
||||||
|
numType = 2; // 中评
|
||||||
|
} else {
|
||||||
|
numType = 1; // 好评
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建评价数据
|
||||||
|
OrderComment comment = new OrderComment();
|
||||||
|
comment.setOid(order.getId());
|
||||||
|
comment.setOrderId(orderId);
|
||||||
|
comment.setProductId(order.getProductId());
|
||||||
|
comment.setContent(content);
|
||||||
|
comment.setNum(Long.valueOf(num));
|
||||||
|
comment.setNumType(Long.valueOf(numType));
|
||||||
|
comment.setUid(user.getId());
|
||||||
|
comment.setWorkerId(order.getWorkerId());
|
||||||
|
|
||||||
|
// 处理图片
|
||||||
|
if (params.containsKey("images") && params.get("images") != null) {
|
||||||
|
String images = JSON.toJSONString(params.get("images"));
|
||||||
|
comment.setImages(images);
|
||||||
|
}
|
||||||
|
// 处理图片
|
||||||
|
if (params.containsKey("labels") && params.get("labels") != null) {
|
||||||
|
String labels = JSON.toJSONString(params.get("labels"));
|
||||||
|
comment.setLabels(labels);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 1. 保存评价
|
||||||
|
orderCommentService.insertOrderComment(comment);
|
||||||
|
|
||||||
|
// 2. 添加订单日志
|
||||||
|
OrderLog orderLog = new OrderLog();
|
||||||
|
orderLog.setOid(order.getId());
|
||||||
|
orderLog.setOrderId(orderId);
|
||||||
|
orderLog.setTitle("订单评价");
|
||||||
|
orderLog.setType(BigDecimal.valueOf(8));
|
||||||
|
|
||||||
|
Map<String, Object> logContent = new HashMap<>();
|
||||||
|
logContent.put("text", content);
|
||||||
|
logContent.put("image", params.get("images"));
|
||||||
|
logContent.put("num", num);
|
||||||
|
orderLog.setContent(JSON.toJSONString(logContent));
|
||||||
|
|
||||||
|
orderLogService.insertOrderLog(orderLog);
|
||||||
|
|
||||||
|
// 3. 更新订单状态
|
||||||
|
// Order updateOrder = new Order();
|
||||||
|
// order.setOrderId(orderId);
|
||||||
|
order.setStatus(4L); // 完成状态
|
||||||
|
order.setIsComment(1); // 已评价
|
||||||
|
orderService.updateOrder(order);
|
||||||
|
|
||||||
|
return AjaxResult.success();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("操作失败:" + e.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("系统错误:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/api/user/check/default")
|
@GetMapping("/api/user/check/default")
|
||||||
public AjaxResult checkUserDefault(HttpServletRequest request) {
|
public AjaxResult checkUserDefault(HttpServletRequest request) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,19 @@ public class ServiceGoodsController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取服务内容详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:ServiceGoods:query')")
|
||||||
|
@GetMapping(value = "/selectList")
|
||||||
|
public AjaxResult selectList() {
|
||||||
|
|
||||||
|
ServiceGoods serviceGoods = new ServiceGoods();
|
||||||
|
serviceGoods.setIsfixed(1);
|
||||||
|
return success(serviceGoodsService.selectServiceGoodsList(serviceGoods));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取服务内容详细信息
|
* 获取服务内容详细信息
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.ruoyi.system.ControllerUtil.GenerateCustomCode;
|
||||||
|
import com.ruoyi.system.domain.QuoteMaterial;
|
||||||
|
import com.ruoyi.system.service.IServiceGoodsService;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.system.domain.UserSecondaryCard;
|
||||||
|
import com.ruoyi.system.service.IUserSecondaryCardService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡管理Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/UserSecondaryCard")
|
||||||
|
public class UserSecondaryCardController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IUserSecondaryCardService userSecondaryCardService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IServiceGoodsService serviceGoodsService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡管理列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(UserSecondaryCard userSecondaryCard)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<UserSecondaryCard> list = userSecondaryCardService.selectUserSecondaryCardList(userSecondaryCard);
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
//JSONArray.parseArray(str);
|
||||||
|
for(UserSecondaryCard t:list){
|
||||||
|
List<String> idsList = com.alibaba.fastjson2.JSONArray.parseArray(t.getGoodsids(), String.class);
|
||||||
|
t.setGoodsname(serviceGoodsService.selectTitlesJSONArrayByIds(idsList));
|
||||||
|
}
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出次卡管理列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:export')")
|
||||||
|
@Log(title = "次卡管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, UserSecondaryCard userSecondaryCard)
|
||||||
|
{
|
||||||
|
List<UserSecondaryCard> list = userSecondaryCardService.selectUserSecondaryCardList(userSecondaryCard);
|
||||||
|
ExcelUtil<UserSecondaryCard> util = new ExcelUtil<UserSecondaryCard>(UserSecondaryCard.class);
|
||||||
|
util.exportExcel(response, list, "次卡管理数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取次卡管理详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(userSecondaryCardService.selectUserSecondaryCardById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增次卡管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:add')")
|
||||||
|
@Log(title = "次卡管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody UserSecondaryCard userSecondaryCard)
|
||||||
|
{
|
||||||
|
userSecondaryCard.setOrderid(GenerateCustomCode.generCreateOrder("CIKA"));
|
||||||
|
userSecondaryCard.setCreattime(new Date());
|
||||||
|
return toAjax(userSecondaryCardService.insertUserSecondaryCard(userSecondaryCard));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改次卡管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:edit')")
|
||||||
|
@Log(title = "次卡管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody UserSecondaryCard userSecondaryCard)
|
||||||
|
{
|
||||||
|
return toAjax(userSecondaryCardService.updateUserSecondaryCard(userSecondaryCard));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除次卡管理
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:remove')")
|
||||||
|
@Log(title = "次卡管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(userSecondaryCardService.deleteUserSecondaryCardByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.system.domain.UserUseSecondaryCard;
|
||||||
|
import com.ruoyi.system.service.IUserUseSecondaryCardService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡使用Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/UserUseSecondaryCard")
|
||||||
|
public class UserUseSecondaryCardController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IUserUseSecondaryCardService userUseSecondaryCardService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡使用列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserUseSecondaryCard:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(UserUseSecondaryCard userUseSecondaryCard)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<UserUseSecondaryCard> list = userUseSecondaryCardService.selectUserUseSecondaryCardList(userUseSecondaryCard);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出次卡使用列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserUseSecondaryCard:export')")
|
||||||
|
@Log(title = "次卡使用", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, UserUseSecondaryCard userUseSecondaryCard)
|
||||||
|
{
|
||||||
|
List<UserUseSecondaryCard> list = userUseSecondaryCardService.selectUserUseSecondaryCardList(userUseSecondaryCard);
|
||||||
|
ExcelUtil<UserUseSecondaryCard> util = new ExcelUtil<UserUseSecondaryCard>(UserUseSecondaryCard.class);
|
||||||
|
util.exportExcel(response, list, "次卡使用数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取次卡使用详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserUseSecondaryCard:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(userUseSecondaryCardService.selectUserUseSecondaryCardById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增次卡使用
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserUseSecondaryCard:add')")
|
||||||
|
@Log(title = "次卡使用", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody UserUseSecondaryCard userUseSecondaryCard)
|
||||||
|
{
|
||||||
|
return toAjax(userUseSecondaryCardService.insertUserUseSecondaryCard(userUseSecondaryCard));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改次卡使用
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserUseSecondaryCard:edit')")
|
||||||
|
@Log(title = "次卡使用", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody UserUseSecondaryCard userUseSecondaryCard)
|
||||||
|
{
|
||||||
|
return toAjax(userUseSecondaryCardService.updateUserUseSecondaryCard(userUseSecondaryCard));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除次卡使用
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:UserUseSecondaryCard:remove')")
|
||||||
|
@Log(title = "次卡使用", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(userUseSecondaryCardService.deleteUserUseSecondaryCardByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -45,6 +45,10 @@ public class OrderComment extends BaseEntity
|
||||||
@Excel(name = "图片")
|
@Excel(name = "图片")
|
||||||
private String images;
|
private String images;
|
||||||
|
|
||||||
|
/** 图片 */
|
||||||
|
@Excel(name = "评价标签")
|
||||||
|
private String labels;
|
||||||
|
|
||||||
/** 评价内容 */
|
/** 评价内容 */
|
||||||
@Excel(name = "评价内容")
|
@Excel(name = "评价内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
@ -212,6 +216,15 @@ public class OrderComment extends BaseEntity
|
||||||
this.uname = uname;
|
this.uname = uname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getLabels() {
|
||||||
|
return labels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabels(String labels) {
|
||||||
|
this.labels = labels;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,11 @@ public class ServiceGoods extends BaseEntity
|
||||||
@Excel(name = "详情")
|
@Excel(name = "详情")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
|
/** 规格类型 1:单规格 2:多规格 */
|
||||||
|
@Excel(name = "下单类型 1:预约下单 2:报价下单")
|
||||||
|
private Integer servicetype;
|
||||||
|
|
||||||
/** 规格类型 1:单规格 2:多规格 */
|
/** 规格类型 1:单规格 2:多规格 */
|
||||||
@Excel(name = "规格类型 1:单规格 2:多规格")
|
@Excel(name = "规格类型 1:单规格 2:多规格")
|
||||||
private Integer skuType;
|
private Integer skuType;
|
||||||
|
|
@ -168,6 +173,10 @@ private String cateName;
|
||||||
private Integer groupnum;
|
private Integer groupnum;
|
||||||
|
|
||||||
|
|
||||||
|
/** 指定工人的id集合 */
|
||||||
|
@Excel(name = "问答")
|
||||||
|
private String questions;
|
||||||
|
|
||||||
|
|
||||||
/** $column.columnComment */
|
/** $column.columnComment */
|
||||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
|
@ -597,6 +606,22 @@ private String cateName;
|
||||||
this.groupnum = groupnum;
|
this.groupnum = groupnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getServicetype() {
|
||||||
|
return servicetype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServicetype(Integer servicetype) {
|
||||||
|
this.servicetype = servicetype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuestions() {
|
||||||
|
return questions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuestions(String questions) {
|
||||||
|
this.questions = questions;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,249 @@
|
||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡管理对象 user_secondary_card
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
public class UserSecondaryCard extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 订单id */
|
||||||
|
@Excel(name = "订单id")
|
||||||
|
private String orderid;
|
||||||
|
|
||||||
|
/** 标题 */
|
||||||
|
@Excel(name = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/** 服务id */
|
||||||
|
@Excel(name = "服务id")
|
||||||
|
private String goodsids;
|
||||||
|
|
||||||
|
/** 服务id */
|
||||||
|
@Excel(name = "服务名称")
|
||||||
|
private String goodsname;
|
||||||
|
|
||||||
|
/** 展示价格 */
|
||||||
|
@Excel(name = "展示价格")
|
||||||
|
private BigDecimal showMoney;
|
||||||
|
|
||||||
|
/** 真实付款价格 */
|
||||||
|
@Excel(name = "真实付款价格")
|
||||||
|
private BigDecimal realMoney;
|
||||||
|
|
||||||
|
/** 展示图片 */
|
||||||
|
@Excel(name = "展示图片")
|
||||||
|
private String showimage;
|
||||||
|
|
||||||
|
/** 状态 1上线 2下线 */
|
||||||
|
@Excel(name = "状态 1上线 2下线")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date creattime;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Date createdAt;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Date updatedAt;
|
||||||
|
|
||||||
|
/** 分类 */
|
||||||
|
@Excel(name = "分类")
|
||||||
|
private Long type;
|
||||||
|
|
||||||
|
/** 可提供服务数 */
|
||||||
|
@Excel(name = "可提供服务数")
|
||||||
|
private Long num;
|
||||||
|
|
||||||
|
/** 总服务数 */
|
||||||
|
@Excel(name = "总服务数")
|
||||||
|
private Long allnum;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderid(String orderid)
|
||||||
|
{
|
||||||
|
this.orderid = orderid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrderid()
|
||||||
|
{
|
||||||
|
return orderid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGoodsids(String goodsids)
|
||||||
|
{
|
||||||
|
this.goodsids = goodsids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGoodsids()
|
||||||
|
{
|
||||||
|
return goodsids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowMoney(BigDecimal showMoney)
|
||||||
|
{
|
||||||
|
this.showMoney = showMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getShowMoney()
|
||||||
|
{
|
||||||
|
return showMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRealMoney(BigDecimal realMoney)
|
||||||
|
{
|
||||||
|
this.realMoney = realMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getRealMoney()
|
||||||
|
{
|
||||||
|
return realMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowimage(String showimage)
|
||||||
|
{
|
||||||
|
this.showimage = showimage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShowimage()
|
||||||
|
{
|
||||||
|
return showimage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Long status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getStatus()
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreattime(Date creattime)
|
||||||
|
{
|
||||||
|
this.creattime = creattime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreattime()
|
||||||
|
{
|
||||||
|
return creattime;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 setType(Long type)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getType()
|
||||||
|
{
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNum(Long num)
|
||||||
|
{
|
||||||
|
this.num = num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getNum()
|
||||||
|
{
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllnum(Long allnum)
|
||||||
|
{
|
||||||
|
this.allnum = allnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAllnum()
|
||||||
|
{
|
||||||
|
return allnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getGoodsname() {
|
||||||
|
return goodsname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGoodsname(String goodsname) {
|
||||||
|
this.goodsname = goodsname;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("orderid", getOrderid())
|
||||||
|
.append("title", getTitle())
|
||||||
|
.append("goodsids", getGoodsids())
|
||||||
|
.append("showMoney", getShowMoney())
|
||||||
|
.append("realMoney", getRealMoney())
|
||||||
|
.append("showimage", getShowimage())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("creattime", getCreattime())
|
||||||
|
.append("createdAt", getCreatedAt())
|
||||||
|
.append("updatedAt", getUpdatedAt())
|
||||||
|
.append("type", getType())
|
||||||
|
.append("num", getNum())
|
||||||
|
.append("allnum", getAllnum())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡使用对象 user_use_secondary_card
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
public class UserUseSecondaryCard extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 用户id */
|
||||||
|
@Excel(name = "用户id")
|
||||||
|
private Long uid;
|
||||||
|
|
||||||
|
/** 次卡id */
|
||||||
|
@Excel(name = "次卡id")
|
||||||
|
private String carid;
|
||||||
|
|
||||||
|
/** 服务id */
|
||||||
|
@Excel(name = "服务id")
|
||||||
|
private String goodsids;
|
||||||
|
|
||||||
|
/** 用户可用数量 */
|
||||||
|
@Excel(name = "用户可用数量")
|
||||||
|
private Long num;
|
||||||
|
|
||||||
|
/** 用户已用数量 */
|
||||||
|
@Excel(name = "用户已用数量")
|
||||||
|
private Long usenum;
|
||||||
|
|
||||||
|
/** 订单id */
|
||||||
|
@Excel(name = "订单id")
|
||||||
|
private String orderid;
|
||||||
|
|
||||||
|
/** 支付id */
|
||||||
|
@Excel(name = "支付id")
|
||||||
|
private String transactionId;
|
||||||
|
|
||||||
|
/** 支付金额 */
|
||||||
|
@Excel(name = "支付金额")
|
||||||
|
private BigDecimal paymoney;
|
||||||
|
|
||||||
|
/** 状态 1可用 2已用完 3已退款 */
|
||||||
|
@Excel(name = "状态 1可用 2已用完 3已退款")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Date createdAt;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Date updatedAt;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(Long uid)
|
||||||
|
{
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUid()
|
||||||
|
{
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarid(String carid)
|
||||||
|
{
|
||||||
|
this.carid = carid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarid()
|
||||||
|
{
|
||||||
|
return carid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGoodsids(String goodsids)
|
||||||
|
{
|
||||||
|
this.goodsids = goodsids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGoodsids()
|
||||||
|
{
|
||||||
|
return goodsids;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNum(Long num)
|
||||||
|
{
|
||||||
|
this.num = num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getNum()
|
||||||
|
{
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsenum(Long usenum)
|
||||||
|
{
|
||||||
|
this.usenum = usenum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUsenum()
|
||||||
|
{
|
||||||
|
return usenum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderid(String orderid)
|
||||||
|
{
|
||||||
|
this.orderid = orderid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrderid()
|
||||||
|
{
|
||||||
|
return orderid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTransactionId(String transactionId)
|
||||||
|
{
|
||||||
|
this.transactionId = transactionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTransactionId()
|
||||||
|
{
|
||||||
|
return transactionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymoney(BigDecimal paymoney)
|
||||||
|
{
|
||||||
|
this.paymoney = paymoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPaymoney()
|
||||||
|
{
|
||||||
|
return paymoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Long status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getStatus()
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("uid", getUid())
|
||||||
|
.append("carid", getCarid())
|
||||||
|
.append("goodsids", getGoodsids())
|
||||||
|
.append("num", getNum())
|
||||||
|
.append("usenum", getUsenum())
|
||||||
|
.append("orderid", getOrderid())
|
||||||
|
.append("transactionId", getTransactionId())
|
||||||
|
.append("paymoney", getPaymoney())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("createdAt", getCreatedAt())
|
||||||
|
.append("updatedAt", getUpdatedAt())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.ruoyi.system.domain.ServiceGoods;
|
import com.ruoyi.system.domain.ServiceGoods;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -22,6 +24,15 @@ public interface ServiceGoodsMapper
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String selectTitlesJSONArrayByIds(@Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
public List<ServiceGoods> selectServiceGoodsfrocikaList(@Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String selectTitlesByIds(@Param("ids") List<String> ids);
|
public String selectTitlesByIds(@Param("ids") List<String> ids);
|
||||||
/**
|
/**
|
||||||
* 查询服务内容列表
|
* 查询服务内容列表
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.UserSecondaryCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
public interface UserSecondaryCardMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询次卡管理
|
||||||
|
*
|
||||||
|
* @param id 次卡管理主键
|
||||||
|
* @return 次卡管理
|
||||||
|
*/
|
||||||
|
public UserSecondaryCard selectUserSecondaryCardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡管理列表
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 次卡管理集合
|
||||||
|
*/
|
||||||
|
public List<UserSecondaryCard> selectUserSecondaryCardList(UserSecondaryCard userSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增次卡管理
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertUserSecondaryCard(UserSecondaryCard userSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改次卡管理
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUserSecondaryCard(UserSecondaryCard userSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除次卡管理
|
||||||
|
*
|
||||||
|
* @param id 次卡管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserSecondaryCardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除次卡管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserSecondaryCardByIds(Long[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.UserUseSecondaryCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡使用Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
public interface UserUseSecondaryCardMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询次卡使用
|
||||||
|
*
|
||||||
|
* @param id 次卡使用主键
|
||||||
|
* @return 次卡使用
|
||||||
|
*/
|
||||||
|
public UserUseSecondaryCard selectUserUseSecondaryCardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡使用列表
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 次卡使用集合
|
||||||
|
*/
|
||||||
|
public List<UserUseSecondaryCard> selectUserUseSecondaryCardList(UserUseSecondaryCard userUseSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增次卡使用
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertUserUseSecondaryCard(UserUseSecondaryCard userUseSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改次卡使用
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUserUseSecondaryCard(UserUseSecondaryCard userUseSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除次卡使用
|
||||||
|
*
|
||||||
|
* @param id 次卡使用主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserUseSecondaryCardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除次卡使用
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserUseSecondaryCardByIds(Long[] ids);
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.system.service;
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.ruoyi.system.domain.ServiceGoods;
|
import com.ruoyi.system.domain.ServiceGoods;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -37,6 +39,18 @@ public interface IServiceGoodsService
|
||||||
public String selectTitlesByIds(List<String> ids);
|
public String selectTitlesByIds(List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询服务内容列表
|
||||||
|
*
|
||||||
|
* @param ids 服务内容
|
||||||
|
* @return 服务内容集合
|
||||||
|
*/
|
||||||
|
public String selectTitlesJSONArrayByIds(List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
public List<ServiceGoods> selectServiceGoodsfrocikaList(List<String> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增服务内容
|
* 新增服务内容
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.UserSecondaryCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡管理Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
public interface IUserSecondaryCardService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询次卡管理
|
||||||
|
*
|
||||||
|
* @param id 次卡管理主键
|
||||||
|
* @return 次卡管理
|
||||||
|
*/
|
||||||
|
public UserSecondaryCard selectUserSecondaryCardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡管理列表
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 次卡管理集合
|
||||||
|
*/
|
||||||
|
public List<UserSecondaryCard> selectUserSecondaryCardList(UserSecondaryCard userSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增次卡管理
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertUserSecondaryCard(UserSecondaryCard userSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改次卡管理
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUserSecondaryCard(UserSecondaryCard userSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除次卡管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的次卡管理主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserSecondaryCardByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除次卡管理信息
|
||||||
|
*
|
||||||
|
* @param id 次卡管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserSecondaryCardById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.UserUseSecondaryCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡使用Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
public interface IUserUseSecondaryCardService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询次卡使用
|
||||||
|
*
|
||||||
|
* @param id 次卡使用主键
|
||||||
|
* @return 次卡使用
|
||||||
|
*/
|
||||||
|
public UserUseSecondaryCard selectUserUseSecondaryCardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡使用列表
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 次卡使用集合
|
||||||
|
*/
|
||||||
|
public List<UserUseSecondaryCard> selectUserUseSecondaryCardList(UserUseSecondaryCard userUseSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增次卡使用
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertUserUseSecondaryCard(UserUseSecondaryCard userUseSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改次卡使用
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUserUseSecondaryCard(UserUseSecondaryCard userUseSecondaryCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除次卡使用
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的次卡使用主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserUseSecondaryCardByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除次卡使用信息
|
||||||
|
*
|
||||||
|
* @param id 次卡使用主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUserUseSecondaryCardById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -55,6 +56,22 @@ public class ServiceGoodsServiceImpl implements IServiceGoodsService
|
||||||
return serviceGoodsMapper.selectServiceGoodsList(serviceGoods);
|
return serviceGoodsMapper.selectServiceGoodsList(serviceGoods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询服务内容列表
|
||||||
|
*
|
||||||
|
* @param ids 服务内容
|
||||||
|
* @return 服务内容集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String selectTitlesJSONArrayByIds(List<String> ids){
|
||||||
|
return serviceGoodsMapper.selectTitlesJSONArrayByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ServiceGoods> selectServiceGoodsfrocikaList(List<String> ids) {
|
||||||
|
return serviceGoodsMapper.selectServiceGoodsfrocikaList(ids);
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 新增服务内容
|
* 新增服务内容
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.mapper.UserSecondaryCardMapper;
|
||||||
|
import com.ruoyi.system.domain.UserSecondaryCard;
|
||||||
|
import com.ruoyi.system.service.IUserSecondaryCardService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class UserSecondaryCardServiceImpl implements IUserSecondaryCardService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private UserSecondaryCardMapper userSecondaryCardMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡管理
|
||||||
|
*
|
||||||
|
* @param id 次卡管理主键
|
||||||
|
* @return 次卡管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public UserSecondaryCard selectUserSecondaryCardById(Long id)
|
||||||
|
{
|
||||||
|
return userSecondaryCardMapper.selectUserSecondaryCardById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡管理列表
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 次卡管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<UserSecondaryCard> selectUserSecondaryCardList(UserSecondaryCard userSecondaryCard)
|
||||||
|
{
|
||||||
|
return userSecondaryCardMapper.selectUserSecondaryCardList(userSecondaryCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增次卡管理
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertUserSecondaryCard(UserSecondaryCard userSecondaryCard)
|
||||||
|
{
|
||||||
|
return userSecondaryCardMapper.insertUserSecondaryCard(userSecondaryCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改次卡管理
|
||||||
|
*
|
||||||
|
* @param userSecondaryCard 次卡管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateUserSecondaryCard(UserSecondaryCard userSecondaryCard)
|
||||||
|
{
|
||||||
|
return userSecondaryCardMapper.updateUserSecondaryCard(userSecondaryCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除次卡管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的次卡管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteUserSecondaryCardByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return userSecondaryCardMapper.deleteUserSecondaryCardByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除次卡管理信息
|
||||||
|
*
|
||||||
|
* @param id 次卡管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteUserSecondaryCardById(Long id)
|
||||||
|
{
|
||||||
|
return userSecondaryCardMapper.deleteUserSecondaryCardById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.mapper.UserUseSecondaryCardMapper;
|
||||||
|
import com.ruoyi.system.domain.UserUseSecondaryCard;
|
||||||
|
import com.ruoyi.system.service.IUserUseSecondaryCardService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 次卡使用Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2025-07-02
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class UserUseSecondaryCardServiceImpl implements IUserUseSecondaryCardService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private UserUseSecondaryCardMapper userUseSecondaryCardMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡使用
|
||||||
|
*
|
||||||
|
* @param id 次卡使用主键
|
||||||
|
* @return 次卡使用
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public UserUseSecondaryCard selectUserUseSecondaryCardById(Long id)
|
||||||
|
{
|
||||||
|
return userUseSecondaryCardMapper.selectUserUseSecondaryCardById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询次卡使用列表
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 次卡使用
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<UserUseSecondaryCard> selectUserUseSecondaryCardList(UserUseSecondaryCard userUseSecondaryCard)
|
||||||
|
{
|
||||||
|
return userUseSecondaryCardMapper.selectUserUseSecondaryCardList(userUseSecondaryCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增次卡使用
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertUserUseSecondaryCard(UserUseSecondaryCard userUseSecondaryCard)
|
||||||
|
{
|
||||||
|
return userUseSecondaryCardMapper.insertUserUseSecondaryCard(userUseSecondaryCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改次卡使用
|
||||||
|
*
|
||||||
|
* @param userUseSecondaryCard 次卡使用
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateUserUseSecondaryCard(UserUseSecondaryCard userUseSecondaryCard)
|
||||||
|
{
|
||||||
|
return userUseSecondaryCardMapper.updateUserUseSecondaryCard(userUseSecondaryCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除次卡使用
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的次卡使用主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteUserUseSecondaryCardByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return userUseSecondaryCardMapper.deleteUserUseSecondaryCardByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除次卡使用信息
|
||||||
|
*
|
||||||
|
* @param id 次卡使用主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteUserUseSecondaryCardById(Long id)
|
||||||
|
{
|
||||||
|
return userUseSecondaryCardMapper.deleteUserUseSecondaryCardById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,12 +16,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="numType" column="num_type" />
|
<result property="numType" column="num_type" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="workerId" column="worker_id" />
|
<result property="workerId" column="worker_id" />
|
||||||
|
<result property="labels" column="labels" />
|
||||||
|
|
||||||
<result property="createdAt" column="created_at" />
|
<result property="createdAt" column="created_at" />
|
||||||
<result property="updatedAt" column="updated_at" />
|
<result property="updatedAt" column="updated_at" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectOrderCommentVo">
|
<sql id="selectOrderCommentVo">
|
||||||
select id, oid, order_id, product_id, uid, images, content, num, num_type, status, worker_id, created_at, updated_at from order_comment
|
select id, oid, order_id, product_id, uid, images, content, num, num_type, status,labels, worker_id, created_at, updated_at from order_comment
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectCountOrderCommentByOid" parameterType="Long" resultType="Integer">
|
<select id="selectCountOrderCommentByOid" parameterType="Long" resultType="Integer">
|
||||||
select count(0) from order_comment where oid= #{oid}
|
select count(0) from order_comment where oid= #{oid}
|
||||||
|
|
@ -67,6 +69,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="numType != null">num_type,</if>
|
<if test="numType != null">num_type,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
<if test="workerId != null">worker_id,</if>
|
<if test="workerId != null">worker_id,</if>
|
||||||
|
<if test="labels != null">labels,</if>
|
||||||
|
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
</trim>
|
</trim>
|
||||||
|
|
@ -81,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="numType != null">#{numType},</if>
|
<if test="numType != null">#{numType},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="workerId != null">#{workerId},</if>
|
<if test="workerId != null">#{workerId},</if>
|
||||||
|
<if test="labels != null">#{labels},</if>
|
||||||
NOW(),
|
NOW(),
|
||||||
NOW()
|
NOW()
|
||||||
</trim>
|
</trim>
|
||||||
|
|
@ -96,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="images != null">images = #{images},</if>
|
<if test="images != null">images = #{images},</if>
|
||||||
<if test="content != null and content != ''">content = #{content},</if>
|
<if test="content != null and content != ''">content = #{content},</if>
|
||||||
<if test="num != null">num = #{num},</if>
|
<if test="num != null">num = #{num},</if>
|
||||||
|
<if test="labels != null">labels = #{labels},</if>
|
||||||
|
|
||||||
<if test="numType != null">num_type = #{numType},</if>
|
<if test="numType != null">num_type = #{numType},</if>
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">status = #{status},</if>
|
||||||
<if test="workerId != null">worker_id = #{workerId},</if>
|
<if test="workerId != null">worker_id = #{workerId},</if>
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="description" column="description" />
|
<result property="description" column="description" />
|
||||||
<result property="skuType" column="sku_type" />
|
<result property="skuType" column="sku_type" />
|
||||||
<result property="sku" column="sku" />
|
<result property="sku" column="sku" />
|
||||||
|
<result property="servicetype" column="servicetype" />
|
||||||
|
|
||||||
|
<result property="questions" column="questions" />
|
||||||
|
|
||||||
<result property="latitude" column="latitude" />
|
<result property="latitude" column="latitude" />
|
||||||
<result property="longitude" column="longitude" />
|
<result property="longitude" column="longitude" />
|
||||||
<result property="type" column="type" />
|
<result property="type" column="type" />
|
||||||
|
|
@ -47,7 +51,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, price_zn, sales, 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, 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">
|
||||||
|
|
@ -69,6 +73,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by id desc
|
order by id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectServiceGoodsfrocikaList" parameterType="java.util.List" resultMap="ServiceGoodsResult">
|
||||||
|
<include refid="selectServiceGoodsVo"/>
|
||||||
|
id IN
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
order by created_at desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectTitlesByIds" parameterType="list" resultType="string">
|
<select id="selectTitlesByIds" parameterType="list" resultType="string">
|
||||||
SELECT GROUP_CONCAT(title SEPARATOR '|') FROM service_goods
|
SELECT GROUP_CONCAT(title SEPARATOR '|') FROM service_goods
|
||||||
WHERE id IN
|
WHERE id IN
|
||||||
|
|
@ -77,6 +95,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTitlesJSONArrayByIds" parameterType="java.util.List" resultType="string">
|
||||||
|
SELECT GROUP_CONCAT(title SEPARATOR '|') FROM service_goods
|
||||||
|
WHERE id IN
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectServiceGoodsById" parameterType="Long" resultMap="ServiceGoodsResult">
|
<select id="selectServiceGoodsById" parameterType="Long" resultMap="ServiceGoodsResult">
|
||||||
<include refid="selectServiceGoodsVo"/>
|
<include refid="selectServiceGoodsVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
|
@ -122,6 +149,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isfixed != null">isfixed,</if>
|
<if test="isfixed != null">isfixed,</if>
|
||||||
<if test="fixedprice != null">fixedprice,</if>
|
<if test="fixedprice != null">fixedprice,</if>
|
||||||
<if test="groupnum != null">groupnum,</if>
|
<if test="groupnum != null">groupnum,</if>
|
||||||
|
<if test="servicetype != null">servicetype,</if>
|
||||||
|
<if test="questions != null">questions,</if>
|
||||||
|
|
||||||
created_at,
|
created_at,
|
||||||
updated_at
|
updated_at
|
||||||
|
|
@ -164,8 +193,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="isfixed != null">#{isfixed},</if>
|
<if test="isfixed != null">#{isfixed},</if>
|
||||||
<if test="fixedprice != null">#{fixedprice},</if>
|
<if test="fixedprice != null">#{fixedprice},</if>
|
||||||
<if test="groupnum != null">#{groupnum},</if>
|
<if test="groupnum != null">#{groupnum},</if>
|
||||||
|
<if test="servicetype != null">#{servicetype},</if>
|
||||||
|
<if test="questions != null">#{questions},</if>
|
||||||
NOW(),
|
NOW(),
|
||||||
NOW()
|
NOW()
|
||||||
|
|
||||||
|
|
@ -204,6 +233,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="groupprice != null">groupprice = #{groupprice},</if>
|
<if test="groupprice != null">groupprice = #{groupprice},</if>
|
||||||
<if test="isonce != null">isonce = #{isonce},</if>
|
<if test="isonce != null">isonce = #{isonce},</if>
|
||||||
<if test="onceprice != null">onceprice = #{onceprice},</if>
|
<if test="onceprice != null">onceprice = #{onceprice},</if>
|
||||||
|
<if test="servicetype != null">servicetype = #{servicetype},</if>
|
||||||
|
<if test="questions != null">questions = #{questions},</if>
|
||||||
|
|
||||||
<if test="commissiontype != null">commissiontype = #{commissiontype},</if>
|
<if test="commissiontype != null">commissiontype = #{commissiontype},</if>
|
||||||
<if test="commission != null">commission = #{commission},</if>
|
<if test="commission != null">commission = #{commission},</if>
|
||||||
<if test="dispatchtype != null">dispatchtype = #{dispatchtype},</if>
|
<if test="dispatchtype != null">dispatchtype = #{dispatchtype},</if>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.UserSecondaryCardMapper">
|
||||||
|
|
||||||
|
<resultMap type="UserSecondaryCard" id="UserSecondaryCardResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="orderid" column="orderid" />
|
||||||
|
<result property="title" column="title" />
|
||||||
|
<result property="goodsids" column="goodsids" />
|
||||||
|
<result property="showMoney" column="show_money" />
|
||||||
|
<result property="realMoney" column="real_money" />
|
||||||
|
<result property="showimage" column="showimage" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="creattime" column="creattime" />
|
||||||
|
<result property="createdAt" column="created_at" />
|
||||||
|
<result property="updatedAt" column="updated_at" />
|
||||||
|
<result property="type" column="type" />
|
||||||
|
<result property="num" column="num" />
|
||||||
|
<result property="allnum" column="allnum" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectUserSecondaryCardVo">
|
||||||
|
select id, orderid, title, goodsids, show_money, real_money, showimage, status, creattime, created_at, updated_at, type, num, allnum from user_secondary_card
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectUserSecondaryCardList" parameterType="UserSecondaryCard" resultMap="UserSecondaryCardResult">
|
||||||
|
<include refid="selectUserSecondaryCardVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="orderid != null and orderid != ''"> and orderid = #{orderid}</if>
|
||||||
|
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||||
|
<if test="goodsids != null and goodsids != ''"> and goodsids = #{goodsids}</if>
|
||||||
|
<if test="showMoney != null "> and show_money = #{showMoney}</if>
|
||||||
|
<if test="realMoney != null "> and real_money = #{realMoney}</if>
|
||||||
|
<if test="showimage != null and showimage != ''"> and showimage = #{showimage}</if>
|
||||||
|
<if test="status != null "> and status = #{status}</if>
|
||||||
|
<if test="creattime != null "> and creattime = #{creattime}</if>
|
||||||
|
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||||
|
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||||
|
<if test="type != null "> and type = #{type}</if>
|
||||||
|
<if test="num != null "> and num = #{num}</if>
|
||||||
|
<if test="allnum != null "> and allnum = #{allnum}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectUserSecondaryCardById" parameterType="Long" resultMap="UserSecondaryCardResult">
|
||||||
|
<include refid="selectUserSecondaryCardVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertUserSecondaryCard" parameterType="UserSecondaryCard">
|
||||||
|
insert into user_secondary_card
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderid != null">orderid,</if>
|
||||||
|
<if test="title != null">title,</if>
|
||||||
|
<if test="goodsids != null">goodsids,</if>
|
||||||
|
<if test="showMoney != null">show_money,</if>
|
||||||
|
<if test="realMoney != null">real_money,</if>
|
||||||
|
<if test="showimage != null">showimage,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="creattime != null">creattime,</if>
|
||||||
|
<if test="createdAt != null">created_at,</if>
|
||||||
|
<if test="updatedAt != null">updated_at,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
|
<if test="num != null">num,</if>
|
||||||
|
<if test="allnum != null">allnum,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderid != null">#{orderid},</if>
|
||||||
|
<if test="title != null">#{title},</if>
|
||||||
|
<if test="goodsids != null">#{goodsids},</if>
|
||||||
|
<if test="showMoney != null">#{showMoney},</if>
|
||||||
|
<if test="realMoney != null">#{realMoney},</if>
|
||||||
|
<if test="showimage != null">#{showimage},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="creattime != null">#{creattime},</if>
|
||||||
|
<if test="createdAt != null">#{createdAt},</if>
|
||||||
|
<if test="updatedAt != null">#{updatedAt},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="num != null">#{num},</if>
|
||||||
|
<if test="allnum != null">#{allnum},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateUserSecondaryCard" parameterType="UserSecondaryCard">
|
||||||
|
update user_secondary_card
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="orderid != null">orderid = #{orderid},</if>
|
||||||
|
<if test="title != null">title = #{title},</if>
|
||||||
|
<if test="goodsids != null">goodsids = #{goodsids},</if>
|
||||||
|
<if test="showMoney != null">show_money = #{showMoney},</if>
|
||||||
|
<if test="realMoney != null">real_money = #{realMoney},</if>
|
||||||
|
<if test="showimage != null">showimage = #{showimage},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="creattime != null">creattime = #{creattime},</if>
|
||||||
|
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||||
|
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||||
|
<if test="type != null">type = #{type},</if>
|
||||||
|
<if test="num != null">num = #{num},</if>
|
||||||
|
<if test="allnum != null">allnum = #{allnum},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteUserSecondaryCardById" parameterType="Long">
|
||||||
|
delete from user_secondary_card where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteUserSecondaryCardByIds" parameterType="String">
|
||||||
|
delete from user_secondary_card where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.UserUseSecondaryCardMapper">
|
||||||
|
|
||||||
|
<resultMap type="UserUseSecondaryCard" id="UserUseSecondaryCardResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="uid" column="uid" />
|
||||||
|
<result property="carid" column="carid" />
|
||||||
|
<result property="goodsids" column="goodsids" />
|
||||||
|
<result property="num" column="num" />
|
||||||
|
<result property="usenum" column="usenum" />
|
||||||
|
<result property="orderid" column="orderid" />
|
||||||
|
<result property="transactionId" column="transaction_id" />
|
||||||
|
<result property="paymoney" column="paymoney" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="createdAt" column="created_at" />
|
||||||
|
<result property="updatedAt" column="updated_at" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectUserUseSecondaryCardVo">
|
||||||
|
select id, uid, carid, goodsids, num, usenum, orderid, transaction_id, paymoney, status, created_at, updated_at from user_use_secondary_card
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectUserUseSecondaryCardList" parameterType="UserUseSecondaryCard" resultMap="UserUseSecondaryCardResult">
|
||||||
|
<include refid="selectUserUseSecondaryCardVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="uid != null "> and uid = #{uid}</if>
|
||||||
|
<if test="carid != null and carid != ''"> and carid = #{carid}</if>
|
||||||
|
<if test="goodsids != null and goodsids != ''"> and goodsids = #{goodsids}</if>
|
||||||
|
<if test="num != null "> and num = #{num}</if>
|
||||||
|
<if test="usenum != null "> and usenum = #{usenum}</if>
|
||||||
|
<if test="orderid != null and orderid != ''"> and orderid = #{orderid}</if>
|
||||||
|
<if test="transactionId != null and transactionId != ''"> and transaction_id = #{transactionId}</if>
|
||||||
|
<if test="paymoney != null "> and paymoney = #{paymoney}</if>
|
||||||
|
<if test="status != null "> and status = #{status}</if>
|
||||||
|
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||||
|
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectUserUseSecondaryCardById" parameterType="Long" resultMap="UserUseSecondaryCardResult">
|
||||||
|
<include refid="selectUserUseSecondaryCardVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertUserUseSecondaryCard" parameterType="UserUseSecondaryCard" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into user_use_secondary_card
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="uid != null">uid,</if>
|
||||||
|
<if test="carid != null">carid,</if>
|
||||||
|
<if test="goodsids != null">goodsids,</if>
|
||||||
|
<if test="num != null">num,</if>
|
||||||
|
<if test="usenum != null">usenum,</if>
|
||||||
|
<if test="orderid != null">orderid,</if>
|
||||||
|
<if test="transactionId != null">transaction_id,</if>
|
||||||
|
<if test="paymoney != null">paymoney,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="createdAt != null">created_at,</if>
|
||||||
|
<if test="updatedAt != null">updated_at,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="uid != null">#{uid},</if>
|
||||||
|
<if test="carid != null">#{carid},</if>
|
||||||
|
<if test="goodsids != null">#{goodsids},</if>
|
||||||
|
<if test="num != null">#{num},</if>
|
||||||
|
<if test="usenum != null">#{usenum},</if>
|
||||||
|
<if test="orderid != null">#{orderid},</if>
|
||||||
|
<if test="transactionId != null">#{transactionId},</if>
|
||||||
|
<if test="paymoney != null">#{paymoney},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="createdAt != null">#{createdAt},</if>
|
||||||
|
<if test="updatedAt != null">#{updatedAt},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateUserUseSecondaryCard" parameterType="UserUseSecondaryCard">
|
||||||
|
update user_use_secondary_card
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="uid != null">uid = #{uid},</if>
|
||||||
|
<if test="carid != null">carid = #{carid},</if>
|
||||||
|
<if test="goodsids != null">goodsids = #{goodsids},</if>
|
||||||
|
<if test="num != null">num = #{num},</if>
|
||||||
|
<if test="usenum != null">usenum = #{usenum},</if>
|
||||||
|
<if test="orderid != null">orderid = #{orderid},</if>
|
||||||
|
<if test="transactionId != null">transaction_id = #{transactionId},</if>
|
||||||
|
<if test="paymoney != null">paymoney = #{paymoney},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||||
|
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteUserUseSecondaryCardById" parameterType="Long">
|
||||||
|
delete from user_use_secondary_card where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteUserUseSecondaryCardByIds" parameterType="String">
|
||||||
|
delete from user_use_secondary_card where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询次卡管理列表
|
||||||
|
export function listUserSecondaryCard(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserSecondaryCard/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询服务内容详细
|
||||||
|
export function getServiceGoods(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/ServiceGoods/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询服务内容详细
|
||||||
|
export function selectList() {
|
||||||
|
return request({
|
||||||
|
url: '/system/ServiceGoods/selectList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询服务内容详细
|
||||||
|
export function selectServiceCateList() {
|
||||||
|
return request({
|
||||||
|
url: '/system/ServiceGoods/selectServiceCateList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询次卡管理详细
|
||||||
|
export function getUserSecondaryCard(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserSecondaryCard/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增次卡管理
|
||||||
|
export function addUserSecondaryCard(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserSecondaryCard',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改次卡管理
|
||||||
|
export function updateUserSecondaryCard(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserSecondaryCard',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除次卡管理
|
||||||
|
export function delUserSecondaryCard(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserSecondaryCard/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询次卡使用列表
|
||||||
|
export function listUserUseSecondaryCard(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserUseSecondaryCard/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询次卡使用详细
|
||||||
|
export function getUserUseSecondaryCard(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserUseSecondaryCard/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增次卡使用
|
||||||
|
export function addUserUseSecondaryCard(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserUseSecondaryCard',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改次卡使用
|
||||||
|
export function updateUserUseSecondaryCard(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserUseSecondaryCard',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除次卡使用
|
||||||
|
export function delUserUseSecondaryCard(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/UserUseSecondaryCard/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div @click="openDialog" style="cursor:pointer;">
|
||||||
|
<el-input
|
||||||
|
v-model="displayNames"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
readonly
|
||||||
|
:clearable="clearable"
|
||||||
|
@clear="clearSelection"
|
||||||
|
>
|
||||||
|
<template slot="suffix">
|
||||||
|
<i class="el-icon-search"></i>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="900px" append-to-body>
|
||||||
|
<el-form :model="queryParams" :inline="true" label-width="60px">
|
||||||
|
<el-form-item label="标题">
|
||||||
|
<el-input v-model="queryParams.title" placeholder="请输入标题" clearable size="small" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="serviceList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
:row-key="row=>row.id"
|
||||||
|
:default-selection="defaultSelection"
|
||||||
|
style="width: 100%; margin-top: 15px;"
|
||||||
|
max-height="400px"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="ID" prop="id" width="60" align="center" />
|
||||||
|
<el-table-column label="标题" prop="title" min-width="120" />
|
||||||
|
<el-table-column label="价格" prop="price" width="80" align="center" />
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
style="margin-top: 15px; margin-bottom: 10px;"
|
||||||
|
class="text-center"
|
||||||
|
/>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="confirmSelection">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listServiceGoods } from '@/api/system/ServiceGoods'
|
||||||
|
export default {
|
||||||
|
name: 'ServiceGoodsSelect',
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: [Array, String],
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: '请选择服务项目'
|
||||||
|
},
|
||||||
|
clearable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
dialogTitle: {
|
||||||
|
type: String,
|
||||||
|
default: '选择服务项目'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
loading: false,
|
||||||
|
serviceList: [],
|
||||||
|
total: 0,
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
selected: [],
|
||||||
|
defaultSelection: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
displayNames() {
|
||||||
|
return this.selected.map(item => item.title).join(', ')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value: {
|
||||||
|
handler(val) {
|
||||||
|
if (Array.isArray(val)) {
|
||||||
|
this.selected = this.serviceList.filter(item => val.includes(item.id))
|
||||||
|
} else if (typeof val === 'string' && val) {
|
||||||
|
const ids = val.split(',')
|
||||||
|
this.selected = this.serviceList.filter(item => ids.includes(String(item.id)))
|
||||||
|
} else {
|
||||||
|
this.selected = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openDialog() {
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listServiceGoods(this.queryParams).then(res => {
|
||||||
|
this.serviceList = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
// 回显已选
|
||||||
|
if (this.value) {
|
||||||
|
let ids = Array.isArray(this.value) ? this.value : (this.value ? this.value.split(',') : [])
|
||||||
|
this.defaultSelection = this.serviceList.filter(item => ids.includes(String(item.id)))
|
||||||
|
}
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.queryParams.title = ''
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
// 去重,按id唯一
|
||||||
|
const map = new Map()
|
||||||
|
val.forEach(item => {
|
||||||
|
map.set(item.id, item)
|
||||||
|
})
|
||||||
|
this.selected = Array.from(map.values())
|
||||||
|
},
|
||||||
|
confirmSelection() {
|
||||||
|
const ids = this.selected.map(item => item.id)
|
||||||
|
this.$emit('input', ids)
|
||||||
|
this.dialogVisible = false
|
||||||
|
},
|
||||||
|
clearSelection() {
|
||||||
|
this.selected = []
|
||||||
|
this.$emit('input', [])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -299,6 +299,33 @@
|
||||||
<editor v-model="form.material" :min-height="200" />
|
<editor v-model="form.material" :min-height="200" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
|
<el-tab-pane label="问答配置" name="qa">
|
||||||
|
<div class="qa-container">
|
||||||
|
<div class="qa-header">
|
||||||
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addQuestion">添加问答</el-button>
|
||||||
|
</div>
|
||||||
|
<div v-for="(qa, index) in form.questionsArray" :key="index" class="qa-item">
|
||||||
|
<div class="qa-item-header">
|
||||||
|
<span class="qa-index">问答 #{{index + 1}}</span>
|
||||||
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="removeQuestion(index)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label="'问题'" :prop="'questionsArray.' + index + '.question'" :rules="[{required: true, message: '问题不能为空', trigger: 'blur'}]" label-width="50px">
|
||||||
|
<el-input v-model="qa.question" placeholder="请输入问题" size="small" @input="handleQuestionChange"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label="'答案'" :prop="'questionsArray.' + index + '.answer'" :rules="[{required: true, message: '答案不能为空', trigger: 'blur'}]" label-width="50px">
|
||||||
|
<el-input type="textarea" v-model="qa.answer" :rows="2" placeholder="请输入答案" size="small" @input="handleQuestionChange"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
@ -412,6 +439,7 @@ export default {
|
||||||
skuList: [ { name: '', value: '' } ],
|
skuList: [ { name: '', value: '' } ],
|
||||||
specList: [ { name: '', values: [''] } ],
|
specList: [ { name: '', values: [''] } ],
|
||||||
skuTable: [],
|
skuTable: [],
|
||||||
|
saveTimeout: null, // 用于防抖的定时器
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -454,10 +482,10 @@ export default {
|
||||||
skuValue: null,
|
skuValue: null,
|
||||||
latitude: null,
|
latitude: null,
|
||||||
longitude: null,
|
longitude: null,
|
||||||
type: 2, // 默认为商品类型
|
type: 2,
|
||||||
cateId: null,
|
cateId: null,
|
||||||
project: null,
|
project: null,
|
||||||
sort: 50, // 默认排序值
|
sort: 50,
|
||||||
material: null,
|
material: null,
|
||||||
postage: null,
|
postage: null,
|
||||||
basic: null,
|
basic: null,
|
||||||
|
|
@ -465,7 +493,9 @@ export default {
|
||||||
skillIds: null,
|
skillIds: null,
|
||||||
createdAt: null,
|
createdAt: null,
|
||||||
updatedAt: null,
|
updatedAt: null,
|
||||||
deletedAt: null
|
deletedAt: null,
|
||||||
|
questionsArray: [], // 问答数组
|
||||||
|
questions: null, // 问答JSON字符串
|
||||||
}
|
}
|
||||||
// 重置skuType为默认值
|
// 重置skuType为默认值
|
||||||
this.skuType = 1;
|
this.skuType = 1;
|
||||||
|
|
@ -524,6 +554,24 @@ export default {
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids
|
||||||
getServiceGoods(id).then(response => {
|
getServiceGoods(id).then(response => {
|
||||||
this.form = response.data
|
this.form = response.data
|
||||||
|
|
||||||
|
// 处理问答数据
|
||||||
|
if (this.form.questions) {
|
||||||
|
try {
|
||||||
|
const questionsArray = JSON.parse(this.form.questions);
|
||||||
|
if (Array.isArray(questionsArray)) {
|
||||||
|
this.$set(this.form, 'questionsArray', questionsArray);
|
||||||
|
} else {
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('问答数据解析失败:', e);
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
|
}
|
||||||
|
|
||||||
// 设置skuType,如果没有则默认为1
|
// 设置skuType,如果没有则默认为1
|
||||||
this.skuType = this.form.skuType || 1;
|
this.skuType = this.form.skuType || 1;
|
||||||
// 如果是单规格且sku有数据,尝试解析
|
// 如果是单规格且sku有数据,尝试解析
|
||||||
|
|
@ -544,6 +592,21 @@ export default {
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
// 处理问答数据
|
||||||
|
if (this.form.questionsArray && Array.isArray(this.form.questionsArray)) {
|
||||||
|
const validQuestions = this.form.questionsArray.filter(qa =>
|
||||||
|
qa && qa.question && qa.question.trim() && qa.answer && qa.answer.trim()
|
||||||
|
).map(qa => ({
|
||||||
|
question: qa.question.trim(),
|
||||||
|
answer: qa.answer.trim()
|
||||||
|
}));
|
||||||
|
this.form.questions = validQuestions.length > 0 ? JSON.stringify(validQuestions) : null;
|
||||||
|
} else {
|
||||||
|
this.form.questions = null;
|
||||||
|
}
|
||||||
|
|
||||||
// 设置规格类型
|
// 设置规格类型
|
||||||
this.form.skuType = this.skuType;
|
this.form.skuType = this.skuType;
|
||||||
|
|
||||||
|
|
@ -580,8 +643,6 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateServiceGoods(this.form).then(response => {
|
updateServiceGoods(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
|
@ -726,6 +787,125 @@ export default {
|
||||||
removeSkuImage(idx) {
|
removeSkuImage(idx) {
|
||||||
this.$set(this.skuTable[idx], 'imageUrl', '');
|
this.$set(this.skuTable[idx], 'imageUrl', '');
|
||||||
},
|
},
|
||||||
|
// 添加问答
|
||||||
|
addQuestion() {
|
||||||
|
if (!this.form.questionsArray) {
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
|
}
|
||||||
|
this.form.questionsArray.push({
|
||||||
|
question: '',
|
||||||
|
answer: ''
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除问答
|
||||||
|
removeQuestion(index) {
|
||||||
|
this.form.questionsArray.splice(index, 1);
|
||||||
|
// 删除后延迟触发保存
|
||||||
|
this.handleQuestionChange();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 静默保存方法
|
||||||
|
async silentSave() {
|
||||||
|
try {
|
||||||
|
// 验证是否有有效的问答数据需要保存
|
||||||
|
if (!this.form.questionsArray || !Array.isArray(this.form.questionsArray)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是新增状态,不进行静默保存
|
||||||
|
if (!this.form.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤出有效的问答数据(问题和答案都不为空)
|
||||||
|
const validQuestions = this.form.questionsArray.filter(qa =>
|
||||||
|
qa && qa.question && qa.question.trim() && qa.answer && qa.answer.trim()
|
||||||
|
).map(qa => ({
|
||||||
|
question: qa.question.trim(),
|
||||||
|
answer: qa.answer.trim()
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 准备保存的数据
|
||||||
|
const submitData = {
|
||||||
|
id: this.form.id,
|
||||||
|
questions: JSON.stringify(validQuestions)
|
||||||
|
};
|
||||||
|
|
||||||
|
// 调用更新接口
|
||||||
|
await updateServiceGoods(submitData);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('问答数据静默保存失败:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 监听问答数据变化
|
||||||
|
handleQuestionChange() {
|
||||||
|
// 使用防抖进行静默保存
|
||||||
|
if (this.saveTimeout) {
|
||||||
|
clearTimeout(this.saveTimeout);
|
||||||
|
}
|
||||||
|
this.saveTimeout = setTimeout(() => {
|
||||||
|
this.silentSave();
|
||||||
|
}, 1000); // 1秒后进行保存
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 问答样式 */
|
||||||
|
.qa-container {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-header {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #EBEEF5;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item:hover {
|
||||||
|
box-shadow: 0 2px 8px 0 rgba(0,0,0,.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-index {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-form-item) {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-form-item__label) {
|
||||||
|
padding: 0 5px 0 0;
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-form-item__content) {
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-textarea__inner) {
|
||||||
|
padding: 5px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-divider--horizontal) {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -376,6 +376,18 @@
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="下单类型" prop="servicetype">
|
||||||
|
<el-radio-group v-model="form.servicetype">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.servicetype"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="parseInt(dict.value)"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="是否可拼团" prop="isgroup">
|
<el-form-item label="是否可拼团" prop="isgroup">
|
||||||
<el-radio-group v-model="form.isgroup">
|
<el-radio-group v-model="form.isgroup">
|
||||||
<el-radio
|
<el-radio
|
||||||
|
|
@ -489,6 +501,33 @@
|
||||||
<editor v-model="form.material" :min-height="200" />
|
<editor v-model="form.material" :min-height="200" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
|
<el-tab-pane label="问答配置" name="qa">
|
||||||
|
<div class="qa-container">
|
||||||
|
<div class="qa-header">
|
||||||
|
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addQuestion">添加问答</el-button>
|
||||||
|
</div>
|
||||||
|
<div v-for="(qa, index) in form.questionsArray" :key="index" class="qa-item">
|
||||||
|
<div class="qa-item-header">
|
||||||
|
<span class="qa-index">问答 #{{index + 1}}</span>
|
||||||
|
<el-button type="danger" size="mini" icon="el-icon-delete" @click="removeQuestion(index)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label="'问题'" :prop="'questionsArray.' + index + '.question'" :rules="[{required: true, message: '问题不能为空', trigger: 'blur'}]" label-width="50px">
|
||||||
|
<el-input v-model="qa.question" placeholder="请输入问题" size="small" @input="handleQuestionChange"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label="'答案'" :prop="'questionsArray.' + index + '.answer'" :rules="[{required: true, message: '答案不能为空', trigger: 'blur'}]" label-width="50px">
|
||||||
|
<el-input type="textarea" v-model="qa.answer" :rows="2" placeholder="请输入答案" size="small" @input="handleQuestionChange"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
@ -524,7 +563,7 @@ import Editor from '@/components/Editor'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ServiceGoods",
|
name: "ServiceGoods",
|
||||||
dicts: ['service_goods_status', 'fixed', 'service_commissiontype', 'service_dispatch'],
|
dicts: ['service_goods_status', 'fixed', 'service_commissiontype', 'service_dispatch','servicetype'],
|
||||||
components: { Editor },
|
components: { Editor },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -570,7 +609,9 @@ export default {
|
||||||
project: null,
|
project: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {
|
||||||
|
questionsArray: [], // 问答数组
|
||||||
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
title: [
|
title: [
|
||||||
|
|
@ -613,6 +654,7 @@ export default {
|
||||||
// 基检现象标签相关
|
// 基检现象标签相关
|
||||||
showBasicInput: false,
|
showBasicInput: false,
|
||||||
newBasicTag: '',
|
newBasicTag: '',
|
||||||
|
saveTimeout: null, // 用于防抖的定时器
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -686,17 +728,17 @@ export default {
|
||||||
skuValue: '',
|
skuValue: '',
|
||||||
latitude: null,
|
latitude: null,
|
||||||
longitude: null,
|
longitude: null,
|
||||||
type: 1, // 默认为服务类型
|
type: 1,
|
||||||
cateId: null,
|
cateId: null,
|
||||||
project: null,
|
project: null,
|
||||||
sort: 50, // 默认排序值
|
sort: 50,
|
||||||
material: null,
|
material: null,
|
||||||
postage: null,
|
postage: null,
|
||||||
basic: null,
|
basic: null,
|
||||||
basicArray: [], // 基检现象数组
|
basicArray: [],
|
||||||
margin: null,
|
margin: null,
|
||||||
skillIds: null,
|
skillIds: null,
|
||||||
skillIdsArray: [], // 重置技能数组
|
skillIdsArray: [],
|
||||||
isgroup: 2,
|
isgroup: 2,
|
||||||
groupprice: null,
|
groupprice: null,
|
||||||
isonce: null,
|
isonce: null,
|
||||||
|
|
@ -705,12 +747,15 @@ export default {
|
||||||
commission: null,
|
commission: null,
|
||||||
dispatchtype: 1,
|
dispatchtype: 1,
|
||||||
workerids: null,
|
workerids: null,
|
||||||
|
servicetype: 1,
|
||||||
groupnum: 0,
|
groupnum: 0,
|
||||||
isfixed: 2,
|
isfixed: 2,
|
||||||
fixedprice: null,
|
fixedprice: null,
|
||||||
createdAt: null,
|
createdAt: null,
|
||||||
updatedAt: null,
|
updatedAt: null,
|
||||||
deletedAt: null
|
deletedAt: null,
|
||||||
|
questionsArray: [], // 问答数组
|
||||||
|
questions: null, // 问答JSON字符串
|
||||||
}
|
}
|
||||||
// 使用Vue.set确保响应式
|
// 使用Vue.set确保响应式
|
||||||
this.$set(this.form, 'skillIdsArray', []);
|
this.$set(this.form, 'skillIdsArray', []);
|
||||||
|
|
@ -787,6 +832,8 @@ export default {
|
||||||
this.newBasicTag = '';
|
this.newBasicTag = '';
|
||||||
// workerids 处理,新增时为空
|
// workerids 处理,新增时为空
|
||||||
this.form.workerids = [];
|
this.form.workerids = [];
|
||||||
|
// 初始化问答数组
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
console.log('新增时初始化form:', this.form);
|
console.log('新增时初始化form:', this.form);
|
||||||
|
|
||||||
// 验证技能列表是否已加载
|
// 验证技能列表是否已加载
|
||||||
|
|
@ -853,8 +900,24 @@ export default {
|
||||||
]).then(([serviceResponse, skillData]) => {
|
]).then(([serviceResponse, skillData]) => {
|
||||||
this.form = serviceResponse.data
|
this.form = serviceResponse.data
|
||||||
console.log('编辑数据:', this.form);
|
console.log('编辑数据:', this.form);
|
||||||
console.log('技能列表数据:', skillData);
|
|
||||||
console.log('原始基检现象数据:', this.form.basic);
|
// 处理问答数据
|
||||||
|
if (this.form.questions) {
|
||||||
|
try {
|
||||||
|
const questionsArray = JSON.parse(this.form.questions);
|
||||||
|
if (Array.isArray(questionsArray)) {
|
||||||
|
this.$set(this.form, 'questionsArray', questionsArray);
|
||||||
|
} else {
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('问答数据解析失败:', e);
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
|
}
|
||||||
|
|
||||||
// 处理技能ID转换:将JSON字符串或数组转为数组
|
// 处理技能ID转换:将JSON字符串或数组转为数组
|
||||||
if (this.form.skillIds) {
|
if (this.form.skillIds) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -1024,6 +1087,19 @@ export default {
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
// 处理问答数据
|
||||||
|
if (this.form.questionsArray && Array.isArray(this.form.questionsArray)) {
|
||||||
|
const validQuestions = this.form.questionsArray.filter(qa =>
|
||||||
|
qa && qa.question && qa.question.trim() && qa.answer && qa.answer.trim()
|
||||||
|
).map(qa => ({
|
||||||
|
question: qa.question.trim(),
|
||||||
|
answer: qa.answer.trim()
|
||||||
|
}));
|
||||||
|
this.form.questions = validQuestions.length > 0 ? JSON.stringify(validQuestions) : null;
|
||||||
|
} else {
|
||||||
|
this.form.questions = null;
|
||||||
|
}
|
||||||
|
|
||||||
// 设置规格类型
|
// 设置规格类型
|
||||||
this.form.skuType = this.skuType;
|
this.form.skuType = this.skuType;
|
||||||
|
|
||||||
|
|
@ -1448,6 +1524,79 @@ export default {
|
||||||
return '-'
|
return '-'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 添加问答
|
||||||
|
addQuestion() {
|
||||||
|
// 先保存现有数据
|
||||||
|
this.silentSave().then(() => {
|
||||||
|
if (!this.form.questionsArray) {
|
||||||
|
this.$set(this.form, 'questionsArray', []);
|
||||||
|
}
|
||||||
|
this.form.questionsArray.push({
|
||||||
|
question: '',
|
||||||
|
answer: ''
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除问答
|
||||||
|
removeQuestion(index) {
|
||||||
|
this.form.questionsArray.splice(index, 1);
|
||||||
|
// 删除后也进行静默保存
|
||||||
|
this.silentSave();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 静默保存方法
|
||||||
|
async silentSave() {
|
||||||
|
try {
|
||||||
|
// 验证是否有有效的问答数据需要保存
|
||||||
|
if (!this.form.questionsArray || !Array.isArray(this.form.questionsArray)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤出有效的问答数据(问题和答案都不为空)
|
||||||
|
const validQuestions = this.form.questionsArray.filter(qa =>
|
||||||
|
qa && qa.question && qa.question.trim() && qa.answer && qa.answer.trim()
|
||||||
|
).map(qa => ({
|
||||||
|
question: qa.question.trim(),
|
||||||
|
answer: qa.answer.trim()
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 如果没有有效数据,不进行保存
|
||||||
|
if (validQuestions.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是新增状态,不进行静默保存
|
||||||
|
if (!this.form.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 准备保存的数据
|
||||||
|
const submitData = {
|
||||||
|
id: this.form.id,
|
||||||
|
questions: JSON.stringify(validQuestions)
|
||||||
|
};
|
||||||
|
|
||||||
|
// 调用更新接口
|
||||||
|
await updateServiceGoods(submitData);
|
||||||
|
console.log('问答数据静默保存成功');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('问答数据静默保存失败:', error);
|
||||||
|
// 静默保存失败不提示用户,保持静默
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 监听问答数据变化
|
||||||
|
handleQuestionChange() {
|
||||||
|
// 使用防抖进行静默保存
|
||||||
|
if (this.saveTimeout) {
|
||||||
|
clearTimeout(this.saveTimeout);
|
||||||
|
}
|
||||||
|
this.saveTimeout = setTimeout(() => {
|
||||||
|
this.silentSave();
|
||||||
|
}, 1000); // 1秒后进行保存
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1473,4 +1622,59 @@ export default {
|
||||||
.basic-tags-container .el-tag:hover {
|
.basic-tags-container .el-tag:hover {
|
||||||
transform: scale(1.05);
|
transform: scale(1.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 问答样式 */
|
||||||
|
.qa-container {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-header {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #EBEEF5;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item:hover {
|
||||||
|
box-shadow: 0 2px 8px 0 rgba(0,0,0,.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-index {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-form-item) {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-form-item__label) {
|
||||||
|
padding: 0 5px 0 0;
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-form-item__content) {
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-textarea__inner) {
|
||||||
|
padding: 5px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qa-item :deep(.el-divider--horizontal) {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,75 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="评价标签" name="config_six">
|
||||||
|
<el-form :model="ratingForm" label-width="120px" class="tab-form">
|
||||||
|
<el-form-item label="服务评价标签">
|
||||||
|
<el-select v-model="ratingForm.service" multiple filterable allow-create default-first-option placeholder="请输入服务评价标签" style="width: 600px">
|
||||||
|
<el-option v-for="item in ratingForm.service" :key="item" :label="item" :value="item" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品评价标签">
|
||||||
|
<el-select v-model="ratingForm.goods" multiple filterable allow-create default-first-option placeholder="请输入商品评价标签" style="width: 600px">
|
||||||
|
<el-option v-for="item in ratingForm.goods" :key="item" :label="item" :value="item" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="saveAllConfig('6')">提交</el-button>
|
||||||
|
<el-button @click="resetRating">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="首页轮播图" name="config_banner">
|
||||||
|
<el-form label-width="120px" class="tab-form">
|
||||||
|
<div class="banner-list">
|
||||||
|
<div v-for="(item, index) in bannerForm.banner" :key="index" class="banner-item">
|
||||||
|
<el-card>
|
||||||
|
<div class="banner-content">
|
||||||
|
<div class="banner-image">
|
||||||
|
<el-upload
|
||||||
|
class="banner-uploader"
|
||||||
|
:action="uploadImgUrl"
|
||||||
|
:headers="headers"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-success="(response, file) => handleBannerSuccess(response, file, index)"
|
||||||
|
:on-error="handleBannerError"
|
||||||
|
:before-upload="beforeBannerUpload"
|
||||||
|
>
|
||||||
|
<div v-if="item.imageUrl" class="banner-img-container">
|
||||||
|
<img :src="item.imageUrl" class="banner-img">
|
||||||
|
<div class="banner-img-mask">
|
||||||
|
<div class="banner-img-actions">
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-refresh">更换图片</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<i v-else class="el-icon-plus banner-uploader-icon"></i>
|
||||||
|
</el-upload>
|
||||||
|
</div>
|
||||||
|
<div class="banner-form">
|
||||||
|
<div class="banner-form-fields">
|
||||||
|
<el-form-item label="跳转链接" class="banner-link-item">
|
||||||
|
<el-input v-model="item.link" placeholder="请输入跳转链接"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="banner-form-right">
|
||||||
|
<el-form-item label="排序" class="banner-sort-item">
|
||||||
|
<el-input-number v-model="item.sort" :min="0" :max="99"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button type="danger" icon="el-icon-delete" circle @click="removeBanner(index)"></el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</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>
|
||||||
|
<el-button @click="resetBanner">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -184,6 +253,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listSiteConfig, getSiteConfig, delSiteConfig, addSiteConfig, updateSiteConfig } from "@/api/system/SiteConfig"
|
import { listSiteConfig, getSiteConfig, delSiteConfig, addSiteConfig, updateSiteConfig } from "@/api/system/SiteConfig"
|
||||||
|
import { getToken } from "@/utils/auth"
|
||||||
import { quillEditor } from 'vue-quill-editor'
|
import { quillEditor } from 'vue-quill-editor'
|
||||||
import 'quill/dist/quill.core.css'
|
import 'quill/dist/quill.core.css'
|
||||||
import 'quill/dist/quill.snow.css'
|
import 'quill/dist/quill.snow.css'
|
||||||
|
|
@ -205,6 +275,7 @@ export default {
|
||||||
config_three: {},
|
config_three: {},
|
||||||
config_four: {},
|
config_four: {},
|
||||||
config_five: {},
|
config_five: {},
|
||||||
|
config_six: {},
|
||||||
total: 0, // 系统配置表格数据
|
total: 0, // 系统配置表格数据
|
||||||
// 基本信息
|
// 基本信息
|
||||||
baseForm: {
|
baseForm: {
|
||||||
|
|
@ -232,6 +303,11 @@ export default {
|
||||||
memberForm:{
|
memberForm:{
|
||||||
member: ''
|
member: ''
|
||||||
},
|
},
|
||||||
|
// 评价标签配置
|
||||||
|
ratingForm: {
|
||||||
|
service: ['服务态度好', '技术专业', '准时守信', '认真负责', '价格合理'],
|
||||||
|
goods: ['商品质量好', '包装完整', '物流快速', '性价比高', '描述相符']
|
||||||
|
},
|
||||||
// 下单时间配置
|
// 下单时间配置
|
||||||
orderTimes: [
|
orderTimes: [
|
||||||
|
|
||||||
|
|
@ -244,6 +320,16 @@ export default {
|
||||||
},
|
},
|
||||||
editorOptions: {
|
editorOptions: {
|
||||||
placeholder: '请输入质保金说明...'
|
placeholder: '请输入质保金说明...'
|
||||||
|
},
|
||||||
|
config_seven: {},
|
||||||
|
bannerForm: {
|
||||||
|
banner: []
|
||||||
|
},
|
||||||
|
// 上传图片地址
|
||||||
|
uploadImgUrl: process.env.VUE_APP_BASE_API + "/api/public/upload/file",
|
||||||
|
// 上传请求头部
|
||||||
|
headers: {
|
||||||
|
Authorization: 'Bearer ' + getToken()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -297,6 +383,16 @@ export default {
|
||||||
this.memberForm = { member: configfiveObj.member || '' }
|
this.memberForm = { member: configfiveObj.member || '' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// config_six 评价标签配置
|
||||||
|
this.config_six = response.rows.find(item => item.name === 'config_six')
|
||||||
|
if (this.config_six && this.config_six.value) {
|
||||||
|
const configSixObj = JSON.parse(this.config_six.value)
|
||||||
|
this.ratingForm = {
|
||||||
|
service: configSixObj.service || ['服务态度好', '技术专业', '准时守信', '认真负责', '价格合理'],
|
||||||
|
goods: configSixObj.goods || ['商品质量好', '包装完整', '物流快速', '性价比高', '描述相符']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// config_three 下单时间配置
|
// config_three 下单时间配置
|
||||||
this.config_three = response.rows.find(item => item.name === 'config_three')
|
this.config_three = response.rows.find(item => item.name === 'config_three')
|
||||||
this.orderTimes = []
|
this.orderTimes = []
|
||||||
|
|
@ -325,6 +421,13 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// config_seven 轮播图配置
|
||||||
|
this.config_seven = response.rows.find(item => item.name === 'config_seven')
|
||||||
|
if (this.config_seven && this.config_seven.value) {
|
||||||
|
const configBannerObj = JSON.parse(this.config_seven.value)
|
||||||
|
this.bannerForm.banner = configBannerObj.banner || []
|
||||||
|
}
|
||||||
|
|
||||||
this.total = response.total
|
this.total = response.total
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
|
|
@ -396,6 +499,12 @@ export default {
|
||||||
resetMember() {
|
resetMember() {
|
||||||
this.memberForm = { member: '' }
|
this.memberForm = { member: '' }
|
||||||
},
|
},
|
||||||
|
resetRating() {
|
||||||
|
this.ratingForm = {
|
||||||
|
service: ['服务态度好', '技术专业', '准时守信', '认真负责', '价格合理'],
|
||||||
|
goods: ['商品质量好', '包装完整', '物流快速', '性价比高', '描述相符']
|
||||||
|
}
|
||||||
|
},
|
||||||
async saveAllConfig(e) {
|
async saveAllConfig(e) {
|
||||||
// 1. 组装 config_one
|
// 1. 组装 config_one
|
||||||
const config_one = {
|
const config_one = {
|
||||||
|
|
@ -437,6 +546,19 @@ export default {
|
||||||
const config_five = {
|
const config_five = {
|
||||||
member: this.memberForm.member
|
member: this.memberForm.member
|
||||||
};
|
};
|
||||||
|
// 6. 组装 config_six
|
||||||
|
const config_six = {
|
||||||
|
service: this.ratingForm.service,
|
||||||
|
goods: this.ratingForm.goods
|
||||||
|
};
|
||||||
|
// 组装 config_seven
|
||||||
|
const config_seven = {
|
||||||
|
banner: this.bannerForm.banner.map(item => ({
|
||||||
|
imageUrl: item.imageUrl,
|
||||||
|
link: item.link,
|
||||||
|
sort: item.sort
|
||||||
|
})).sort((a, b) => a.sort - b.sort)
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
if(e=='1'){
|
if(e=='1'){
|
||||||
await updateSiteConfig({ name: 'config_one',id:this.config_one.id, value: JSON.stringify(config_one) });
|
await updateSiteConfig({ name: 'config_one',id:this.config_one.id, value: JSON.stringify(config_one) });
|
||||||
|
|
@ -448,12 +570,66 @@ if(e=='1'){
|
||||||
await updateSiteConfig({ name: 'config_four',id:this.config_four.id, value: JSON.stringify(config_four) });
|
await updateSiteConfig({ name: 'config_four',id:this.config_four.id, value: JSON.stringify(config_four) });
|
||||||
}else if(e=='5'){
|
}else if(e=='5'){
|
||||||
await updateSiteConfig({ name: 'config_five',id:this.config_five.id, value: JSON.stringify(config_five) });
|
await updateSiteConfig({ name: 'config_five',id:this.config_five.id, value: JSON.stringify(config_five) });
|
||||||
|
}else if(e=='6'){
|
||||||
|
if (!this.config_six || !this.config_six.id) {
|
||||||
|
await addSiteConfig({ name: 'config_six', value: JSON.stringify(config_six), status: 1 });
|
||||||
|
} else {
|
||||||
|
await updateSiteConfig({ name: 'config_six', id: this.config_six.id, value: JSON.stringify(config_six) });
|
||||||
|
}
|
||||||
|
}else if(e=='banner'){
|
||||||
|
if (!this.config_seven || !this.config_seven.id) {
|
||||||
|
await addSiteConfig({ name: 'config_seven', value: JSON.stringify(config_seven), status: 1 });
|
||||||
|
} else {
|
||||||
|
await updateSiteConfig({ name: 'config_seven', id: this.config_seven.id, value: JSON.stringify(config_seven) });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$message.success('保存成功!');
|
this.$message.success('保存成功!');
|
||||||
this.getList();
|
this.getList();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error('保存失败:', e);
|
||||||
this.$message.error('保存失败,请重试');
|
this.$message.error('保存失败,请重试');
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handleBannerSuccess(response, file, index) {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.bannerForm.banner[index].imageUrl = response.data.full_path
|
||||||
|
this.$message.success('图片上传成功')
|
||||||
|
} else {
|
||||||
|
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.$message.error('只能上传图片格式!')
|
||||||
|
}
|
||||||
|
if (!isLt5M) {
|
||||||
|
this.$message.error('上传图片大小不能超过 5MB!')
|
||||||
|
}
|
||||||
|
return isImg && isLt5M
|
||||||
|
},
|
||||||
|
addBanner() {
|
||||||
|
this.bannerForm.banner.push({
|
||||||
|
imageUrl: '',
|
||||||
|
link: '',
|
||||||
|
sort: this.bannerForm.banner.length
|
||||||
|
})
|
||||||
|
},
|
||||||
|
removeBanner(index) {
|
||||||
|
this.bannerForm.banner.splice(index, 1)
|
||||||
|
// 重新排序
|
||||||
|
this.bannerForm.banner.forEach((item, idx) => {
|
||||||
|
item.sort = idx
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetBanner() {
|
||||||
|
this.bannerForm.banner = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -490,4 +666,102 @@ if(e=='1'){
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
color: #8c939d;
|
color: #8c939d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 轮播图样式 */
|
||||||
|
.banner-list {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.banner-item {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.banner-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 20px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.banner-image {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.banner-form {
|
||||||
|
flex-grow: 1;
|
||||||
|
width: calc(100% - 380px); /* 360px for image + 20px gap */
|
||||||
|
}
|
||||||
|
.banner-form-fields {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 15px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.banner-link-item {
|
||||||
|
margin-bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.banner-form-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 15px;
|
||||||
|
}
|
||||||
|
.banner-sort-item {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.banner-form .el-form-item__content {
|
||||||
|
width: calc(100% - 120px); /* 120px is label width */
|
||||||
|
}
|
||||||
|
.banner-uploader {
|
||||||
|
border: 1px dashed #d9d9d9;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 360px;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
.banner-uploader:hover {
|
||||||
|
border-color: #409EFF;
|
||||||
|
}
|
||||||
|
.banner-img-container {
|
||||||
|
position: relative;
|
||||||
|
width: 360px;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
.banner-img {
|
||||||
|
width: 360px;
|
||||||
|
height: 200px;
|
||||||
|
display: block;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
.banner-img-mask {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.3s;
|
||||||
|
}
|
||||||
|
.banner-img-container:hover .banner-img-mask {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.banner-img-actions {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.banner-img-actions .el-button {
|
||||||
|
margin: 0 5px;
|
||||||
|
}
|
||||||
|
.banner-uploader-icon {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #8c939d;
|
||||||
|
width: 360px;
|
||||||
|
height: 200px;
|
||||||
|
line-height: 200px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.banner-actions {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="visible"
|
||||||
|
width="800px"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
destroy-on-close
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="searchKeyword"
|
||||||
|
placeholder="请输入服务名称搜索"
|
||||||
|
clearable
|
||||||
|
prefix-icon="el-icon-search"
|
||||||
|
style="width: 300px; margin-bottom: 10px;"
|
||||||
|
@keyup.enter.native="handleSearch"
|
||||||
|
@clear="handleSearch"
|
||||||
|
>
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="handleSearch">搜索</el-button>
|
||||||
|
</el-input>
|
||||||
|
<el-table
|
||||||
|
ref="serviceTable"
|
||||||
|
:data="serviceList"
|
||||||
|
@select="handleSelectionChange"
|
||||||
|
@select-all="handleSelectionChange"
|
||||||
|
height="400"
|
||||||
|
border
|
||||||
|
v-loading="loading"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="服务ID" prop="id" width="80" align="center" />
|
||||||
|
<el-table-column label="服务名称" prop="title" align="center" />
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page.sync="pageNum"
|
||||||
|
:page-sizes="[10, 20, 30, 50]"
|
||||||
|
:page-size.sync="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
style="margin-top: 10px;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="closeDialog">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="confirmSelection">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listServiceGoods } from '@/api/system/ServiceGoods'
|
||||||
|
export default {
|
||||||
|
name: 'ServiceGoodsSelectDialog',
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: [Array, String],
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '选择服务项目'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchKeyword: '',
|
||||||
|
serviceList: [],
|
||||||
|
loading: false,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
tempSelected: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
visible(val) {
|
||||||
|
if (val) {
|
||||||
|
this.tempSelected = Array.isArray(this.value) ? [...this.value] : (this.value ? JSON.parse(this.value) : [])
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listServiceGoods({ pageNum: this.pageNum, pageSize: this.pageSize, title: this.searchKeyword }).then(res => {
|
||||||
|
this.serviceList = res.rows || []
|
||||||
|
this.total = res.total || 0
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.serviceTable) {
|
||||||
|
this.$refs.serviceTable.clearSelection()
|
||||||
|
const selectedIds = (this.tempSelected || []).map(String)
|
||||||
|
this.serviceList.forEach(row => {
|
||||||
|
if (selectedIds.includes(String(row.id))) {
|
||||||
|
this.$refs.serviceTable.toggleRowSelection(row, true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleSearch() {
|
||||||
|
this.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.pageSize = val
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.pageNum = val
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.tempSelected = selection.map(item => String(item.id))
|
||||||
|
},
|
||||||
|
confirmSelection() {
|
||||||
|
this.$emit('input', JSON.stringify(this.tempSelected))
|
||||||
|
this.$emit('update:visible', false)
|
||||||
|
},
|
||||||
|
closeDialog() {
|
||||||
|
this.$emit('update:visible', false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.service-tag-content {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
max-width: 200px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 4px;
|
||||||
|
}
|
||||||
|
.service-title {
|
||||||
|
font-weight: 500;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
max-width: 100px;
|
||||||
|
}
|
||||||
|
.service-id {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
max-width: 90px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,454 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
|
||||||
|
<el-form-item label="标题" prop="title">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.title"
|
||||||
|
placeholder="请输入标题"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.cika"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:UserSecondaryCard:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:UserSecondaryCard:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:UserSecondaryCard:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:UserSecondaryCard:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="UserSecondaryCardList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="ID" align="center" prop="id" />
|
||||||
|
<el-table-column label="订单id" align="center" prop="orderid" />
|
||||||
|
<el-table-column label="标题" align="center" prop="title" />
|
||||||
|
<el-table-column label="服务项目" align="center" prop="goodsname" />
|
||||||
|
<el-table-column label="展示价格" align="center" prop="showMoney" />
|
||||||
|
<el-table-column label="真实付款价格" align="center" prop="realMoney" />
|
||||||
|
<el-table-column label="展示图片" align="center" prop="showimage" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<image-preview :src="scope.row.showimage" :width="50" :height="50"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.cika" :value="scope.row.status"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="creattime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.creattime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="分类" align="center" prop="type" />
|
||||||
|
<el-table-column label="可提供服务数" align="center" prop="num" />
|
||||||
|
<el-table-column label="总服务数" align="center" prop="allnum" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['system:UserSecondaryCard:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:UserSecondaryCard:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改次卡管理对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="45" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
|
<el-form-item label="标题" prop="title">
|
||||||
|
<el-input v-model="form.title" placeholder="请输入标题" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服务项目" prop="goodsids">
|
||||||
|
<el-select
|
||||||
|
v-model="form.goodsids"
|
||||||
|
multiple
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
placeholder="请选择服务项目"
|
||||||
|
style="width: 100%"
|
||||||
|
@change="onGoodsidsChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in ServiceGoodsList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.title"
|
||||||
|
:value="String(item.id)"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="分类" prop="type">
|
||||||
|
<el-select v-model="form.type" placeholder="请选择分类">
|
||||||
|
<el-option v-for="cate in serviceCateList" :key="cate.id" :label="cate.title" :value="cate.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="展示价格" prop="showMoney">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.showMoney"
|
||||||
|
:precision="2"
|
||||||
|
:min="0"
|
||||||
|
:step="0.01"
|
||||||
|
placeholder="请输入展示价格"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="真实付款价格" prop="realMoney">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.realMoney"
|
||||||
|
:precision="2"
|
||||||
|
:min="0"
|
||||||
|
:step="0.01"
|
||||||
|
placeholder="请输入真实付款价格"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="展示图片" prop="showimage">
|
||||||
|
<image-upload v-model="form.showimage"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.cika"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="parseInt(dict.value)"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="可提供服务数" prop="num">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.num"
|
||||||
|
:min="1"
|
||||||
|
:step="1"
|
||||||
|
:precision="0"
|
||||||
|
placeholder="请输入可提供服务数"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="总服务数" prop="allnum">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.allnum"
|
||||||
|
:min="1"
|
||||||
|
:step="1"
|
||||||
|
:precision="0"
|
||||||
|
placeholder="请输入总服务数"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listUserSecondaryCard, getUserSecondaryCard, delUserSecondaryCard, addUserSecondaryCard, updateUserSecondaryCard ,selectList,selectServiceCateList} from "@/api/system/UserSecondaryCard"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "UserSecondaryCard",
|
||||||
|
dicts: ['cika'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
|
||||||
|
|
||||||
|
serviceCateList: [],
|
||||||
|
|
||||||
|
ServiceGoodsList: [],
|
||||||
|
// 次卡管理表格数据
|
||||||
|
UserSecondaryCardList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
orderid: null,
|
||||||
|
title: null,
|
||||||
|
goodsids: null,
|
||||||
|
showMoney: null,
|
||||||
|
realMoney: null,
|
||||||
|
showimage: null,
|
||||||
|
status: null,
|
||||||
|
creattime: null,
|
||||||
|
createdAt: null,
|
||||||
|
updatedAt: null,
|
||||||
|
type: null,
|
||||||
|
num: null,
|
||||||
|
allnum: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
showMoney: [
|
||||||
|
{ required: true, message: '请输入展示价格', trigger: 'blur' },
|
||||||
|
{ pattern: /^(0|[1-9]\d*)(\.\d{1,2})?$/, message: '请输入正确的金额(最多两位小数)', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
realMoney: [
|
||||||
|
{ required: true, message: '请输入真实付款价格', trigger: 'blur' },
|
||||||
|
{ pattern: /^(0|[1-9]\d*)(\.\d{1,2})?$/, message: '请输入正确的金额(最多两位小数)', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
num: [
|
||||||
|
{ required: true, message: '请输入可提供服务数', trigger: 'blur' },
|
||||||
|
{ pattern: /^[1-9]\d*$/, message: '请输入正整数', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
allnum: [
|
||||||
|
{ required: true, message: '请输入总服务数', trigger: 'blur' },
|
||||||
|
{ pattern: /^[1-9]\d*$/, message: '请输入正整数', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
this.getserviceCateList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询次卡管理列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listUserSecondaryCard(this.queryParams).then(response => {
|
||||||
|
this.UserSecondaryCardList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
orderid: null,
|
||||||
|
title: null,
|
||||||
|
goodsids: null,
|
||||||
|
showMoney: null,
|
||||||
|
realMoney: null,
|
||||||
|
showimage: null,
|
||||||
|
status: null,
|
||||||
|
creattime: null,
|
||||||
|
createdAt: null,
|
||||||
|
updatedAt: null,
|
||||||
|
type: null,
|
||||||
|
num: null,
|
||||||
|
allnum: null
|
||||||
|
}
|
||||||
|
this.resetForm("form")
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm")
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
|
||||||
|
getUserSecondaryCard () {
|
||||||
|
selectList().then(response => {
|
||||||
|
this.ServiceGoodsList = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.getUserSecondaryCard();
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = "添加次卡管理"
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
getserviceCateList(){
|
||||||
|
selectServiceCateList().then(response => {
|
||||||
|
this.serviceCateList = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
this.getUserSecondaryCard();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getUserSecondaryCard(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
// 兼容后端返回goodsids为JSON字符串数组或逗号分隔字符串,全部转为字符串数组
|
||||||
|
if (this.form.goodsids) {
|
||||||
|
if (typeof this.form.goodsids === 'string') {
|
||||||
|
try {
|
||||||
|
const arr = JSON.parse(this.form.goodsids)
|
||||||
|
if (Array.isArray(arr)) {
|
||||||
|
this.form.goodsids = arr.map(i => String(i))
|
||||||
|
} else {
|
||||||
|
this.form.goodsids = this.form.goodsids.split(',').map(i => String(i).trim()).filter(i => i)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.form.goodsids = this.form.goodsids.split(',').map(i => String(i).trim()).filter(i => i)
|
||||||
|
}
|
||||||
|
} else if (Array.isArray(this.form.goodsids)) {
|
||||||
|
this.form.goodsids = this.form.goodsids.map(i => String(i))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.form.goodsids = []
|
||||||
|
}
|
||||||
|
this.onGoodsidsChange(this.form.goodsids);
|
||||||
|
this.open = true
|
||||||
|
this.title = "修改次卡管理"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
// 提交前将goodsids转为JSON字符串数组
|
||||||
|
const submitForm = { ...this.form, goodsids: Array.isArray(this.form.goodsids) ? JSON.stringify(this.form.goodsids.map(String)) : this.form.goodsids }
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateUserSecondaryCard(submitForm).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功")
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addUserSecondaryCard(submitForm).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功")
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids
|
||||||
|
this.$modal.confirm('是否确认删除次卡管理编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delUserSecondaryCard(ids)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess("删除成功")
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('system/UserSecondaryCard/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `UserSecondaryCard_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
// 服务项目选择变化时自动回填总服务数
|
||||||
|
onGoodsidsChange(val) {
|
||||||
|
this.form.allnum = Array.isArray(val) ? val.length : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,348 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
|
||||||
|
<el-form-item label="次卡id" prop="carid">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.carid"
|
||||||
|
placeholder="请输入次卡id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.user_cika"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:UserUseSecondaryCard:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:UserUseSecondaryCard:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:UserUseSecondaryCard:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:UserUseSecondaryCard:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="UserUseSecondaryCardList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="ID" align="center" prop="id" />
|
||||||
|
<el-table-column label="用户id" align="center" prop="uid" />
|
||||||
|
<el-table-column label="次卡id" align="center" prop="carid" />
|
||||||
|
<el-table-column label="服务id" align="center" prop="goodsids" />
|
||||||
|
<el-table-column label="用户可用数量" align="center" prop="num" />
|
||||||
|
<el-table-column label="用户已用数量" align="center" prop="usenum" />
|
||||||
|
<el-table-column label="订单id" align="center" prop="orderid" />
|
||||||
|
<el-table-column label="支付id" align="center" prop="transactionId" />
|
||||||
|
<el-table-column label="支付金额" align="center" prop="paymoney" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.user_cika" :value="scope.row.status"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['system:UserUseSecondaryCard:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:UserUseSecondaryCard:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改次卡使用对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="用户id" prop="uid">
|
||||||
|
<el-input v-model="form.uid" placeholder="请输入用户id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="次卡id" prop="carid">
|
||||||
|
<el-input v-model="form.carid" placeholder="请输入次卡id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服务id" prop="goodsids">
|
||||||
|
<el-input v-model="form.goodsids" placeholder="请输入服务id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户可用数量" prop="num">
|
||||||
|
<el-input v-model="form.num" placeholder="请输入用户可用数量" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户已用数量" prop="usenum">
|
||||||
|
<el-input v-model="form.usenum" placeholder="请输入用户已用数量" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单id" prop="orderid">
|
||||||
|
<el-input v-model="form.orderid" placeholder="请输入订单id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="支付id" prop="transactionId">
|
||||||
|
<el-input v-model="form.transactionId" placeholder="请输入支付id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="支付金额" prop="paymoney">
|
||||||
|
<el-input v-model="form.paymoney" placeholder="请输入支付金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态 1可用 2已用完 3已退款" prop="status">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in dict.type.user_cika"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="parseInt(dict.value)"
|
||||||
|
>{{dict.label}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="createdAt">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.createdAt"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择${comment}">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="${comment}" prop="updatedAt">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.updatedAt"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择${comment}">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listUserUseSecondaryCard, getUserUseSecondaryCard, delUserUseSecondaryCard, addUserUseSecondaryCard, updateUserUseSecondaryCard } from "@/api/system/UserUseSecondaryCard"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "UserUseSecondaryCard",
|
||||||
|
dicts: ['user_cika'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 次卡使用表格数据
|
||||||
|
UserUseSecondaryCardList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
uid: null,
|
||||||
|
carid: null,
|
||||||
|
goodsids: null,
|
||||||
|
num: null,
|
||||||
|
usenum: null,
|
||||||
|
orderid: null,
|
||||||
|
transactionId: null,
|
||||||
|
paymoney: null,
|
||||||
|
status: null,
|
||||||
|
createdAt: null,
|
||||||
|
updatedAt: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询次卡使用列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listUserUseSecondaryCard(this.queryParams).then(response => {
|
||||||
|
this.UserUseSecondaryCardList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
uid: null,
|
||||||
|
carid: null,
|
||||||
|
goodsids: null,
|
||||||
|
num: null,
|
||||||
|
usenum: null,
|
||||||
|
orderid: null,
|
||||||
|
transactionId: null,
|
||||||
|
paymoney: null,
|
||||||
|
status: null,
|
||||||
|
createdAt: null,
|
||||||
|
updatedAt: null
|
||||||
|
}
|
||||||
|
this.resetForm("form")
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm")
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = "添加次卡使用"
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getUserUseSecondaryCard(id).then(response => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = "修改次卡使用"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateUserUseSecondaryCard(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功")
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addUserUseSecondaryCard(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功")
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids
|
||||||
|
this.$modal.confirm('是否确认删除次卡使用编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delUserUseSecondaryCard(ids)
|
||||||
|
}).then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess("删除成功")
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('system/UserUseSecondaryCard/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `UserUseSecondaryCard_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue