mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-23 23:19:19 +08:00
完成订单批量导入功能
This commit is contained in:
@@ -0,0 +1,193 @@
|
||||
# 店铺Logo上传逻辑修复说明
|
||||
|
||||
## 问题描述
|
||||
|
||||
之前的店铺Logo上传逻辑存在死循环问题:
|
||||
|
||||
1. **创建店铺时**:需要先上传logo
|
||||
2. **上传logo时**:要求公司下必须有店铺
|
||||
|
||||
这形成了一个逻辑死循环,导致无法正常创建店铺。
|
||||
|
||||
## 问题分析
|
||||
|
||||
### 原始错误逻辑
|
||||
```java
|
||||
// 上传Logo时自动选择第一个店铺
|
||||
public ShopVO uploadLogo(MultipartFile file) {
|
||||
// 查询公司下的第一个店铺
|
||||
ShopPO shop = this.getOne(wrapper);
|
||||
if (shop == null) {
|
||||
throw new BusinessException("公司下没有店铺,请先创建店铺"); // 死循环!
|
||||
}
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### 问题根源
|
||||
- 上传Logo接口没有指定店铺ID
|
||||
- 自动选择第一个店铺,但创建店铺时还没有店铺
|
||||
- 形成了"先有鸡还是先有蛋"的问题
|
||||
|
||||
## 修复方案
|
||||
|
||||
### 1. 参考公司Logo上传逻辑
|
||||
店铺Logo上传应该和公司Logo上传保持一致:
|
||||
- **上传Logo**:只负责上传文件,返回图片信息,支持跨公司共享
|
||||
- **创建/更新店铺**:使用上传返回的图片ID
|
||||
|
||||
### 2. 修改上传Logo接口
|
||||
**修改前**:
|
||||
```java
|
||||
// 接口:POST /ec/shop/upload-logo
|
||||
// 参数:只有文件,自动选择第一个店铺
|
||||
public ShopVO uploadLogo(MultipartFile file)
|
||||
```
|
||||
|
||||
**修改后**:
|
||||
```java
|
||||
// 接口:POST /ec/shop/upload-logo
|
||||
// 参数:只有文件,返回图片信息
|
||||
public MediaImageVO uploadLogo(MultipartFile file)
|
||||
```
|
||||
|
||||
### 3. 简化业务逻辑
|
||||
```java
|
||||
@Override
|
||||
public MediaImageVO uploadLogo(MultipartFile file) {
|
||||
// 上传Logo到媒体模块(支持哈希校验和跨公司共享)
|
||||
return mediaImageService.uploadImageWithType(file, "logo");
|
||||
}
|
||||
```
|
||||
|
||||
## 修复后的正确流程
|
||||
|
||||
### 1. 上传店铺Logo(获取图片ID)
|
||||
```bash
|
||||
POST /ec/shop/upload-logo
|
||||
Content-Type: multipart/form-data
|
||||
|
||||
file: [logo图片文件]
|
||||
```
|
||||
|
||||
**响应**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"message": "操作成功",
|
||||
"data": {
|
||||
"id": 123,
|
||||
"url": "/uploads/logo/2025/01/17/abc123.png",
|
||||
"filename": "logo.png",
|
||||
"type": "logo",
|
||||
"fileHash": "abc123def456"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 创建店铺(使用图片ID)
|
||||
```bash
|
||||
POST /ec/shop/create
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "我的店铺",
|
||||
"platform": "淘宝",
|
||||
"logoImageId": 123 # 使用上传返回的图片ID
|
||||
}
|
||||
```
|
||||
|
||||
**响应**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"message": "操作成功",
|
||||
"data": {
|
||||
"id": 1,
|
||||
"name": "我的店铺",
|
||||
"platform": "淘宝",
|
||||
"logo": "/uploads/logo/2025/01/17/abc123.png",
|
||||
"logoImageId": 123
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 更新店铺Logo(可选)
|
||||
```bash
|
||||
PUT /ec/shop/update/1
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "我的店铺",
|
||||
"platform": "淘宝",
|
||||
"logoImageId": 456 # 使用新的图片ID
|
||||
}
|
||||
```
|
||||
|
||||
## 技术改进
|
||||
|
||||
### 1. 接口设计优化
|
||||
- ✅ 上传Logo只负责文件上传,返回图片信息
|
||||
- ✅ 支持跨公司共享,相同文件只存储一份
|
||||
- ✅ 创建/更新店铺时使用图片ID关联
|
||||
|
||||
### 2. 数据完整性
|
||||
- ✅ 同时维护 `logo` URL 和 `logoImageId`
|
||||
- ✅ 支持哈希校验和文件共享
|
||||
- ✅ 软删除支持
|
||||
|
||||
### 3. 错误处理
|
||||
- ✅ 文件类型验证
|
||||
- ✅ 哈希校验和重复文件检测
|
||||
- ✅ 权限控制
|
||||
|
||||
## 使用建议
|
||||
|
||||
### 前端集成
|
||||
```javascript
|
||||
// 1. 先上传Logo(可选)
|
||||
const uploadLogo = async (file) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
||||
const response = await fetch('/ec/shop/upload-logo', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
});
|
||||
return response.json();
|
||||
};
|
||||
|
||||
// 2. 创建店铺(使用图片ID)
|
||||
const createShop = async (shopData) => {
|
||||
const response = await fetch('/ec/shop/create', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(shopData)
|
||||
});
|
||||
return response.json();
|
||||
};
|
||||
|
||||
// 使用示例
|
||||
let logoImageId = null;
|
||||
if (logoFile) {
|
||||
const logoResult = await uploadLogo(logoFile);
|
||||
logoImageId = logoResult.data.id;
|
||||
}
|
||||
|
||||
const shop = await createShop({
|
||||
name: "我的店铺",
|
||||
platform: "淘宝",
|
||||
logoImageId: logoImageId
|
||||
});
|
||||
```
|
||||
|
||||
## 总结
|
||||
|
||||
通过这次修复,解决了店铺Logo上传的死循环问题:
|
||||
|
||||
1. **上传Logo**:只负责文件上传,返回图片信息,支持跨公司共享
|
||||
2. **创建店铺**:使用上传返回的图片ID,Logo是可选的
|
||||
3. **更新店铺**:可以更换Logo,使用新的图片ID
|
||||
4. **数据完整性**:同时维护URL和图片ID字段
|
||||
|
||||
现在用户可以正常创建店铺,然后根据需要上传Logo,逻辑清晰合理,与公司Logo上传保持一致。
|
||||
@@ -0,0 +1,128 @@
|
||||
# 时间格式支持说明
|
||||
|
||||
## 概述
|
||||
|
||||
系统现在支持多种时间格式的自动解析,无需在DTO中添加 `@JsonFormat` 注解。通过全局配置的 `FlexibleLocalDateTimeDeserializer`,系统可以自动识别和解析多种常见的时间格式。
|
||||
|
||||
## 支持的时间格式
|
||||
|
||||
### 1. 标准格式
|
||||
- `yyyy-MM-dd HH:mm:ss` - 如:`2025-09-14 12:51:33`
|
||||
- `yyyy-MM-dd HH:mm:ss.SSS` - 如:`2025-09-14 12:51:33.123`
|
||||
|
||||
### 2. ISO 8601 格式
|
||||
- `yyyy-MM-ddTHH:mm:ss` - 如:`2025-09-14T12:51:33`
|
||||
- `yyyy-MM-ddTHH:mm:ss.SSS` - 如:`2025-09-14T12:51:33.123`
|
||||
|
||||
### 3. 日期格式(时间部分默认为00:00:00)
|
||||
- `yyyy-MM-dd` - 如:`2025-09-14`
|
||||
|
||||
### 4. 中文格式
|
||||
- `yyyy年MM月dd日 HH:mm:ss` - 如:`2025年09月14日 12:51:33`
|
||||
- `yyyy年MM月dd日` - 如:`2025年09月14日`
|
||||
|
||||
### 5. 斜杠格式
|
||||
- `yyyy/MM/dd HH:mm:ss` - 如:`2025/09/14 12:51:33`
|
||||
- `yyyy/MM/dd` - 如:`2025/09/14`
|
||||
|
||||
### 6. 点格式
|
||||
- `yyyy.MM.dd HH:mm:ss` - 如:`2025.09.14 12:51:33`
|
||||
- `yyyy.MM.dd` - 如:`2025.09.14`
|
||||
|
||||
## 使用示例
|
||||
|
||||
### 更新公司接口
|
||||
```bash
|
||||
PUT /company/update/1
|
||||
Content-Type: application/json
|
||||
|
||||
# 支持以下任意格式:
|
||||
{
|
||||
"name": "秦华科技有限公司",
|
||||
"expireTime": "2025-09-14 12:51:33" # 标准格式
|
||||
}
|
||||
|
||||
{
|
||||
"name": "秦华科技有限公司",
|
||||
"expireTime": "2025-09-14T12:51:33" # ISO格式
|
||||
}
|
||||
|
||||
{
|
||||
"name": "秦华科技有限公司",
|
||||
"expireTime": "2025-09-14" # 日期格式
|
||||
}
|
||||
|
||||
{
|
||||
"name": "秦华科技有限公司",
|
||||
"expireTime": "2025年09月14日 12:51:33" # 中文格式
|
||||
}
|
||||
|
||||
{
|
||||
"name": "秦华科技有限公司",
|
||||
"expireTime": "2025/09/14 12:51:33" # 斜杠格式
|
||||
}
|
||||
|
||||
{
|
||||
"name": "秦华科技有限公司",
|
||||
"expireTime": "2025.09.14 12:51:33" # 点格式
|
||||
}
|
||||
```
|
||||
|
||||
### 响应格式
|
||||
所有格式的输入都会统一输出为标准的 `yyyy-MM-dd HH:mm:ss` 格式:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"message": "操作成功",
|
||||
"data": {
|
||||
"id": 1,
|
||||
"name": "秦华科技有限公司",
|
||||
"expireTime": "2025-09-14 12:51:33",
|
||||
"createTime": "2024-01-01 10:00:00",
|
||||
"updateTime": "2025-01-17 15:30:00"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 技术实现
|
||||
|
||||
### 1. 自定义反序列化器
|
||||
- `FlexibleLocalDateTimeDeserializer` 类负责解析多种时间格式
|
||||
- 按优先级尝试各种格式,直到找到匹配的格式
|
||||
- 如果所有格式都失败,抛出详细的错误信息
|
||||
|
||||
### 2. 自定义序列化器
|
||||
- `StandardLocalDateTimeSerializer` 类负责统一输出格式
|
||||
- 所有 `LocalDateTime` 字段统一输出为 `yyyy-MM-dd HH:mm:ss` 格式
|
||||
- 确保API响应格式的一致性
|
||||
|
||||
### 3. 全局配置
|
||||
- 通过 `DateTimeConfig` 类配置全局的 `ObjectMapper`
|
||||
- 自动应用到所有 `LocalDateTime` 字段
|
||||
- 无需在每个DTO中添加 `@JsonFormat` 注解
|
||||
|
||||
### 4. 错误处理
|
||||
当时间格式无法解析时,会返回详细的错误信息:
|
||||
```json
|
||||
{
|
||||
"code": 400,
|
||||
"message": "无法解析时间格式: 2025-13-45 25:70:80。支持的格式包括: yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss, yyyy-MM-dd等",
|
||||
"data": null
|
||||
}
|
||||
```
|
||||
|
||||
## 优势
|
||||
|
||||
1. **兼容性强** - 支持12种常见的时间格式
|
||||
2. **使用简单** - 无需在DTO中添加注解
|
||||
3. **输出统一** - 所有时间字段统一输出为标准格式
|
||||
4. **错误友好** - 提供详细的错误信息
|
||||
5. **性能优化** - 按优先级尝试格式,提高解析效率
|
||||
6. **扩展性好** - 可以轻松添加新的时间格式
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. 时间格式必须严格按照支持的格式,不能有额外的空格或字符
|
||||
2. 日期格式(如 `yyyy-MM-dd`)的时间部分会默认为 `00:00:00`
|
||||
3. 如果输入的时间格式不在支持列表中,会抛出解析异常
|
||||
4. 建议前端统一使用 `yyyy-MM-dd HH:mm:ss` 格式,这是最常用的格式
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
package top.xyquan.ecomdmbbackend.common.config;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日期时间配置类
|
||||
* 支持多种时间格式的自动解析
|
||||
*/
|
||||
@Configuration
|
||||
public class DateTimeConfig {
|
||||
|
||||
/**
|
||||
* 支持的时间格式列表
|
||||
*/
|
||||
private static final List<DateTimeFormatter> DATE_TIME_FORMATTERS = Arrays.asList(
|
||||
// 标准格式:yyyy-MM-dd HH:mm:ss
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"),
|
||||
// ISO 8601格式:yyyy-MM-ddTHH:mm:ss
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"),
|
||||
// 带毫秒的ISO格式:yyyy-MM-ddTHH:mm:ss.SSS
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS"),
|
||||
// 带毫秒的标准格式:yyyy-MM-dd HH:mm:ss.SSS
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"),
|
||||
// 日期格式:yyyy-MM-dd
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd"),
|
||||
// 中文格式:yyyy年MM月dd日 HH:mm:ss
|
||||
DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss"),
|
||||
// 中文格式:yyyy年MM月dd日
|
||||
DateTimeFormatter.ofPattern("yyyy年MM月dd日"),
|
||||
// 斜杠格式:yyyy/MM/dd HH:mm:ss
|
||||
DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"),
|
||||
// 斜杠格式:yyyy/MM/dd
|
||||
DateTimeFormatter.ofPattern("yyyy/MM/dd"),
|
||||
// 点格式:yyyy.MM.dd HH:mm:ss
|
||||
DateTimeFormatter.ofPattern("yyyy.MM.dd HH:mm:ss"),
|
||||
// 点格式:yyyy.MM.dd
|
||||
DateTimeFormatter.ofPattern("yyyy.MM.dd")
|
||||
);
|
||||
|
||||
/**
|
||||
* 支持带时区的时间格式列表
|
||||
*/
|
||||
private static final List<DateTimeFormatter> ZONED_DATE_TIME_FORMATTERS = Arrays.asList(
|
||||
// ISO 8601带时区格式:yyyy-MM-ddTHH:mm:ss.SSSZ
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"),
|
||||
// ISO 8601带时区格式:yyyy-MM-ddTHH:mm:ssZ
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'"),
|
||||
// ISO 8601带时区格式:yyyy-MM-ddTHH:mm:ss.SSSXXX
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"),
|
||||
// ISO 8601带时区格式:yyyy-MM-ddTHH:mm:ssXXX
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX"),
|
||||
// ISO 8601带时区格式:yyyy-MM-ddTHH:mm:ss.SSSZ
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ"),
|
||||
// ISO 8601带时区格式:yyyy-MM-ddTHH:mm:ssZ
|
||||
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
);
|
||||
|
||||
/**
|
||||
* 自定义LocalDateTime反序列化器
|
||||
*/
|
||||
public static class FlexibleLocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
|
||||
@Override
|
||||
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||
String dateTimeString = p.getText().trim();
|
||||
|
||||
if (dateTimeString == null || dateTimeString.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 首先尝试带时区的格式
|
||||
for (DateTimeFormatter formatter : ZONED_DATE_TIME_FORMATTERS) {
|
||||
try {
|
||||
ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateTimeString, formatter);
|
||||
return zonedDateTime.toLocalDateTime();
|
||||
} catch (DateTimeParseException e) {
|
||||
// 继续尝试下一个格式
|
||||
}
|
||||
}
|
||||
|
||||
// 然后尝试不带时区的格式
|
||||
for (DateTimeFormatter formatter : DATE_TIME_FORMATTERS) {
|
||||
try {
|
||||
return LocalDateTime.parse(dateTimeString, formatter);
|
||||
} catch (DateTimeParseException e) {
|
||||
// 继续尝试下一个格式
|
||||
}
|
||||
}
|
||||
|
||||
// 如果所有格式都失败,抛出异常
|
||||
throw new IOException("无法解析时间格式: " + dateTimeString +
|
||||
"。支持的格式包括: yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss, yyyy-MM-ddTHH:mm:ss.SSSZ, yyyy-MM-dd等");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义LocalDateTime序列化器
|
||||
* 统一输出格式为 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
public static class StandardLocalDateTimeSerializer extends JsonSerializer<LocalDateTime> {
|
||||
private static final DateTimeFormatter OUTPUT_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Override
|
||||
public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
|
||||
if (value == null) {
|
||||
gen.writeNull();
|
||||
} else {
|
||||
gen.writeString(value.format(OUTPUT_FORMATTER));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置ObjectMapper支持多种时间格式
|
||||
*/
|
||||
@Bean
|
||||
@Primary
|
||||
public ObjectMapper objectMapper() {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
// 注册Java时间模块
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
|
||||
// 创建自定义模块
|
||||
SimpleModule dateTimeModule = new SimpleModule();
|
||||
// 添加反序列化器(输入)
|
||||
dateTimeModule.addDeserializer(LocalDateTime.class, new FlexibleLocalDateTimeDeserializer());
|
||||
// 添加序列化器(输出)
|
||||
dateTimeModule.addSerializer(LocalDateTime.class, new StandardLocalDateTimeSerializer());
|
||||
|
||||
// 注册自定义模块
|
||||
mapper.registerModule(dateTimeModule);
|
||||
|
||||
return mapper;
|
||||
}
|
||||
}
|
||||
+10
@@ -9,9 +9,11 @@ import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.BatchImportOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.OrderFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.BatchImportResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.OrderService;
|
||||
|
||||
@@ -72,4 +74,12 @@ public class OrderController {
|
||||
OrderVO orderVO = orderService.getOrderById(id);
|
||||
return ApiResponse.success(orderVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量导入订单", description = "批量导入订单数据,支持部分成功部分失败")
|
||||
@PostMapping("/batch-import")
|
||||
@RequireRole(description = "批量导入订单", allowUser = false)
|
||||
public ApiResponse<BatchImportResultVO> batchImportOrders(@Valid @RequestBody BatchImportOrderDTO batchImportOrderDTO) {
|
||||
BatchImportResultVO result = orderService.batchImportOrders(batchImportOrderDTO);
|
||||
return ApiResponse.success(result);
|
||||
}
|
||||
}
|
||||
|
||||
+27
@@ -5,11 +5,14 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductWithSpecsDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
|
||||
@@ -63,4 +66,28 @@ public class ProductController {
|
||||
PageResultVO<ProductVO> result = productService.getProductPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "一键创建商品和规格", description = "一次性创建商品和多个规格")
|
||||
@PostMapping("/create-with-specs")
|
||||
@RequireRole(description = "一键创建商品和规格", allowUser = false)
|
||||
public ApiResponse<ProductVO> createProductWithSpecs(@Valid @RequestBody CreateProductWithSpecsDTO createProductWithSpecsDTO) {
|
||||
ProductVO productVO = productService.createProductWithSpecs(createProductWithSpecsDTO);
|
||||
return ApiResponse.success(productVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据名称精准查询商品", description = "根据商品名称精准查询商品信息,用于数据导入")
|
||||
@GetMapping("/find-by-name/{name}")
|
||||
@RequireRole(description = "根据名称查询商品", allowUser = true)
|
||||
public ApiResponse<ProductVO> getProductByName(@Parameter(description = "商品名称") @PathVariable String name) {
|
||||
ProductVO productVO = productService.getProductByName(name);
|
||||
return ApiResponse.success(productVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量根据名称查询商品", description = "批量根据商品名称精准查询商品信息,用于数据导入")
|
||||
@PostMapping("/find-by-names")
|
||||
@RequireRole(description = "批量根据名称查询商品", allowUser = true)
|
||||
public ApiResponse<List<ProductVO>> getProductsByNames(@RequestBody List<String> names) {
|
||||
List<ProductVO> productVOs = productService.getProductsByNames(names);
|
||||
return ApiResponse.success(productVOs);
|
||||
}
|
||||
}
|
||||
|
||||
+54
-44
@@ -1,79 +1,89 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ec.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductSpecDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductSpecFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductSpecDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductSpecVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService;
|
||||
|
||||
import java.util.List;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService.ProductSpecQueryDTO;
|
||||
|
||||
/**
|
||||
* 商品规格控制器
|
||||
* 商品规格管理控制器
|
||||
*/
|
||||
@Tag(name = "电商-商品规格管理", description = "商品规格的增删改查接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/ec/product-spec")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "电商-商品规格管理", description = "商品规格相关接口")
|
||||
@RequestMapping("/ec/product-spec")
|
||||
public class ProductSpecController {
|
||||
|
||||
private final ProductSpecService productSpecService;
|
||||
|
||||
@PostMapping
|
||||
public ProductSpecController(ProductSpecService productSpecService) {
|
||||
this.productSpecService = productSpecService;
|
||||
}
|
||||
|
||||
@Operation(summary = "创建商品规格", description = "创建新的商品规格")
|
||||
public ApiResponse<Long> createProductSpec(@Valid @RequestBody CreateProductSpecDTO dto) {
|
||||
Long id = productSpecService.createProductSpec(dto);
|
||||
return ApiResponse.success(id);
|
||||
@PostMapping("/create")
|
||||
@RequireRole(description = "创建商品规格", allowUser = false)
|
||||
public ApiResponse<ProductSpecVO> createProductSpec(@Valid @RequestBody CreateProductSpecDTO createProductSpecDTO) {
|
||||
ProductSpecVO productSpecVO = productSpecService.createProductSpec(createProductSpecDTO);
|
||||
return ApiResponse.success(productSpecVO);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "更新商品规格", description = "更新商品规格信息")
|
||||
public ApiResponse<Void> updateProductSpec(@Valid @RequestBody UpdateProductSpecDTO dto) {
|
||||
productSpecService.updateProductSpec(dto);
|
||||
return ApiResponse.success();
|
||||
@Operation(summary = "更新商品规格", description = "更新现有商品规格信息")
|
||||
@PutMapping("/update/{id}")
|
||||
@RequireRole(description = "更新商品规格", allowUser = false)
|
||||
public ApiResponse<ProductSpecVO> updateProductSpec(@Valid @RequestBody UpdateProductSpecDTO updateProductSpecDTO,
|
||||
@Parameter(description = "商品规格ID") @PathVariable Long id) {
|
||||
ProductSpecVO productSpecVO = productSpecService.updateProductSpec(updateProductSpecDTO, id);
|
||||
return ApiResponse.success(productSpecVO);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除商品规格", description = "删除指定的商品规格")
|
||||
@Operation(summary = "删除商品规格", description = "删除指定商品规格")
|
||||
@DeleteMapping("/delete/{id}")
|
||||
@RequireRole(description = "删除商品规格", allowUser = false)
|
||||
public ApiResponse<Void> deleteProductSpec(
|
||||
@Parameter(description = "规格ID", required = true) @PathVariable Long id) {
|
||||
@Parameter(description = "商品规格ID") @PathVariable Long id) {
|
||||
productSpecService.deleteProductSpec(id);
|
||||
return ApiResponse.success();
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@Operation(summary = "查询商品规格详情", description = "根据ID查询商品规格详情")
|
||||
public ApiResponse<ProductSpecVO> getProductSpecById(
|
||||
@Parameter(description = "规格ID", required = true) @PathVariable Long id) {
|
||||
ProductSpecVO vo = productSpecService.getProductSpecById(id);
|
||||
return ApiResponse.success(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询商品规格", description = "分页查询商品规格列表")
|
||||
public ApiResponse<IPage<ProductSpecVO>> getProductSpecPage(
|
||||
@Parameter(description = "页码", example = "1") @RequestParam(defaultValue = "1") Long current,
|
||||
@Parameter(description = "每页大小", example = "10") @RequestParam(defaultValue = "10") Long size,
|
||||
ProductSpecFilterDTO filter) {
|
||||
Page<ProductSpecVO> page = new Page<>(current, size);
|
||||
IPage<ProductSpecVO> result = productSpecService.getProductSpecPage(page, filter);
|
||||
@Operation(summary = "分页获取商品规格列表", description = "分页获取商品规格列表,支持条件过滤")
|
||||
@PostMapping("/page")
|
||||
@RequireRole(description = "查询商品规格列表", allowUser = true)
|
||||
public ApiResponse<PageResultVO<ProductSpecVO>> getProductSpecPage(
|
||||
@Valid @RequestBody PageQueryDTO<ProductSpecFilterDTO> pageQueryDTO) {
|
||||
PageResultVO<ProductSpecVO> result = productSpecService.getProductSpecPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
}
|
||||
|
||||
@GetMapping("/product/{productId}")
|
||||
@Operation(summary = "查询商品规格列表", description = "根据商品ID查询规格列表")
|
||||
public ApiResponse<List<ProductSpecVO>> getProductSpecsByProductId(
|
||||
@Parameter(description = "商品ID", required = true) @PathVariable Long productId) {
|
||||
List<ProductSpecVO> list = productSpecService.getProductSpecsByProductId(productId);
|
||||
return ApiResponse.success(list);
|
||||
@Operation(summary = "根据商品名称和规格编码精准查询商品规格", description = "根据商品名称和规格编码精准查询商品规格信息,用于数据导入")
|
||||
@GetMapping("/find-by-product-and-spec/{productName}/{specCode}")
|
||||
@RequireRole(description = "根据商品名称和规格编码查询商品规格", allowUser = true)
|
||||
public ApiResponse<ProductSpecVO> getProductSpecByProductAndSpec(
|
||||
@Parameter(description = "商品名称") @PathVariable String productName,
|
||||
@Parameter(description = "规格编码") @PathVariable String specCode) {
|
||||
ProductSpecVO productSpecVO = productSpecService.getProductSpecByProductAndSpec(productName, specCode);
|
||||
return ApiResponse.success(productSpecVO);
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "批量根据商品名称和规格编码查询商品规格", description = "批量根据商品名称和规格编码精准查询商品规格信息,用于数据导入")
|
||||
@PostMapping("/find-by-product-and-specs")
|
||||
@RequireRole(description = "批量根据商品名称和规格编码查询商品规格", allowUser = true)
|
||||
public ApiResponse<List<ProductVO>> getProductSpecsByProductAndSpecs(@RequestBody List<ProductSpecQueryDTO> queries) {
|
||||
List<ProductVO> productVOs = productSpecService.getProductSpecsByProductAndSpecs(queries);
|
||||
return ApiResponse.success(productVOs);
|
||||
}
|
||||
|
||||
}
|
||||
+34
@@ -5,6 +5,9 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
@@ -14,6 +17,8 @@ import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.ShopFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.UpdateShopDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ShopVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ShopService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
|
||||
import top.xyquan.ecomdmbbackend.utils.FileUploadUtils;
|
||||
|
||||
/**
|
||||
* 店铺管理控制器
|
||||
@@ -63,4 +68,33 @@ public class ShopController {
|
||||
PageResultVO<ShopVO> result = shopService.getShopPage(pageQueryDTO);
|
||||
return ApiResponse.success(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "上传店铺Logo", description = "上传店铺Logo图片,支持跨公司共享")
|
||||
@PostMapping("/upload-logo")
|
||||
@RequireRole(description = "上传店铺Logo", allowUser = false)
|
||||
public ApiResponse<MediaImageVO> uploadLogo(@RequestParam("file") MultipartFile file) {
|
||||
// 检查是否为图片文件
|
||||
if (!FileUploadUtils.isImageFile(file.getOriginalFilename())) {
|
||||
return ApiResponse.fail("只能上传图片文件");
|
||||
}
|
||||
|
||||
MediaImageVO mediaImageVO = shopService.uploadLogo(file);
|
||||
return ApiResponse.success(mediaImageVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据名称精准查询店铺", description = "根据店铺名称精准查询店铺信息,用于数据导入")
|
||||
@GetMapping("/find-by-name/{name}")
|
||||
@RequireRole(description = "根据名称查询店铺", allowUser = true)
|
||||
public ApiResponse<ShopVO> getShopByName(@Parameter(description = "店铺名称") @PathVariable String name) {
|
||||
ShopVO shopVO = shopService.getShopByName(name);
|
||||
return ApiResponse.success(shopVO);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量根据名称查询店铺", description = "批量根据店铺名称精准查询店铺信息,用于数据导入")
|
||||
@PostMapping("/find-by-names")
|
||||
@RequireRole(description = "批量根据名称查询店铺", allowUser = true)
|
||||
public ApiResponse<List<ShopVO>> getShopsByNames(@RequestBody List<String> names) {
|
||||
List<ShopVO> shopVOs = shopService.getShopsByNames(names);
|
||||
return ApiResponse.success(shopVOs);
|
||||
}
|
||||
}
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.order;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 批量导入订单DTO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "批量导入订单DTO")
|
||||
public class BatchImportOrderDTO {
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
*/
|
||||
@Schema(description = "订单列表", required = true)
|
||||
@NotEmpty(message = "订单列表不能为空")
|
||||
@Valid
|
||||
private List<CreateOrderDTO> orders;
|
||||
}
|
||||
+22
-9
@@ -1,14 +1,12 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.order;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 创建订单DTO
|
||||
@@ -33,7 +31,8 @@ public class CreateOrderDTO {
|
||||
/**
|
||||
* 订单状态ID
|
||||
*/
|
||||
@Schema(description = "订单状态ID", example = "1")
|
||||
@Schema(description = "订单状态ID", example = "1", required = true)
|
||||
@NotNull(message = "订单状态ID不能为空")
|
||||
private Long statusId;
|
||||
|
||||
/**
|
||||
@@ -57,10 +56,24 @@ public class CreateOrderDTO {
|
||||
private LocalDateTime orderDate;
|
||||
|
||||
/**
|
||||
* 订单明细列表
|
||||
* 商品ID
|
||||
*/
|
||||
@Schema(description = "订单明细列表", required = true)
|
||||
@NotEmpty(message = "订单明细不能为空")
|
||||
@Valid
|
||||
private List<CreateOrderItemDTO> orderItems;
|
||||
@Schema(description = "商品ID", example = "1", required = true)
|
||||
@NotNull(message = "商品ID不能为空")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 商品规格ID
|
||||
*/
|
||||
@Schema(description = "商品规格ID", example = "1", required = true)
|
||||
@NotNull(message = "商品规格ID不能为空")
|
||||
private Long productSpecId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description = "数量", example = "1", required = true)
|
||||
@NotNull(message = "数量不能为空")
|
||||
@Positive(message = "数量必须大于0")
|
||||
private Integer quantity;
|
||||
}
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ec.model.dto.product;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 一键创建商品和规格DTO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "一键创建商品和规格DTO")
|
||||
public class CreateProductWithSpecsDTO {
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description = "商品名称", example = "iPhone 15 Pro", required = true)
|
||||
@NotBlank(message = "商品名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 主图图片ID
|
||||
*/
|
||||
@Schema(description = "主图图片ID", example = "1")
|
||||
private Long mainImageId;
|
||||
|
||||
/**
|
||||
* 商品规格列表
|
||||
*/
|
||||
@Schema(description = "商品规格列表", required = true)
|
||||
@NotEmpty(message = "商品规格列表不能为空")
|
||||
@Valid
|
||||
private List<ProductSpecDTO> specs;
|
||||
|
||||
/**
|
||||
* 商品规格DTO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "商品规格DTO")
|
||||
public static class ProductSpecDTO {
|
||||
|
||||
/**
|
||||
* 规格名称
|
||||
*/
|
||||
@Schema(description = "规格名称", example = "128GB 深空黑色", required = true)
|
||||
@NotBlank(message = "规格名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格编码
|
||||
*/
|
||||
@Schema(description = "规格编码", example = "IPHONE15PRO-128G-BLACK")
|
||||
private String specCode;
|
||||
|
||||
/**
|
||||
* 成本价
|
||||
*/
|
||||
@Schema(description = "成本价", example = "8000.00", required = true)
|
||||
@NotNull(message = "成本价不能为空")
|
||||
private BigDecimal costPrice;
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ec.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 批量导入结果VO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "批量导入结果VO")
|
||||
public class BatchImportResultVO {
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
@Schema(description = "总数量", example = "100")
|
||||
private Integer totalCount;
|
||||
|
||||
/**
|
||||
* 成功数量
|
||||
*/
|
||||
@Schema(description = "成功数量", example = "95")
|
||||
private Integer successCount;
|
||||
|
||||
/**
|
||||
* 失败数量
|
||||
*/
|
||||
@Schema(description = "失败数量", example = "5")
|
||||
private Integer failureCount;
|
||||
|
||||
/**
|
||||
* 成功创建的订单列表
|
||||
*/
|
||||
@Schema(description = "成功创建的订单列表")
|
||||
private List<OrderVO> successOrders;
|
||||
|
||||
/**
|
||||
* 失败记录列表
|
||||
*/
|
||||
@Schema(description = "失败记录列表")
|
||||
private List<ImportFailureRecord> failureRecords;
|
||||
|
||||
/**
|
||||
* 导入失败记录
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "导入失败记录")
|
||||
public static class ImportFailureRecord {
|
||||
|
||||
/**
|
||||
* 失败行号(从1开始)
|
||||
*/
|
||||
@Schema(description = "失败行号", example = "3")
|
||||
private Integer rowNumber;
|
||||
|
||||
/**
|
||||
* 平台订单号
|
||||
*/
|
||||
@Schema(description = "平台订单号", example = "TB202401010003")
|
||||
private String platformOrderNo;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
@Schema(description = "失败原因", example = "店铺不存在")
|
||||
private String failureReason;
|
||||
}
|
||||
}
|
||||
+7
@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品VO
|
||||
@@ -59,4 +60,10 @@ public class ProductVO {
|
||||
*/
|
||||
@Schema(description = "更新人ID", example = "1")
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 商品规格列表
|
||||
*/
|
||||
@Schema(description = "商品规格列表")
|
||||
private List<ProductSpecVO> specs;
|
||||
}
|
||||
|
||||
+10
@@ -3,10 +3,12 @@ package top.xyquan.ecomdmbbackend.modules.ec.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.BatchImportOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.OrderFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.OrderPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.BatchImportResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderVO;
|
||||
|
||||
/**
|
||||
@@ -53,4 +55,12 @@ public interface OrderService extends IService<OrderPO> {
|
||||
* @return 订单VO
|
||||
*/
|
||||
OrderVO getOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 批量导入订单
|
||||
*
|
||||
* @param batchImportOrderDTO 批量导入订单DTO
|
||||
* @return 批量导入结果VO
|
||||
*/
|
||||
BatchImportResultVO batchImportOrders(BatchImportOrderDTO batchImportOrderDTO);
|
||||
}
|
||||
|
||||
+27
@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductWithSpecsDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品服务接口
|
||||
*/
|
||||
@@ -45,4 +48,28 @@ public interface ProductService extends IService<ProductPO> {
|
||||
* @return 分页结果
|
||||
*/
|
||||
PageResultVO<ProductVO> getProductPage(PageQueryDTO<ProductFilterDTO> pageQueryDTO);
|
||||
|
||||
/**
|
||||
* 一键创建商品和规格
|
||||
*
|
||||
* @param createProductWithSpecsDTO 创建商品和规格DTO
|
||||
* @return 商品VO
|
||||
*/
|
||||
ProductVO createProductWithSpecs(CreateProductWithSpecsDTO createProductWithSpecsDTO);
|
||||
|
||||
/**
|
||||
* 根据名称精准查询商品
|
||||
*
|
||||
* @param name 商品名称
|
||||
* @return 商品VO
|
||||
*/
|
||||
ProductVO getProductByName(String name);
|
||||
|
||||
/**
|
||||
* 批量根据名称查询商品
|
||||
*
|
||||
* @param names 商品名称列表
|
||||
* @return 商品VO列表
|
||||
*/
|
||||
List<ProductVO> getProductsByNames(List<String> names);
|
||||
}
|
||||
|
||||
+58
-12
@@ -1,46 +1,92 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ec.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductSpecDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductSpecFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductSpecDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductSpecVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品规格服务接口
|
||||
*/
|
||||
public interface ProductSpecService {
|
||||
public interface ProductSpecService extends IService<ProductSpecPO> {
|
||||
|
||||
/**
|
||||
* 创建商品规格
|
||||
*
|
||||
* @param createProductSpecDTO 创建商品规格DTO
|
||||
* @return 商品规格VO
|
||||
*/
|
||||
Long createProductSpec(CreateProductSpecDTO dto);
|
||||
ProductSpecVO createProductSpec(CreateProductSpecDTO createProductSpecDTO);
|
||||
|
||||
/**
|
||||
* 更新商品规格
|
||||
*
|
||||
* @param updateProductSpecDTO 更新商品规格DTO
|
||||
* @param id 规格ID
|
||||
* @return 商品规格VO
|
||||
*/
|
||||
void updateProductSpec(UpdateProductSpecDTO dto);
|
||||
ProductSpecVO updateProductSpec(UpdateProductSpecDTO updateProductSpecDTO, Long id);
|
||||
|
||||
/**
|
||||
* 删除商品规格
|
||||
*
|
||||
* @param id 规格ID
|
||||
*/
|
||||
void deleteProductSpec(Long id);
|
||||
|
||||
/**
|
||||
* 根据ID查询商品规格
|
||||
* 分页获取商品规格列表
|
||||
*
|
||||
* @param pageQueryDTO 分页查询DTO
|
||||
* @return 分页结果
|
||||
*/
|
||||
ProductSpecVO getProductSpecById(Long id);
|
||||
PageResultVO<ProductSpecVO> getProductSpecPage(PageQueryDTO<ProductSpecFilterDTO> pageQueryDTO);
|
||||
|
||||
/**
|
||||
* 分页查询商品规格
|
||||
* 根据商品名称和规格编码精准查询商品规格
|
||||
*
|
||||
* @param productName 商品名称
|
||||
* @param specCode 规格编码
|
||||
* @return 商品规格VO
|
||||
*/
|
||||
IPage<ProductSpecVO> getProductSpecPage(Page<ProductSpecVO> page, ProductSpecFilterDTO filter);
|
||||
ProductSpecVO getProductSpecByProductAndSpec(String productName, String specCode);
|
||||
|
||||
/**
|
||||
* 根据商品ID查询规格列表
|
||||
* 批量根据商品名称和规格编码查询商品规格
|
||||
*
|
||||
* @param queries 查询条件列表
|
||||
* @return 包含规格信息的商品VO列表
|
||||
*/
|
||||
List<ProductSpecVO> getProductSpecsByProductId(Long productId);
|
||||
}
|
||||
List<ProductVO> getProductSpecsByProductAndSpecs(List<ProductSpecQueryDTO> queries);
|
||||
|
||||
/**
|
||||
* 商品规格查询DTO
|
||||
*/
|
||||
class ProductSpecQueryDTO {
|
||||
private String productName;
|
||||
private String specCode;
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getSpecCode() {
|
||||
return specCode;
|
||||
}
|
||||
|
||||
public void setSpecCode(String specCode) {
|
||||
this.specCode = specCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
+28
@@ -1,6 +1,7 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ec.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.CreateShopDTO;
|
||||
@@ -8,6 +9,9 @@ import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.ShopFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.shop.UpdateShopDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ShopPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ShopVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺服务接口
|
||||
@@ -45,4 +49,28 @@ public interface ShopService extends IService<ShopPO> {
|
||||
* @return 分页结果
|
||||
*/
|
||||
PageResultVO<ShopVO> getShopPage(PageQueryDTO<ShopFilterDTO> pageQueryDTO);
|
||||
|
||||
/**
|
||||
* 上传店铺Logo
|
||||
*
|
||||
* @param file Logo文件
|
||||
* @return 上传后的图片信息
|
||||
*/
|
||||
MediaImageVO uploadLogo(MultipartFile file);
|
||||
|
||||
/**
|
||||
* 根据名称精准查询店铺
|
||||
*
|
||||
* @param name 店铺名称
|
||||
* @return 店铺VO
|
||||
*/
|
||||
ShopVO getShopByName(String name);
|
||||
|
||||
/**
|
||||
* 批量根据名称查询店铺
|
||||
*
|
||||
* @param names 店铺名称列表
|
||||
* @return 店铺VO列表
|
||||
*/
|
||||
List<ShopVO> getShopsByNames(List<String> names);
|
||||
}
|
||||
|
||||
+96
-23
@@ -12,20 +12,26 @@ import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.mapper.OrderItemMapper;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.mapper.OrderMapper;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.BatchImportOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.CreateOrderItemDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.OrderFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.order.UpdateOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.OrderItemPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.OrderPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ShopPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.BatchImportResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderItemVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.OrderVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.OrderService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ShopService;
|
||||
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -37,11 +43,17 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderPO> implemen
|
||||
|
||||
private final CurrentUserContext currentUserContext;
|
||||
private final ShopService shopService;
|
||||
private final ProductService productService;
|
||||
private final ProductSpecService productSpecService;
|
||||
private final OrderItemMapper orderItemMapper;
|
||||
|
||||
public OrderServiceImpl(CurrentUserContext currentUserContext, ShopService shopService, OrderItemMapper orderItemMapper) {
|
||||
public OrderServiceImpl(CurrentUserContext currentUserContext, ShopService shopService,
|
||||
ProductService productService, ProductSpecService productSpecService,
|
||||
OrderItemMapper orderItemMapper) {
|
||||
this.currentUserContext = currentUserContext;
|
||||
this.shopService = shopService;
|
||||
this.productService = productService;
|
||||
this.productSpecService = productSpecService;
|
||||
this.orderItemMapper = orderItemMapper;
|
||||
}
|
||||
|
||||
@@ -57,6 +69,19 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderPO> implemen
|
||||
throw new BusinessException("店铺不存在");
|
||||
}
|
||||
|
||||
// 验证商品是否存在且属于当前公司
|
||||
ProductPO product = productService.getById(createOrderDTO.getProductId());
|
||||
if (product == null || !product.getCompanyId().equals(companyId)) {
|
||||
throw new BusinessException("商品不存在");
|
||||
}
|
||||
|
||||
// 验证商品规格是否存在且属于当前公司
|
||||
ProductSpecPO productSpec = productSpecService.getById(createOrderDTO.getProductSpecId());
|
||||
if (productSpec == null || !productSpec.getCompanyId().equals(companyId) ||
|
||||
!productSpec.getProductId().equals(createOrderDTO.getProductId())) {
|
||||
throw new BusinessException("商品规格不存在或不属于该商品");
|
||||
}
|
||||
|
||||
// 验证平台订单号是否重复(如果提供了的话)
|
||||
if (createOrderDTO.getPlatformOrderNo() != null && !createOrderDTO.getPlatformOrderNo().trim().isEmpty()) {
|
||||
LambdaQueryWrapper<OrderPO> wrapper = new LambdaQueryWrapper<>();
|
||||
@@ -70,34 +95,40 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderPO> implemen
|
||||
|
||||
// 创建订单
|
||||
OrderPO order = new OrderPO();
|
||||
BeanUtils.copyProperties(createOrderDTO, order);
|
||||
|
||||
// 设置公司ID
|
||||
order.setCompanyId(companyId);
|
||||
|
||||
// 设置默认值
|
||||
if (order.getStatusId() == null) {
|
||||
// 默认使用状态码为0的订单状态(待发货)
|
||||
order.setStatusId(1L); // 假设状态ID为1对应待发货状态
|
||||
}
|
||||
if (order.getShippingFee() == null) {
|
||||
order.setShippingFee(java.math.BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
// 设置创建人ID
|
||||
order.setShopId(createOrderDTO.getShopId());
|
||||
order.setPlatformOrderNo(createOrderDTO.getPlatformOrderNo());
|
||||
order.setStatusId(createOrderDTO.getStatusId());
|
||||
order.setReceivedAmount(createOrderDTO.getReceivedAmount());
|
||||
order.setShippingFee(createOrderDTO.getShippingFee() != null ? createOrderDTO.getShippingFee() : java.math.BigDecimal.ZERO);
|
||||
order.setOrderDate(createOrderDTO.getOrderDate());
|
||||
order.setCreateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
// 保存订单
|
||||
this.save(order);
|
||||
|
||||
// 计算订单明细相关字段
|
||||
java.math.BigDecimal unitPrice = createOrderDTO.getReceivedAmount().divide(
|
||||
java.math.BigDecimal.valueOf(createOrderDTO.getQuantity()), 2, java.math.RoundingMode.HALF_UP);
|
||||
java.math.BigDecimal costPrice = productSpec.getCostPrice();
|
||||
java.math.BigDecimal subtotal = unitPrice.multiply(java.math.BigDecimal.valueOf(createOrderDTO.getQuantity()));
|
||||
java.math.BigDecimal costTotal = costPrice.multiply(java.math.BigDecimal.valueOf(createOrderDTO.getQuantity()));
|
||||
|
||||
// 创建订单明细
|
||||
for (CreateOrderItemDTO itemDTO : createOrderDTO.getOrderItems()) {
|
||||
OrderItemPO orderItem = new OrderItemPO();
|
||||
BeanUtils.copyProperties(itemDTO, orderItem);
|
||||
orderItem.setOrderId(order.getId());
|
||||
orderItem.setCreateBy(currentUserContext.getCurrentUserId());
|
||||
orderItemMapper.insert(orderItem);
|
||||
}
|
||||
OrderItemPO orderItem = new OrderItemPO();
|
||||
orderItem.setOrderId(order.getId());
|
||||
orderItem.setProductId(createOrderDTO.getProductId());
|
||||
orderItem.setProductSpecId(createOrderDTO.getProductSpecId());
|
||||
orderItem.setProductName(product.getName()); // 冗余存储商品名称
|
||||
orderItem.setSpecName(productSpec.getName()); // 冗余存储规格名称
|
||||
orderItem.setQuantity(createOrderDTO.getQuantity());
|
||||
orderItem.setUnitPrice(unitPrice); // 销售单价 = 实收金额 / 数量
|
||||
orderItem.setCostPrice(costPrice); // 成本价(下单时快照)
|
||||
orderItem.setSubtotal(subtotal); // 小计金额 = 销售单价 × 数量
|
||||
orderItem.setCostTotal(costTotal); // 成本小计 = 成本价 × 数量
|
||||
orderItem.setCreateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
orderItemMapper.insert(orderItem);
|
||||
|
||||
// 转换为VO并返回
|
||||
return convertToVO(order);
|
||||
@@ -267,6 +298,48 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderPO> implemen
|
||||
return orderVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public BatchImportResultVO batchImportOrders(BatchImportOrderDTO batchImportOrderDTO) {
|
||||
List<CreateOrderDTO> orders = batchImportOrderDTO.getOrders();
|
||||
List<OrderVO> successOrders = new ArrayList<>();
|
||||
List<BatchImportResultVO.ImportFailureRecord> failureRecords = new ArrayList<>();
|
||||
|
||||
int totalCount = orders.size();
|
||||
int successCount = 0;
|
||||
int failureCount = 0;
|
||||
|
||||
for (int i = 0; i < orders.size(); i++) {
|
||||
CreateOrderDTO orderDTO = orders.get(i);
|
||||
int rowNumber = i + 1; // 行号从1开始
|
||||
|
||||
try {
|
||||
// 尝试创建订单
|
||||
OrderVO orderVO = createOrder(orderDTO);
|
||||
successOrders.add(orderVO);
|
||||
successCount++;
|
||||
} catch (Exception e) {
|
||||
// 记录失败信息
|
||||
BatchImportResultVO.ImportFailureRecord failureRecord = new BatchImportResultVO.ImportFailureRecord();
|
||||
failureRecord.setRowNumber(rowNumber);
|
||||
failureRecord.setPlatformOrderNo(orderDTO.getPlatformOrderNo());
|
||||
failureRecord.setFailureReason(e.getMessage());
|
||||
failureRecords.add(failureRecord);
|
||||
failureCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// 构建返回结果
|
||||
BatchImportResultVO result = new BatchImportResultVO();
|
||||
result.setTotalCount(totalCount);
|
||||
result.setSuccessCount(successCount);
|
||||
result.setFailureCount(failureCount);
|
||||
result.setSuccessOrders(successOrders);
|
||||
result.setFailureRecords(failureRecords);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为VO
|
||||
*/
|
||||
|
||||
+125
-1
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import top.xyquan.ecomdmbbackend.common.exception.BusinessException;
|
||||
@@ -12,11 +13,15 @@ import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.mapper.ProductMapper;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductWithSpecsDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductSpecVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.service.MediaImageService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
|
||||
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
|
||||
@@ -33,10 +38,12 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductPO> im
|
||||
|
||||
private final CurrentUserContext currentUserContext;
|
||||
private final MediaImageService mediaImageService;
|
||||
private final ProductSpecService productSpecService;
|
||||
|
||||
public ProductServiceImpl(CurrentUserContext currentUserContext, MediaImageService mediaImageService) {
|
||||
public ProductServiceImpl(CurrentUserContext currentUserContext, MediaImageService mediaImageService, @Lazy ProductSpecService productSpecService) {
|
||||
this.currentUserContext = currentUserContext;
|
||||
this.mediaImageService = mediaImageService;
|
||||
this.productSpecService = productSpecService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -186,12 +193,129 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductPO> im
|
||||
return PageResultVO.create(voList, pageResult.getTotal(), pageQueryDTO.getPage(), pageQueryDTO.getPageSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ProductVO createProductWithSpecs(CreateProductWithSpecsDTO createProductWithSpecsDTO) {
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 验证商品名称是否重复
|
||||
LambdaQueryWrapper<ProductPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProductPO::getName, createProductWithSpecsDTO.getName())
|
||||
.eq(ProductPO::getCompanyId, companyId)
|
||||
.isNull(ProductPO::getDeleteTime);
|
||||
if (this.count(wrapper) > 0) {
|
||||
throw new BusinessException("商品名称已存在");
|
||||
}
|
||||
|
||||
// 创建商品
|
||||
ProductPO product = new ProductPO();
|
||||
product.setName(createProductWithSpecsDTO.getName());
|
||||
product.setCompanyId(companyId);
|
||||
|
||||
// 处理主图图片关联
|
||||
if (createProductWithSpecsDTO.getMainImageId() != null) {
|
||||
MediaImageVO mainImage = mediaImageService.getImageById(createProductWithSpecsDTO.getMainImageId());
|
||||
if (mainImage != null) {
|
||||
product.setMainImageId(createProductWithSpecsDTO.getMainImageId());
|
||||
product.setMainImage(mainImage.getUrl()); // 设置冗余字段
|
||||
}
|
||||
}
|
||||
|
||||
// 设置创建人ID
|
||||
product.setCreateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
// 保存商品
|
||||
this.save(product);
|
||||
|
||||
// 创建商品规格
|
||||
List<CreateProductWithSpecsDTO.ProductSpecDTO> specDTOs = createProductWithSpecsDTO.getSpecs();
|
||||
for (CreateProductWithSpecsDTO.ProductSpecDTO specDTO : specDTOs) {
|
||||
ProductSpecPO productSpec = new ProductSpecPO();
|
||||
productSpec.setCompanyId(companyId);
|
||||
productSpec.setProductId(product.getId());
|
||||
productSpec.setName(specDTO.getName());
|
||||
productSpec.setSpecCode(specDTO.getSpecCode());
|
||||
productSpec.setCostPrice(specDTO.getCostPrice());
|
||||
productSpec.setCreateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
productSpecService.save(productSpec);
|
||||
}
|
||||
|
||||
// 转换为VO并返回
|
||||
return convertToVO(product);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为VO
|
||||
*/
|
||||
private ProductVO convertToVO(ProductPO product) {
|
||||
ProductVO productVO = new ProductVO();
|
||||
BeanUtils.copyProperties(product, productVO);
|
||||
|
||||
// 查询商品规格列表
|
||||
LambdaQueryWrapper<ProductSpecPO> specWrapper = new LambdaQueryWrapper<>();
|
||||
specWrapper.eq(ProductSpecPO::getProductId, product.getId())
|
||||
.eq(ProductSpecPO::getCompanyId, product.getCompanyId())
|
||||
.isNull(ProductSpecPO::getDeleteTime)
|
||||
.orderByAsc(ProductSpecPO::getCreateTime);
|
||||
|
||||
List<ProductSpecPO> specPOs = productSpecService.list(specWrapper);
|
||||
List<ProductSpecVO> specVOs = specPOs.stream()
|
||||
.map(this::convertSpecToVO)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
productVO.setSpecs(specVOs);
|
||||
return productVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductVO getProductByName(String name) {
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 根据名称精准查询商品
|
||||
LambdaQueryWrapper<ProductPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProductPO::getName, name)
|
||||
.eq(ProductPO::getCompanyId, companyId)
|
||||
.isNull(ProductPO::getDeleteTime);
|
||||
|
||||
ProductPO product = this.getOne(wrapper);
|
||||
if (product == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return convertToVO(product);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductVO> getProductsByNames(List<String> names) {
|
||||
if (names == null || names.isEmpty()) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 批量根据名称查询商品
|
||||
LambdaQueryWrapper<ProductPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(ProductPO::getName, names)
|
||||
.eq(ProductPO::getCompanyId, companyId)
|
||||
.isNull(ProductPO::getDeleteTime)
|
||||
.orderByAsc(ProductPO::getName);
|
||||
|
||||
List<ProductPO> products = this.list(wrapper);
|
||||
return products.stream()
|
||||
.map(this::convertToVO)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换规格PO为VO
|
||||
*/
|
||||
private ProductSpecVO convertSpecToVO(ProductSpecPO productSpec) {
|
||||
ProductSpecVO productSpecVO = new ProductSpecVO();
|
||||
BeanUtils.copyProperties(productSpec, productSpecVO);
|
||||
return productSpecVO;
|
||||
}
|
||||
}
|
||||
|
||||
+265
-65
@@ -3,19 +3,26 @@ package top.xyquan.ecomdmbbackend.modules.ec.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import top.xyquan.ecomdmbbackend.common.exception.BusinessException;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.mapper.ProductSpecMapper;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.CreateProductSpecDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.ProductSpecFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.dto.product.UpdateProductSpecDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.po.ProductSpecPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductSpecVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.model.vo.ProductVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ec.service.ProductSpecService;
|
||||
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -23,90 +30,283 @@ import java.util.stream.Collectors;
|
||||
* 商品规格服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProductSpecServiceImpl implements ProductSpecService {
|
||||
public class ProductSpecServiceImpl extends ServiceImpl<ProductSpecMapper, ProductSpecPO> implements ProductSpecService {
|
||||
|
||||
private final ProductSpecMapper productSpecMapper;
|
||||
private final CurrentUserContext currentUserContext;
|
||||
private final ProductService productService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createProductSpec(CreateProductSpecDTO dto) {
|
||||
ProductSpecPO po = new ProductSpecPO();
|
||||
BeanUtils.copyProperties(dto, po);
|
||||
po.setCompanyId(currentUserContext.getCurrentCompanyId());
|
||||
po.setCreateBy(currentUserContext.getCurrentUserId());
|
||||
po.setUpdateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
productSpecMapper.insert(po);
|
||||
return po.getId();
|
||||
public ProductSpecServiceImpl(CurrentUserContext currentUserContext, ProductService productService) {
|
||||
this.currentUserContext = currentUserContext;
|
||||
this.productService = productService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateProductSpec(UpdateProductSpecDTO dto) {
|
||||
ProductSpecPO po = new ProductSpecPO();
|
||||
BeanUtils.copyProperties(dto, po);
|
||||
po.setUpdateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
productSpecMapper.updateById(po);
|
||||
@Transactional
|
||||
public ProductSpecVO createProductSpec(CreateProductSpecDTO createProductSpecDTO) {
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 验证商品是否存在
|
||||
LambdaQueryWrapper<ProductSpecPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProductSpecPO::getProductId, createProductSpecDTO.getProductId())
|
||||
.eq(ProductSpecPO::getCompanyId, companyId)
|
||||
.isNull(ProductSpecPO::getDeleteTime);
|
||||
if (this.count(wrapper) == 0) {
|
||||
throw new BusinessException("商品不存在");
|
||||
}
|
||||
|
||||
// 验证规格名称是否重复
|
||||
wrapper.clear();
|
||||
wrapper.eq(ProductSpecPO::getProductId, createProductSpecDTO.getProductId())
|
||||
.eq(ProductSpecPO::getName, createProductSpecDTO.getName())
|
||||
.eq(ProductSpecPO::getCompanyId, companyId)
|
||||
.isNull(ProductSpecPO::getDeleteTime);
|
||||
if (this.count(wrapper) > 0) {
|
||||
throw new BusinessException("规格名称已存在");
|
||||
}
|
||||
|
||||
// 创建商品规格
|
||||
ProductSpecPO productSpec = new ProductSpecPO();
|
||||
BeanUtils.copyProperties(createProductSpecDTO, productSpec);
|
||||
productSpec.setCompanyId(companyId);
|
||||
|
||||
// 设置创建人ID
|
||||
productSpec.setCreateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
// 保存商品规格
|
||||
this.save(productSpec);
|
||||
|
||||
// 转换为VO并返回
|
||||
return convertToVO(productSpec);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Transactional
|
||||
public ProductSpecVO updateProductSpec(UpdateProductSpecDTO updateProductSpecDTO, Long id) {
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 验证商品规格是否存在
|
||||
ProductSpecPO existingProductSpec = this.getById(id);
|
||||
if (existingProductSpec == null || !existingProductSpec.getCompanyId().equals(companyId)) {
|
||||
throw new BusinessException("商品规格不存在");
|
||||
}
|
||||
|
||||
// 验证规格名称是否重复(排除当前规格)
|
||||
LambdaQueryWrapper<ProductSpecPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProductSpecPO::getProductId, existingProductSpec.getProductId())
|
||||
.eq(ProductSpecPO::getName, updateProductSpecDTO.getName())
|
||||
.eq(ProductSpecPO::getCompanyId, companyId)
|
||||
.ne(ProductSpecPO::getId, id)
|
||||
.isNull(ProductSpecPO::getDeleteTime);
|
||||
if (this.count(wrapper) > 0) {
|
||||
throw new BusinessException("规格名称已存在");
|
||||
}
|
||||
|
||||
// 更新商品规格
|
||||
ProductSpecPO productSpec = new ProductSpecPO();
|
||||
BeanUtils.copyProperties(updateProductSpecDTO, productSpec);
|
||||
productSpec.setId(id);
|
||||
productSpec.setCompanyId(companyId);
|
||||
productSpec.setProductId(existingProductSpec.getProductId());
|
||||
|
||||
// 设置更新人ID
|
||||
productSpec.setUpdateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
// 更新商品规格
|
||||
this.updateById(productSpec);
|
||||
|
||||
// 转换为VO并返回
|
||||
return convertToVO(productSpec);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteProductSpec(Long id) {
|
||||
ProductSpecPO po = new ProductSpecPO();
|
||||
po.setId(id);
|
||||
po.setDeleteBy(currentUserContext.getCurrentUserId());
|
||||
po.setDeleteTime(java.time.LocalDateTime.now());
|
||||
|
||||
productSpecMapper.updateById(po);
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 验证商品规格是否存在
|
||||
ProductSpecPO existingProductSpec = this.getById(id);
|
||||
if (existingProductSpec == null || !existingProductSpec.getCompanyId().equals(companyId)) {
|
||||
throw new BusinessException("商品规格不存在");
|
||||
}
|
||||
|
||||
// 软删除商品规格
|
||||
ProductSpecPO productSpec = new ProductSpecPO();
|
||||
productSpec.setId(id);
|
||||
productSpec.setDeleteTime(LocalDateTime.now());
|
||||
productSpec.setDeleteBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
this.updateById(productSpec);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductSpecVO getProductSpecById(Long id) {
|
||||
ProductSpecPO po = productSpecMapper.selectById(id);
|
||||
if (po == null) {
|
||||
public PageResultVO<ProductSpecVO> getProductSpecPage(PageQueryDTO<ProductSpecFilterDTO> pageQueryDTO) {
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 创建分页对象
|
||||
Page<ProductSpecPO> page = new Page<>(pageQueryDTO.getPage(), pageQueryDTO.getPageSize());
|
||||
|
||||
// 构建查询条件
|
||||
LambdaQueryWrapper<ProductSpecPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProductSpecPO::getCompanyId, companyId)
|
||||
.isNull(ProductSpecPO::getDeleteTime);
|
||||
|
||||
// 添加过滤条件
|
||||
ProductSpecFilterDTO filter = pageQueryDTO.getFilters();
|
||||
if (filter != null) {
|
||||
if (filter.getProductId() != null) {
|
||||
wrapper.eq(ProductSpecPO::getProductId, filter.getProductId());
|
||||
}
|
||||
if (filter.getName() != null && !filter.getName().trim().isEmpty()) {
|
||||
wrapper.like(ProductSpecPO::getName, filter.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// 排序
|
||||
wrapper.orderByDesc(ProductSpecPO::getCreateTime);
|
||||
|
||||
// 执行分页查询
|
||||
IPage<ProductSpecPO> pageResult = this.page(page, wrapper);
|
||||
|
||||
// 转换为VO
|
||||
List<ProductSpecVO> voList = pageResult.getRecords().stream()
|
||||
.map(this::convertToVO)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 构建分页结果
|
||||
return PageResultVO.create(voList, pageResult.getTotal(), pageQueryDTO.getPage(), pageQueryDTO.getPageSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductSpecVO getProductSpecByProductAndSpec(String productName, String specCode) {
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 先根据商品名称查询商品
|
||||
LambdaQueryWrapper<ProductPO> productWrapper = new LambdaQueryWrapper<>();
|
||||
productWrapper.eq(ProductPO::getName, productName)
|
||||
.eq(ProductPO::getCompanyId, companyId)
|
||||
.isNull(ProductPO::getDeleteTime);
|
||||
|
||||
ProductPO product = productService.getOne(productWrapper);
|
||||
if (product == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ProductSpecVO vo = new ProductSpecVO();
|
||||
BeanUtils.copyProperties(po, vo);
|
||||
return vo;
|
||||
|
||||
// 根据商品ID和规格编码查询规格
|
||||
LambdaQueryWrapper<ProductSpecPO> specWrapper = new LambdaQueryWrapper<>();
|
||||
specWrapper.eq(ProductSpecPO::getProductId, product.getId())
|
||||
.eq(ProductSpecPO::getSpecCode, specCode)
|
||||
.eq(ProductSpecPO::getCompanyId, companyId)
|
||||
.isNull(ProductSpecPO::getDeleteTime);
|
||||
|
||||
ProductSpecPO productSpec = this.getOne(specWrapper);
|
||||
if (productSpec == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return convertToVO(productSpec);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ProductSpecVO> getProductSpecPage(Page<ProductSpecVO> page, ProductSpecFilterDTO filter) {
|
||||
Page<ProductSpecPO> poPage = new Page<>(page.getCurrent(), page.getSize());
|
||||
IPage<ProductSpecPO> poPageResult = productSpecMapper.selectPageWithFilter(poPage, filter);
|
||||
|
||||
Page<ProductSpecVO> voPage = new Page<>(poPageResult.getCurrent(), poPageResult.getSize(), poPageResult.getTotal());
|
||||
List<ProductSpecVO> voList = poPageResult.getRecords().stream()
|
||||
.map(po -> {
|
||||
ProductSpecVO vo = new ProductSpecVO();
|
||||
BeanUtils.copyProperties(po, vo);
|
||||
return vo;
|
||||
public List<ProductVO> getProductSpecsByProductAndSpecs(List<ProductSpecQueryDTO> queries) {
|
||||
if (queries == null || queries.isEmpty()) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 收集所有商品名称
|
||||
List<String> productNames = queries.stream()
|
||||
.map(ProductSpecQueryDTO::getProductName)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 批量查询商品
|
||||
LambdaQueryWrapper<ProductPO> productWrapper = new LambdaQueryWrapper<>();
|
||||
productWrapper.in(ProductPO::getName, productNames)
|
||||
.eq(ProductPO::getCompanyId, companyId)
|
||||
.isNull(ProductPO::getDeleteTime);
|
||||
|
||||
List<ProductPO> products = productService.list(productWrapper);
|
||||
if (products.isEmpty()) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
// 创建商品名称到ID的映射
|
||||
var productNameToIdMap = products.stream()
|
||||
.collect(Collectors.toMap(ProductPO::getName, ProductPO::getId));
|
||||
|
||||
// 收集所有规格编码
|
||||
List<String> specCodes = queries.stream()
|
||||
.map(ProductSpecQueryDTO::getSpecCode)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 批量查询规格
|
||||
LambdaQueryWrapper<ProductSpecPO> specWrapper = new LambdaQueryWrapper<>();
|
||||
specWrapper.in(ProductSpecPO::getSpecCode, specCodes)
|
||||
.in(ProductSpecPO::getProductId, productNameToIdMap.values())
|
||||
.eq(ProductSpecPO::getCompanyId, companyId)
|
||||
.isNull(ProductSpecPO::getDeleteTime);
|
||||
|
||||
List<ProductSpecPO> productSpecs = this.list(specWrapper);
|
||||
|
||||
// 按商品分组规格
|
||||
var productSpecsMap = productSpecs.stream()
|
||||
.collect(Collectors.groupingBy(ProductSpecPO::getProductId));
|
||||
|
||||
// 构建结果:包含规格信息的商品VO列表
|
||||
return products.stream()
|
||||
.filter(product -> {
|
||||
// 检查该商品是否有匹配的规格
|
||||
List<ProductSpecPO> specs = productSpecsMap.get(product.getId());
|
||||
if (specs == null || specs.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否有规格在查询条件中
|
||||
return specs.stream()
|
||||
.anyMatch(spec -> queries.stream()
|
||||
.anyMatch(query ->
|
||||
query.getProductName().equals(product.getName()) &&
|
||||
query.getSpecCode().equals(spec.getSpecCode())
|
||||
));
|
||||
})
|
||||
.map(product -> {
|
||||
// 转换为商品VO
|
||||
ProductVO productVO = new ProductVO();
|
||||
BeanUtils.copyProperties(product, productVO);
|
||||
|
||||
// 添加匹配的规格信息
|
||||
List<ProductSpecPO> specs = productSpecsMap.get(product.getId());
|
||||
if (specs != null) {
|
||||
List<ProductSpecVO> specVOs = specs.stream()
|
||||
.filter(spec -> queries.stream()
|
||||
.anyMatch(query ->
|
||||
query.getProductName().equals(product.getName()) &&
|
||||
query.getSpecCode().equals(spec.getSpecCode())
|
||||
))
|
||||
.map(this::convertToVO)
|
||||
.collect(Collectors.toList());
|
||||
productVO.setSpecs(specVOs);
|
||||
}
|
||||
|
||||
return productVO;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
voPage.setRecords(voList);
|
||||
|
||||
return voPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductSpecVO> getProductSpecsByProductId(Long productId) {
|
||||
LambdaQueryWrapper<ProductSpecPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProductSpecPO::getProductId, productId)
|
||||
.eq(ProductSpecPO::getDeleteTime, null)
|
||||
.orderByAsc(ProductSpecPO::getId);
|
||||
|
||||
List<ProductSpecPO> poList = productSpecMapper.selectList(wrapper);
|
||||
return poList.stream()
|
||||
.map(po -> {
|
||||
ProductSpecVO vo = new ProductSpecVO();
|
||||
BeanUtils.copyProperties(po, vo);
|
||||
return vo;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
/**
|
||||
* 转换为VO
|
||||
*/
|
||||
private ProductSpecVO convertToVO(ProductSpecPO productSpec) {
|
||||
ProductSpecVO productSpecVO = new ProductSpecVO();
|
||||
BeanUtils.copyProperties(productSpec, productSpecVO);
|
||||
return productSpecVO;
|
||||
}
|
||||
}
|
||||
}
|
||||
+48
@@ -20,6 +20,7 @@ import top.xyquan.ecomdmbbackend.modules.ec.service.ShopService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.service.MediaImageService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
|
||||
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@@ -187,6 +188,53 @@ public class ShopServiceImpl extends ServiceImpl<ShopMapper, ShopPO> implements
|
||||
return PageResultVO.create(voList, pageResult.getTotal(), pageQueryDTO.getPage(), pageQueryDTO.getPageSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaImageVO uploadLogo(MultipartFile file) {
|
||||
// 上传Logo到媒体模块(支持哈希校验和跨公司共享)
|
||||
return mediaImageService.uploadImageWithType(file, "logo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopVO getShopByName(String name) {
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 根据名称精准查询店铺
|
||||
LambdaQueryWrapper<ShopPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ShopPO::getName, name)
|
||||
.eq(ShopPO::getCompanyId, companyId)
|
||||
.isNull(ShopPO::getDeleteTime);
|
||||
|
||||
ShopPO shop = this.getOne(wrapper);
|
||||
if (shop == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return convertToVO(shop);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopVO> getShopsByNames(List<String> names) {
|
||||
if (names == null || names.isEmpty()) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 批量根据名称查询店铺
|
||||
LambdaQueryWrapper<ShopPO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(ShopPO::getName, names)
|
||||
.eq(ShopPO::getCompanyId, companyId)
|
||||
.isNull(ShopPO::getDeleteTime)
|
||||
.orderByAsc(ShopPO::getName);
|
||||
|
||||
List<ShopPO> shops = this.list(wrapper);
|
||||
return shops.stream()
|
||||
.map(this::convertToVO)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为VO
|
||||
*/
|
||||
|
||||
-5
@@ -13,11 +13,6 @@ public class MediaImageFilterDTO {
|
||||
*/
|
||||
private String filename;
|
||||
|
||||
/**
|
||||
* 图片分类
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class MediaImagePO {
|
||||
private String filename;
|
||||
|
||||
/**
|
||||
* 图片分类 (设计图,实物图,细节图,工艺图,其他)
|
||||
* 图片分类 (image,avatar,logo)
|
||||
*/
|
||||
@TableField("type")
|
||||
private String type;
|
||||
|
||||
+10
@@ -53,4 +53,14 @@ public interface MediaImageService {
|
||||
* 分页获取图片列表
|
||||
*/
|
||||
PageResultVO<MediaImageVO> getImagePage(PageQueryDTO<MediaImageFilterDTO> pageQueryDTO);
|
||||
|
||||
/**
|
||||
* 根据文件哈希和类型查询图片信息
|
||||
*/
|
||||
MediaImageVO getImageByHashAndType(String fileHash, String type);
|
||||
|
||||
/**
|
||||
* 上传指定类型的图片
|
||||
*/
|
||||
MediaImageVO uploadImageWithType(MultipartFile file, String type);
|
||||
}
|
||||
|
||||
+60
-4
@@ -48,7 +48,7 @@ public class MediaImageServiceImpl extends ServiceImpl<MediaImageMapper, MediaIm
|
||||
String fileHash = FileHashUtils.calculateFileHash(file);
|
||||
|
||||
// 设置图片类型默认值
|
||||
String type = "其他";
|
||||
String type = "image";
|
||||
|
||||
// 检查当前公司是否已有相同哈希的图片且文件存在
|
||||
List<MediaImagePO> existingImages = baseMapper.selectByFileHashes(List.of(fileHash));
|
||||
@@ -223,6 +223,7 @@ public class MediaImageServiceImpl extends ServiceImpl<MediaImageMapper, MediaIm
|
||||
// 构建查询条件
|
||||
LambdaQueryWrapper<MediaImagePO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MediaImagePO::getCompanyId, companyId)
|
||||
.eq(MediaImagePO::getType, "image") // 固定查询image类型
|
||||
.isNull(MediaImagePO::getDeleteTime);
|
||||
|
||||
// 添加过滤条件
|
||||
@@ -231,9 +232,6 @@ public class MediaImageServiceImpl extends ServiceImpl<MediaImageMapper, MediaIm
|
||||
if (filter.getFilename() != null && !filter.getFilename().trim().isEmpty()) {
|
||||
wrapper.like(MediaImagePO::getFilename, filter.getFilename());
|
||||
}
|
||||
if (filter.getType() != null && !filter.getType().trim().isEmpty()) {
|
||||
wrapper.eq(MediaImagePO::getType, filter.getType());
|
||||
}
|
||||
if (filter.getTags() != null && !filter.getTags().trim().isEmpty()) {
|
||||
wrapper.like(MediaImagePO::getTags, filter.getTags());
|
||||
}
|
||||
@@ -254,6 +252,64 @@ public class MediaImageServiceImpl extends ServiceImpl<MediaImageMapper, MediaIm
|
||||
return PageResultVO.create(voList, pageResult.getTotal(), pageQueryDTO.getPage(), pageQueryDTO.getPageSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaImageVO getImageByHashAndType(String fileHash, String type) {
|
||||
if (fileHash == null || fileHash.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<MediaImagePO> mediaImages = baseMapper.selectByFileHashes(List.of(fileHash));
|
||||
|
||||
// 查找指定类型且文件存在的图片
|
||||
MediaImagePO mediaImage = mediaImages.stream()
|
||||
.filter(img -> type.equals(img.getType()) && FileHashUtils.fileExists(img.getUrl()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
return mediaImage != null ? convertToVO(mediaImage) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaImageVO uploadImageWithType(MultipartFile file, String type) {
|
||||
// 从token中获取公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
|
||||
// 计算文件哈希
|
||||
String fileHash = FileHashUtils.calculateFileHash(file);
|
||||
|
||||
// 检查是否已有相同哈希和类型的图片(支持跨公司共享)
|
||||
MediaImageVO existingImage = getImageByHashAndType(fileHash, type);
|
||||
if (existingImage != null) {
|
||||
// 如果已存在,直接返回现有记录
|
||||
return existingImage;
|
||||
}
|
||||
|
||||
// 上传文件到对应目录
|
||||
String fileUrl;
|
||||
if ("avatar".equals(type)) {
|
||||
fileUrl = FileUploadUtils.uploadAvatar(file);
|
||||
} else if ("logo".equals(type)) {
|
||||
fileUrl = FileUploadUtils.uploadLogo(file);
|
||||
} else {
|
||||
fileUrl = FileUploadUtils.uploadImage(file);
|
||||
}
|
||||
|
||||
// 创建新记录
|
||||
MediaImagePO mediaImage = new MediaImagePO();
|
||||
mediaImage.setCompanyId(companyId);
|
||||
mediaImage.setUrl(fileUrl);
|
||||
mediaImage.setFilename(file.getOriginalFilename());
|
||||
mediaImage.setType(type);
|
||||
mediaImage.setFileHash(fileHash);
|
||||
mediaImage.setUploadBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
// 保存图片记录
|
||||
this.save(mediaImage);
|
||||
|
||||
// 转换为VO并返回
|
||||
return convertToVO(mediaImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为VO
|
||||
*/
|
||||
|
||||
+15
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
|
||||
@@ -14,6 +15,7 @@ import top.xyquan.ecomdmbbackend.modules.org.model.dto.company.CompanyFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.org.model.vo.CompanyVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.org.service.CompanyService;
|
||||
import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
|
||||
import top.xyquan.ecomdmbbackend.utils.FileUploadUtils;
|
||||
|
||||
/**
|
||||
* 公司管理控制器
|
||||
@@ -63,4 +65,17 @@ public class CompanyController {
|
||||
PageResultVO<CompanyVO> pageResult = companyService.getCompanyPage(pageQuery);
|
||||
return ApiResponse.success(pageResult);
|
||||
}
|
||||
|
||||
@Operation(summary = "上传公司Logo", description = "上传公司Logo图片")
|
||||
@PostMapping("/upload-logo")
|
||||
@RequireRole(description = "上传公司Logo", allowCompany = false)
|
||||
public ApiResponse<CompanyVO> uploadLogo(@RequestParam("file") MultipartFile file) {
|
||||
// 检查是否为图片文件
|
||||
if (!FileUploadUtils.isImageFile(file.getOriginalFilename())) {
|
||||
return ApiResponse.fail("只能上传图片文件");
|
||||
}
|
||||
|
||||
CompanyVO companyVO = companyService.uploadLogo(file);
|
||||
return ApiResponse.success(companyVO);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -65,6 +65,6 @@ public class CompanyDTO {
|
||||
/**
|
||||
* 订阅到期时间
|
||||
*/
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31T23:59:59")
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59")
|
||||
private LocalDateTime expireTime;
|
||||
}
|
||||
|
||||
+1
-1
@@ -59,6 +59,6 @@ public class CreateCompanyDTO {
|
||||
/**
|
||||
* 订阅到期时间
|
||||
*/
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31T23:59:59")
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59")
|
||||
private LocalDateTime expireTime;
|
||||
}
|
||||
|
||||
+1
-1
@@ -59,6 +59,6 @@ public class UpdateCompanyDTO {
|
||||
/**
|
||||
* 订阅到期时间
|
||||
*/
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31T23:59:59")
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59")
|
||||
private LocalDateTime expireTime;
|
||||
}
|
||||
|
||||
+4
-4
@@ -27,7 +27,7 @@ public class CompanyVO {
|
||||
/**
|
||||
* 订阅到期时间
|
||||
*/
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31T23:59:59")
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59")
|
||||
private LocalDateTime expiration;
|
||||
|
||||
/**
|
||||
@@ -69,19 +69,19 @@ public class CompanyVO {
|
||||
/**
|
||||
* 订阅到期时间
|
||||
*/
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31T23:59:59")
|
||||
@Schema(description = "订阅到期时间", example = "2024-12-31 23:59:59")
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间", example = "2024-01-01T10:00:00")
|
||||
@Schema(description = "创建时间", example = "2024-01-01 10:00:00")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间", example = "2024-01-01T10:00:00")
|
||||
@Schema(description = "更新时间", example = "2024-01-01 10:00:00")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
|
||||
+9
@@ -1,6 +1,7 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.org.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.org.model.dto.company.CreateCompanyDTO;
|
||||
@@ -44,4 +45,12 @@ public interface CompanyService extends IService<CompanyPO> {
|
||||
* @return 分页结果
|
||||
*/
|
||||
PageResultVO<CompanyVO> getCompanyPage(PageQueryDTO<CompanyFilterDTO> pageQuery);
|
||||
|
||||
/**
|
||||
* 上传公司Logo
|
||||
*
|
||||
* @param file Logo文件
|
||||
* @return 更新后的公司信息
|
||||
*/
|
||||
CompanyVO uploadLogo(MultipartFile file);
|
||||
}
|
||||
|
||||
+31
-3
@@ -20,6 +20,7 @@ import top.xyquan.ecomdmbbackend.modules.org.service.CompanyService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.service.MediaImageService;
|
||||
import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
|
||||
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@@ -95,6 +96,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, CompanyPO> im
|
||||
// 更新公司
|
||||
CompanyPO company = new CompanyPO();
|
||||
BeanUtils.copyProperties(updateCompanyDTO, company);
|
||||
|
||||
// 设置公司ID(必须在updateById之前设置)
|
||||
company.setId(id);
|
||||
|
||||
// 处理logo图片ID
|
||||
if (updateCompanyDTO.getLogoImageId() != null) {
|
||||
@@ -108,11 +112,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, CompanyPO> im
|
||||
// 设置更新人ID
|
||||
company.setUpdateBy(currentUserContext.getCurrentUserId());
|
||||
|
||||
// 保存公司
|
||||
// 更新公司
|
||||
this.updateById(company);
|
||||
|
||||
// 设置公司ID
|
||||
company.setId(id);
|
||||
// 转换为VO并返回
|
||||
return convertToVO(company);
|
||||
}
|
||||
@@ -169,6 +171,32 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, CompanyPO> im
|
||||
return PageResultVO.create(records, pageResult.getTotal(), pageQuery.getPage(), pageQuery.getPageSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompanyVO uploadLogo(MultipartFile file) {
|
||||
// 获取当前用户所属公司ID
|
||||
Long companyId = currentUserContext.getCurrentCompanyId();
|
||||
if (companyId == null) {
|
||||
throw new BusinessException("用户未关联公司");
|
||||
}
|
||||
|
||||
// 查询公司信息
|
||||
CompanyPO company = this.getById(companyId);
|
||||
if (company == null) {
|
||||
throw new BusinessException("公司不存在");
|
||||
}
|
||||
|
||||
// 上传Logo到媒体模块(支持哈希校验和共享)
|
||||
MediaImageVO mediaImageVO = mediaImageService.uploadImageWithType(file, "logo");
|
||||
String logoUrl = mediaImageVO.getUrl();
|
||||
|
||||
// 更新公司Logo信息
|
||||
company.setLogo(logoUrl);
|
||||
this.updateById(company);
|
||||
|
||||
// 转换为VO并返回
|
||||
return convertToVO(company);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为VO
|
||||
*/
|
||||
|
||||
+14
@@ -4,11 +4,13 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.model.dto.user.ChangePasswordDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.model.dto.user.UpdateUserInfoDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.model.vo.UserVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.service.UserService;
|
||||
import top.xyquan.ecomdmbbackend.utils.FileUploadUtils;
|
||||
|
||||
/**
|
||||
* 用户管理控制器
|
||||
@@ -44,4 +46,16 @@ public class UserController {
|
||||
userService.changePassword(changePasswordDTO);
|
||||
return ApiResponse.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "上传用户头像", description = "上传用户头像图片")
|
||||
@PostMapping("/upload-avatar")
|
||||
public ApiResponse<UserVO> uploadAvatar(@RequestParam("file") MultipartFile file) {
|
||||
// 检查是否为图片文件
|
||||
if (!FileUploadUtils.isImageFile(file.getOriginalFilename())) {
|
||||
return ApiResponse.fail("只能上传图片文件");
|
||||
}
|
||||
|
||||
UserVO userVO = userService.uploadAvatar(file);
|
||||
return ApiResponse.success(userVO);
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -1,6 +1,7 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.sys.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.model.dto.user.ChangePasswordDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.model.dto.user.LoginDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.sys.model.dto.user.RegisterDTO;
|
||||
@@ -59,4 +60,12 @@ public interface UserService extends IService<UserPO> {
|
||||
* @param changePasswordDTO 密码信息
|
||||
*/
|
||||
void changePassword(ChangePasswordDTO changePasswordDTO);
|
||||
|
||||
/**
|
||||
* 上传用户头像
|
||||
*
|
||||
* @param file 头像文件
|
||||
* @return 更新后的用户信息
|
||||
*/
|
||||
UserVO uploadAvatar(MultipartFile file);
|
||||
}
|
||||
|
||||
+29
@@ -21,6 +21,7 @@ import top.xyquan.ecomdmbbackend.modules.media.model.vo.MediaImageVO;
|
||||
import top.xyquan.ecomdmbbackend.utils.JwtUtils;
|
||||
import top.xyquan.ecomdmbbackend.utils.SecurityUtils;
|
||||
import top.xyquan.ecomdmbbackend.utils.TokenPayload;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -220,6 +221,34 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserPO> implements
|
||||
this.updateById(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserVO uploadAvatar(MultipartFile file) {
|
||||
// 从Security上下文获取用户ID
|
||||
Long userId = SecurityUtils.getCurrentUserId();
|
||||
if (userId == null) {
|
||||
throw new BusinessException("用户未登录");
|
||||
}
|
||||
|
||||
// 查询用户信息
|
||||
UserPO user = this.getById(userId);
|
||||
if (user == null) {
|
||||
throw new BusinessException("用户不存在");
|
||||
}
|
||||
|
||||
// 上传头像到媒体模块(支持哈希校验和共享)
|
||||
MediaImageVO mediaImageVO = mediaImageService.uploadImageWithType(file, "avatar");
|
||||
String avatarUrl = mediaImageVO.getUrl();
|
||||
|
||||
// 更新用户头像信息
|
||||
user.setAvatar(avatarUrl);
|
||||
this.updateById(user);
|
||||
|
||||
// 转换为VO并返回
|
||||
UserVO userVO = new UserVO();
|
||||
BeanUtils.copyProperties(user, userVO);
|
||||
return userVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成登录响应
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ CREATE TABLE `media_image` (
|
||||
`company_id` bigint unsigned NOT NULL,
|
||||
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '图片URL',
|
||||
`filename` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '原始文件名',
|
||||
`type` enum('设计图','实物图','细节图','工艺图','其他') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '其他' COMMENT '图片分类',
|
||||
`type` enum('image','avatar','logo') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'image' COMMENT '图片分类',
|
||||
`file_hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '文件哈希值,用于去重',
|
||||
`tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '标签,逗号分隔如 spring,工艺图,客户A',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图片说明',
|
||||
|
||||
@@ -25,6 +25,12 @@ public class FileUploadUtils {
|
||||
// 文件目录
|
||||
private static final String FILE_DIR = "files";
|
||||
|
||||
// 头像目录
|
||||
private static final String AVATAR_DIR = "avatar";
|
||||
|
||||
// Logo目录
|
||||
private static final String LOGO_DIR = "logo";
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
*/
|
||||
@@ -39,6 +45,20 @@ public class FileUploadUtils {
|
||||
return uploadFile(file, FILE_DIR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传头像
|
||||
*/
|
||||
public static String uploadAvatar(MultipartFile file) {
|
||||
return uploadFile(file, AVATAR_DIR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传Logo
|
||||
*/
|
||||
public static String uploadLogo(MultipartFile file) {
|
||||
return uploadFile(file, LOGO_DIR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件到指定目录
|
||||
*/
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 297 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 297 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 297 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 297 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 297 KiB |
@@ -1,7 +1,7 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { ShopDTO, ShopVO, ProductDTO, ProductVO } from './types';
|
||||
import type { ShopDTO, ShopVO, ProductDTO, ProductVO, OrderDTO, OrderVO, BatchImportResultVO } from './types';
|
||||
|
||||
/**
|
||||
* 店铺管理API
|
||||
@@ -35,6 +35,19 @@ export async function deleteShopApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/shop/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传店铺Logo
|
||||
*/
|
||||
export async function uploadShopLogoApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<ShopVO.ShopInfoVO>('/ec/shop/upload-logo', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品管理API
|
||||
*/
|
||||
@@ -66,3 +79,134 @@ export async function updateProductApi(id: number, data: ProductDTO.UpdateProduc
|
||||
export async function deleteProductApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/product/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 一键创建商品和规格
|
||||
*/
|
||||
export async function createProductWithSpecsApi(data: ProductDTO.CreateProductWithSpecsDTO) {
|
||||
return requestClient.post<ProductVO.ProductInfoVO>('/ec/product/create-with-specs', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取商品规格列表
|
||||
*/
|
||||
export async function getProductSpecPageApi(params: PageQueryDTO<ProductDTO.ProductSpecFilterDTO>) {
|
||||
return requestClient.post<PageResultVO<ProductVO.ProductSpecInfoVO>>('/ec/product-spec/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品规格
|
||||
*/
|
||||
export async function createProductSpecApi(data: ProductDTO.CreateProductSpecDTO) {
|
||||
return requestClient.post<ProductVO.ProductSpecInfoVO>('/ec/product-spec/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新商品规格
|
||||
*/
|
||||
export async function updateProductSpecApi(id: number, data: ProductDTO.UpdateProductSpecDTO) {
|
||||
return requestClient.put<ProductVO.ProductSpecInfoVO>(`/ec/product-spec/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格
|
||||
*/
|
||||
export async function deleteProductSpecApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/product-spec/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取订单列表
|
||||
*/
|
||||
export async function getOrderPageApi(params: PageQueryDTO<OrderDTO.OrderFilterDTO>) {
|
||||
return requestClient.post<PageResultVO<OrderVO.OrderInfoVO>>('/ec/order/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
*/
|
||||
export async function createOrderApi(data: OrderDTO.CreateOrderDTO) {
|
||||
return requestClient.post<OrderVO.OrderInfoVO>('/ec/order/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新订单
|
||||
*/
|
||||
export async function updateOrderApi(id: number, data: OrderDTO.UpdateOrderDTO) {
|
||||
return requestClient.put<OrderVO.OrderInfoVO>(`/ec/order/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function deleteOrderApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/order/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单详情
|
||||
*/
|
||||
export async function getOrderByIdApi(id: number) {
|
||||
return requestClient.get<OrderVO.OrderInfoVO>(`/ec/order/detail/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入订单
|
||||
*/
|
||||
export async function batchImportOrdersApi(data: OrderDTO.BatchImportOrderDTO) {
|
||||
return requestClient.post<BatchImportResultVO.BatchImportResultInfoVO>('/ec/order/batch-import', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 精准查询API - 用于数据导入
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据名称精准查询店铺
|
||||
*/
|
||||
export async function getShopByNameApi(name: string) {
|
||||
return requestClient.get<ShopVO.ShopInfoVO>(`/ec/shop/find-by-name/${encodeURIComponent(name)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据名称查询店铺
|
||||
*/
|
||||
export async function getShopsByNamesApi(names: string[]) {
|
||||
return requestClient.post<ShopVO.ShopInfoVO[]>('/ec/shop/find-by-names', names);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名称精准查询商品
|
||||
*/
|
||||
export async function getProductByNameApi(name: string) {
|
||||
return requestClient.get<ProductVO.ProductInfoVO>(`/ec/product/find-by-name/${encodeURIComponent(name)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据名称查询商品
|
||||
*/
|
||||
export async function getProductsByNamesApi(names: string[]) {
|
||||
return requestClient.post<ProductVO.ProductInfoVO[]>('/ec/product/find-by-names', names);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品名称和规格编码精准查询商品规格
|
||||
*/
|
||||
export async function getProductSpecByProductAndSpecApi(productName: string, specCode: string) {
|
||||
return requestClient.get<ProductVO.ProductSpecInfoVO>(`/ec/product-spec/find-by-product-and-spec/${encodeURIComponent(productName)}/${encodeURIComponent(specCode)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量根据商品名称和规格编码查询商品规格
|
||||
*/
|
||||
export async function getProductSpecsByProductAndSpecsApi(queries: { productName: string; specCode: string }[]) {
|
||||
return requestClient.post<ProductVO.ProductInfoVO[]>('/ec/product-spec/find-by-product-and-specs', queries);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ export namespace ShopDTO {
|
||||
export interface CreateShopDTO {
|
||||
/** 店铺名称 */
|
||||
name: string;
|
||||
/** logo URL */
|
||||
logo?: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
}
|
||||
@@ -17,8 +17,8 @@ export namespace ShopDTO {
|
||||
export interface UpdateShopDTO {
|
||||
/** 店铺名称 */
|
||||
name: string;
|
||||
/** logo URL */
|
||||
logo?: string;
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 平台(如淘宝、京东、拼多多) */
|
||||
platform?: string;
|
||||
}
|
||||
@@ -37,14 +37,8 @@ export namespace ProductDTO {
|
||||
export interface CreateProductDTO {
|
||||
/** 商品名称 */
|
||||
name: string;
|
||||
/** 商品编码 */
|
||||
specCode?: string;
|
||||
/** 商品SKU */
|
||||
skuCode?: string;
|
||||
/** 主图URL */
|
||||
mainImage?: string;
|
||||
/** 成本价 */
|
||||
costPrice: number;
|
||||
/** 主图图片ID */
|
||||
mainImageId?: number;
|
||||
}
|
||||
|
||||
/** 更新商品参数 */
|
||||
@@ -55,8 +49,50 @@ export namespace ProductDTO {
|
||||
specCode?: string;
|
||||
/** 商品SKU */
|
||||
skuCode?: string;
|
||||
/** 主图URL */
|
||||
mainImage?: string;
|
||||
/** 主图图片ID */
|
||||
mainImageId?: number;
|
||||
/** 成本价 */
|
||||
costPrice: number;
|
||||
}
|
||||
|
||||
/** 一键创建商品和规格参数 */
|
||||
export interface CreateProductWithSpecsDTO {
|
||||
/** 商品名称 */
|
||||
name: string;
|
||||
/** 主图图片ID */
|
||||
mainImageId?: number;
|
||||
/** 商品规格列表 */
|
||||
specs: ProductSpecDTO[];
|
||||
}
|
||||
|
||||
/** 商品规格DTO */
|
||||
export interface ProductSpecDTO {
|
||||
/** 规格名称 */
|
||||
name: string;
|
||||
/** 规格编码 */
|
||||
specCode?: string;
|
||||
/** 成本价 */
|
||||
costPrice: number;
|
||||
}
|
||||
|
||||
/** 创建商品规格参数 */
|
||||
export interface CreateProductSpecDTO {
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 规格名称 */
|
||||
name: string;
|
||||
/** 规格编码 */
|
||||
specCode?: string;
|
||||
/** 成本价 */
|
||||
costPrice: number;
|
||||
}
|
||||
|
||||
/** 更新商品规格参数 */
|
||||
export interface UpdateProductSpecDTO {
|
||||
/** 规格名称 */
|
||||
name: string;
|
||||
/** 规格编码 */
|
||||
specCode?: string;
|
||||
/** 成本价 */
|
||||
costPrice: number;
|
||||
}
|
||||
@@ -74,4 +110,84 @@ export namespace ProductDTO {
|
||||
/** 成本价范围-最大值 */
|
||||
maxCostPrice?: number;
|
||||
}
|
||||
|
||||
/** 商品规格过滤条件 */
|
||||
export interface ProductSpecFilterDTO {
|
||||
/** 商品ID */
|
||||
productId?: number;
|
||||
/** 商品名称(模糊查询) */
|
||||
productName?: string;
|
||||
/** 规格名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 规格编码(模糊查询) */
|
||||
specCode?: string;
|
||||
/** 成本价范围-最小值 */
|
||||
minCostPrice?: number;
|
||||
/** 成本价范围-最大值 */
|
||||
maxCostPrice?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace OrderDTO {
|
||||
/** 创建订单参数 */
|
||||
export interface CreateOrderDTO {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 平台订单号 */
|
||||
platformOrderNo?: string;
|
||||
/** 订单状态ID */
|
||||
statusId: number;
|
||||
/** 商家实收金额 */
|
||||
receivedAmount: number;
|
||||
/** 运费 */
|
||||
shippingFee?: number;
|
||||
/** 下单时间 */
|
||||
orderDate: string;
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId: number;
|
||||
/** 数量 */
|
||||
quantity: number;
|
||||
}
|
||||
|
||||
/** 更新订单参数 */
|
||||
export interface UpdateOrderDTO {
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId: number;
|
||||
/** 订单状态ID */
|
||||
orderStatusId: number;
|
||||
/** 商品数量 */
|
||||
quantity: number;
|
||||
/** 订单编号 */
|
||||
orderNumber: string;
|
||||
/** 商品名称 */
|
||||
productName: string;
|
||||
/** 商品规格名称 */
|
||||
productSpecName: string;
|
||||
/** 店铺实际收入 */
|
||||
shopActualAmount: number;
|
||||
}
|
||||
|
||||
/** 订单过滤条件 */
|
||||
export interface OrderFilterDTO {
|
||||
/** 店铺ID */
|
||||
shopId?: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId?: number;
|
||||
/** 订单状态ID */
|
||||
orderStatusId?: number;
|
||||
/** 订单编号(模糊查询) */
|
||||
orderNumber?: string;
|
||||
/** 商品名称(模糊查询) */
|
||||
productName?: string;
|
||||
}
|
||||
|
||||
/** 批量导入订单参数 */
|
||||
export interface BatchImportOrderDTO {
|
||||
/** 订单列表 */
|
||||
orders: CreateOrderDTO[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,12 +35,34 @@ export namespace ProductVO {
|
||||
companyId: number;
|
||||
/** 商品名称 */
|
||||
name: string;
|
||||
/** 商品编码 */
|
||||
specCode?: string;
|
||||
/** 商品SKU */
|
||||
skuCode?: string;
|
||||
/** 主图URL */
|
||||
mainImage?: string;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
/** 商品规格列表 */
|
||||
specs?: ProductSpecInfoVO[];
|
||||
}
|
||||
|
||||
/** 商品规格信息 */
|
||||
export interface ProductSpecInfoVO {
|
||||
/** 规格ID */
|
||||
id: number;
|
||||
/** 公司ID */
|
||||
companyId: number;
|
||||
/** 商品ID */
|
||||
productId: number;
|
||||
/** 商品名称 */
|
||||
productName: string;
|
||||
/** 规格名称 */
|
||||
name: string;
|
||||
/** 规格编码 */
|
||||
specCode?: string;
|
||||
/** 成本价 */
|
||||
costPrice: number;
|
||||
/** 创建时间 */
|
||||
@@ -53,3 +75,49 @@ export namespace ProductVO {
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace OrderVO {
|
||||
/** 订单信息 */
|
||||
export interface OrderInfoVO {
|
||||
/** 订单ID */
|
||||
id: number;
|
||||
/** 店铺ID */
|
||||
shopId: number;
|
||||
/** 商品规格ID */
|
||||
productSpecId: number;
|
||||
/** 订单状态ID */
|
||||
orderStatusId: number;
|
||||
/** 商品数量 */
|
||||
quantity: number;
|
||||
/** 订单编号 */
|
||||
orderNumber: string;
|
||||
/** 商品名称 */
|
||||
productName: string;
|
||||
/** 商品规格名称 */
|
||||
productSpecName: string;
|
||||
/** 店铺实际收入 */
|
||||
shopActualAmount: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 创建人ID */
|
||||
createBy?: number;
|
||||
/** 更新人ID */
|
||||
updateBy?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace BatchImportResultVO {
|
||||
/** 批量导入结果 */
|
||||
export interface BatchImportResultInfoVO {
|
||||
/** 总数量 */
|
||||
totalCount: number;
|
||||
/** 成功数量 */
|
||||
successCount: number;
|
||||
/** 失败数量 */
|
||||
failureCount: number;
|
||||
/** 失败详情 */
|
||||
failureDetails: string[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,19 @@ export async function deleteCompanyApi(id: number) {
|
||||
return requestClient.delete<void>(`/company/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传公司Logo
|
||||
*/
|
||||
export async function uploadCompanyLogoApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<CompanyVO.CompanyInfoVO>('/company/upload-logo', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门管理API
|
||||
*/
|
||||
|
||||
@@ -15,9 +15,9 @@ export namespace CompanyDTO {
|
||||
contactPhone?: string;
|
||||
/** 邮箱 */
|
||||
email?: string;
|
||||
/** Logo */
|
||||
logo?: string;
|
||||
/** 状态 */
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 状态 (0-禁用 1-正常) */
|
||||
status?: number;
|
||||
/** 订阅到期时间 */
|
||||
expireTime?: string;
|
||||
@@ -35,9 +35,9 @@ export namespace CompanyDTO {
|
||||
contactPhone?: string;
|
||||
/** 邮箱 */
|
||||
email?: string;
|
||||
/** Logo */
|
||||
logo?: string;
|
||||
/** 状态 */
|
||||
/** logo图片ID */
|
||||
logoImageId?: number;
|
||||
/** 状态 (0-禁用 1-正常) */
|
||||
status?: number;
|
||||
/** 订阅到期时间 */
|
||||
expireTime?: string;
|
||||
@@ -47,8 +47,16 @@ export namespace CompanyDTO {
|
||||
export interface CompanyFiltersDTO {
|
||||
/** 公司名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 联系人(模糊查询) */
|
||||
contactPerson?: string;
|
||||
/** 联系电话(精确查询) */
|
||||
contactPhone?: string;
|
||||
/** 邮箱(精确查询) */
|
||||
email?: string;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
/** 过期状态查询 */
|
||||
expired?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,8 +89,8 @@ export namespace DepartmentDTO {
|
||||
export interface DepartmentFiltersDTO {
|
||||
/** 部门名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 公司ID */
|
||||
companyId?: number;
|
||||
/** 父级部门ID */
|
||||
parentId?: number;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
}
|
||||
@@ -121,10 +129,6 @@ export namespace PositionDTO {
|
||||
export interface PositionFiltersDTO {
|
||||
/** 岗位名称(模糊查询) */
|
||||
name?: string;
|
||||
/** 公司ID */
|
||||
companyId?: number;
|
||||
/** 部门ID */
|
||||
departmentId?: number;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ export namespace CompanyVO {
|
||||
id: number;
|
||||
/** 公司名称 */
|
||||
name: string;
|
||||
/** 过期时间 */
|
||||
/** 订阅到期时间 */
|
||||
expiration?: string;
|
||||
/** 公司地址 */
|
||||
address?: string;
|
||||
@@ -19,9 +19,9 @@ export namespace CompanyVO {
|
||||
contactPhone?: string;
|
||||
/** 邮箱 */
|
||||
email?: string;
|
||||
/** Logo */
|
||||
/** logo */
|
||||
logo?: string;
|
||||
/** 状态 */
|
||||
/** 状态 (0-禁用 1-正常) */
|
||||
status: number;
|
||||
/** 订阅到期时间 */
|
||||
expireTime?: string;
|
||||
|
||||
+350
@@ -0,0 +1,350 @@
|
||||
<template>
|
||||
<Modal
|
||||
:open="visible"
|
||||
:title="modalTitle"
|
||||
width="600px"
|
||||
:confirm-loading="loading"
|
||||
@ok="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="公司Logo" name="logoImageId">
|
||||
<div style="display: flex; align-items: center; gap: 16px;">
|
||||
|
||||
<!-- Logo预览区域 -->
|
||||
<div style="position: relative; display: inline-block;">
|
||||
<!-- 有图片时显示图片 -->
|
||||
<img
|
||||
v-if="currentLogoUrl && !imageLoadError"
|
||||
:src="currentLogoUrl"
|
||||
alt="公司Logo"
|
||||
style="width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid #d9d9d9; background-color: #f5f5f5;"
|
||||
@error="handleImageError"
|
||||
/>
|
||||
<!-- 无图片或加载失败时显示空状态 -->
|
||||
<div
|
||||
v-else
|
||||
style="width: 80px; height: 80px; border: 1px dashed #d9d9d9; border-radius: 8px; background-color: #fafafa; display: flex; align-items: center; justify-content: center; color: #999; font-size: 12px; text-align: center; line-height: 1.2;">
|
||||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
<CameraIcon style="font-size: 16px; margin-bottom: 4px;" />
|
||||
<div>上传Logo</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 点击更换遮罩 -->
|
||||
<div
|
||||
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); border-radius: 8px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; cursor: pointer;"
|
||||
@mouseenter="($event.target as HTMLElement).style.opacity = '1'"
|
||||
@mouseleave="($event.target as HTMLElement).style.opacity = '0'"
|
||||
@click="selectLogoFile">
|
||||
<div style="color: white; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
<CameraIcon style="font-size: 16px; margin-bottom: 4px;" />
|
||||
<div style="font-size: 12px;">{{ currentLogoUrl && !imageLoadError ? '更换Logo' : '上传Logo' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 重置按钮 -->
|
||||
<div v-if="newLogoFile">
|
||||
<Button size="small" @click="removeNewLogo">重置</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="公司名称" name="name" :rules="[{ required: true, message: '请输入公司名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入公司名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="公司地址" name="address">
|
||||
<Input v-model:value="formData.address" placeholder="请输入公司地址" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="联系人" name="contactPerson">
|
||||
<Input v-model:value="formData.contactPerson" placeholder="请输入联系人" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="联系电话" name="contactPhone" :rules="[{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码' }]">
|
||||
<Input v-model:value="formData.contactPhone" placeholder="请输入联系电话" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="邮箱" name="email" :rules="[{ type: 'email', message: '请输入正确的邮箱地址' }]">
|
||||
<Input v-model:value="formData.email" placeholder="请输入邮箱" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="状态" name="status" :rules="[{ required: true, message: '请选择状态' }]">
|
||||
<Select
|
||||
v-model:value="formData.status"
|
||||
placeholder="请选择状态"
|
||||
:options="statusOptions"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="订阅到期时间" name="expireTime">
|
||||
<DatePicker
|
||||
v-model:value="formData.expireTime"
|
||||
placeholder="请选择订阅到期时间"
|
||||
style="width: 100%;"
|
||||
show-time
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, onUnmounted } from 'vue';
|
||||
import { Form, Input, Modal, Select, DatePicker, Button, message } from 'ant-design-vue';
|
||||
import { createIconifyIcon } from '@vben/icons';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
uploadCompanyLogoApi,
|
||||
createCompanyApi,
|
||||
updateCompanyApi,
|
||||
type CompanyVO,
|
||||
type CompanyDTO
|
||||
} from '#/api/org';
|
||||
|
||||
interface Emits {
|
||||
(e: 'success'): void;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 创建相机图标组件
|
||||
const CameraIcon = createIconifyIcon('mdi:camera');
|
||||
|
||||
// 内部状态管理
|
||||
const visible = ref(false);
|
||||
const isEdit = ref(false);
|
||||
const currentCompanyData = ref<CompanyVO.CompanyInfoVO | null>(null);
|
||||
|
||||
// 响应式数据
|
||||
const formRef = ref();
|
||||
const loading = ref(false);
|
||||
const newLogoFile = ref<File | null>(null); // 新选择的logo文件
|
||||
const originalLogoUrl = ref(''); // 原始logo URL
|
||||
const imageLoadError = ref(false); // 图片加载错误状态
|
||||
|
||||
// 表单数据
|
||||
const formData = ref({
|
||||
name: '',
|
||||
address: '',
|
||||
contactPerson: '',
|
||||
contactPhone: '',
|
||||
email: '',
|
||||
logoImageId: undefined as number | undefined,
|
||||
status: 1,
|
||||
expireTime: undefined as any,
|
||||
});
|
||||
|
||||
// 状态选项
|
||||
const statusOptions = [
|
||||
{ label: '正常', value: 1 },
|
||||
{ label: '禁用', value: 0 },
|
||||
];
|
||||
|
||||
// 模态框标题
|
||||
const modalTitle = computed(() => isEdit.value ? '编辑公司' : '添加公司');
|
||||
|
||||
// 当前显示的logo URL(优先显示新选择的)
|
||||
const currentLogoUrl = computed(() => {
|
||||
if (newLogoFile.value) {
|
||||
return URL.createObjectURL(newLogoFile.value);
|
||||
}
|
||||
return originalLogoUrl.value;
|
||||
});
|
||||
|
||||
// 初始化表单数据
|
||||
function initFormData() {
|
||||
if (isEdit.value && currentCompanyData.value) {
|
||||
// 编辑模式
|
||||
formData.value = {
|
||||
name: currentCompanyData.value.name,
|
||||
address: currentCompanyData.value.address || '',
|
||||
contactPerson: currentCompanyData.value.contactPerson || '',
|
||||
contactPhone: currentCompanyData.value.contactPhone || '',
|
||||
email: currentCompanyData.value.email || '',
|
||||
logoImageId: undefined,
|
||||
status: currentCompanyData.value.status,
|
||||
expireTime: currentCompanyData.value.expireTime ? dayjs(currentCompanyData.value.expireTime) : undefined,
|
||||
};
|
||||
|
||||
// 设置原始Logo URL
|
||||
originalLogoUrl.value = currentCompanyData.value.logo || '';
|
||||
} else {
|
||||
// 创建模式
|
||||
formData.value = {
|
||||
name: '',
|
||||
address: '',
|
||||
contactPerson: '',
|
||||
contactPhone: '',
|
||||
email: '',
|
||||
logoImageId: undefined,
|
||||
status: 1,
|
||||
expireTime: undefined,
|
||||
};
|
||||
originalLogoUrl.value = '';
|
||||
}
|
||||
|
||||
// 重置新选择的logo和图片加载状态
|
||||
newLogoFile.value = null;
|
||||
imageLoadError.value = false;
|
||||
}
|
||||
|
||||
// 重置表单(在open方法中调用)
|
||||
function resetForm() {
|
||||
formRef.value?.resetFields();
|
||||
newLogoFile.value = null;
|
||||
originalLogoUrl.value = '';
|
||||
imageLoadError.value = false;
|
||||
}
|
||||
|
||||
// 处理提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
loading.value = true;
|
||||
|
||||
// 准备提交数据
|
||||
const submitData = { ...formData.value };
|
||||
|
||||
// 处理日期格式
|
||||
if (submitData.expireTime) {
|
||||
submitData.expireTime = submitData.expireTime.format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
// 如果有新选择的logo,先上传获取ID
|
||||
if (newLogoFile.value) {
|
||||
const logoImageId = await uploadLogoAndGetId();
|
||||
if (logoImageId) {
|
||||
submitData.logoImageId = logoImageId;
|
||||
}
|
||||
} else if (!isEdit.value) {
|
||||
// 创建模式且没有选择Logo,移除logoImageId字段
|
||||
delete submitData.logoImageId;
|
||||
}
|
||||
|
||||
// 调用API
|
||||
if (isEdit.value && currentCompanyData.value) {
|
||||
await updateCompanyApi(currentCompanyData.value.id, submitData as CompanyDTO.UpdateCompanyDTO);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createCompanyApi(submitData as CompanyDTO.CreateCompanyDTO);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
visible.value = false;
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('保存公司失败:', error);
|
||||
message.error('保存公司失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理取消
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 暴露给父组件的方法
|
||||
function open(editMode: boolean = false, companyData?: CompanyVO.CompanyInfoVO | null) {
|
||||
isEdit.value = editMode;
|
||||
currentCompanyData.value = companyData || null;
|
||||
|
||||
resetForm(); // 先重置表单
|
||||
initFormData(); // 再初始化数据
|
||||
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
|
||||
// 选择logo文件
|
||||
function selectLogoFile() {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = 'image/*';
|
||||
input.style.display = 'none';
|
||||
document.body.appendChild(input);
|
||||
|
||||
input.onchange = (e) => {
|
||||
const file = (e.target as HTMLInputElement).files?.[0];
|
||||
if (file) {
|
||||
// 验证文件
|
||||
const isImage = file.type.startsWith('image/');
|
||||
if (!isImage) {
|
||||
message.error('只能上传图片文件');
|
||||
document.body.removeChild(input);
|
||||
return;
|
||||
}
|
||||
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
message.error('图片大小不能超过 2MB');
|
||||
document.body.removeChild(input);
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置新选择的文件
|
||||
newLogoFile.value = file;
|
||||
imageLoadError.value = false; // 重置图片加载错误状态
|
||||
message.success('Logo选择成功');
|
||||
}
|
||||
|
||||
document.body.removeChild(input);
|
||||
};
|
||||
|
||||
input.click();
|
||||
}
|
||||
|
||||
// 重置新选择的logo
|
||||
function removeNewLogo() {
|
||||
newLogoFile.value = null;
|
||||
imageLoadError.value = false; // 重置图片加载错误状态
|
||||
message.success('已重置logo');
|
||||
}
|
||||
|
||||
// 上传Logo并获取图片ID
|
||||
async function uploadLogoAndGetId(): Promise<number | undefined> {
|
||||
if (!newLogoFile.value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await uploadCompanyLogoApi(newLogoFile.value);
|
||||
console.log('Logo上传成功:', response);
|
||||
return response.id;
|
||||
} catch (error) {
|
||||
console.error('Logo上传失败:', error);
|
||||
message.error('Logo上传失败');
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// 图片加载错误处理
|
||||
function handleImageError(event: Event) {
|
||||
console.error('图片加载失败:', event);
|
||||
imageLoadError.value = true;
|
||||
message.error('图片加载失败,请重新选择');
|
||||
}
|
||||
|
||||
|
||||
// 组件卸载时清理
|
||||
onUnmounted(() => {
|
||||
if (newLogoFile.value) {
|
||||
const url = URL.createObjectURL(newLogoFile.value);
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
+89
-146
@@ -1,19 +1,17 @@
|
||||
<script lang="ts" setup>
|
||||
import { h, ref, onUnmounted } from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { h, ref } from 'vue';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { Button, DatePicker, Form, Input, Modal, Select, Table, message } from 'ant-design-vue';
|
||||
import { Button, Input, Select, Table, message, Tag } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
createCompanyApi,
|
||||
deleteCompanyApi,
|
||||
getCompanyPageApi,
|
||||
updateCompanyApi,
|
||||
getCompanyPageApi,
|
||||
type CompanyVO,
|
||||
type CompanyDTO
|
||||
} from '#/api/org';
|
||||
import type { PageQueryDTO } from '#/types/common';
|
||||
import CompanyFormModal from './components/CompanyFormModal.vue';
|
||||
|
||||
defineOptions({ name: 'CompanyManagement' });
|
||||
|
||||
@@ -23,30 +21,20 @@ const companyList = ref<CompanyVO.CompanyInfoVO[]>([]);
|
||||
const total = ref(0);
|
||||
const current = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const modalVisible = ref(false);
|
||||
const modalTitle = ref('');
|
||||
const isEdit = ref(false);
|
||||
const currentCompanyId = ref<number | null>(null);
|
||||
const formRef = ref();
|
||||
const companyFormModalRef = ref();
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = ref({
|
||||
name: '',
|
||||
status: undefined as number | undefined,
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = ref({
|
||||
name: '',
|
||||
address: '',
|
||||
contactPerson: '',
|
||||
contactPhone: '',
|
||||
email: '',
|
||||
logo: '',
|
||||
status: 1,
|
||||
expireTime: null as any,
|
||||
status: undefined as number | undefined,
|
||||
expired: undefined as string | undefined,
|
||||
});
|
||||
|
||||
// 表单数据(已移至CompanyFormModal组件)
|
||||
|
||||
// 状态选项
|
||||
const statusOptions = [
|
||||
{ label: '禁用', value: 0 },
|
||||
@@ -107,9 +95,26 @@ const columns = [
|
||||
key: 'status',
|
||||
width: 100,
|
||||
customRender: ({ record }: { record: CompanyVO.CompanyInfoVO }) => {
|
||||
return h('span', {
|
||||
style: { color: record.status === 1 ? '#52c41a' : '#ff4d4f' },
|
||||
}, record.status === 1 ? '正常' : '禁用');
|
||||
const statusMap = {
|
||||
0: { text: '禁用', color: 'red' },
|
||||
1: { text: '正常', color: 'green' },
|
||||
};
|
||||
const status = statusMap[record.status as keyof typeof statusMap] || { text: '未知', color: 'default' };
|
||||
return h(Tag, { color: status.color }, () => status.text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '过期状态',
|
||||
dataIndex: 'expired',
|
||||
key: 'expired',
|
||||
width: 100,
|
||||
customRender: ({ record }: { record: CompanyVO.CompanyInfoVO }) => {
|
||||
if (record.expired === true) {
|
||||
return h(Tag, { color: 'red' }, () => '已过期');
|
||||
} else if (record.expired === false) {
|
||||
return h(Tag, { color: 'green' }, () => '正常');
|
||||
}
|
||||
return h('span', { style: { color: '#999' } }, '未知');
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -165,7 +170,11 @@ function handleSearch() {
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: '',
|
||||
contactPerson: '',
|
||||
contactPhone: '',
|
||||
email: '',
|
||||
status: undefined,
|
||||
expired: undefined,
|
||||
};
|
||||
current.value = 1;
|
||||
fetchCompanyList();
|
||||
@@ -180,38 +189,12 @@ function handleTableChange(pagination: any) {
|
||||
|
||||
// 处理添加公司
|
||||
function handleAdd() {
|
||||
modalTitle.value = '添加公司';
|
||||
isEdit.value = false;
|
||||
currentCompanyId.value = null;
|
||||
formData.value = {
|
||||
name: '',
|
||||
address: '',
|
||||
contactPerson: '',
|
||||
contactPhone: '',
|
||||
email: '',
|
||||
logo: '',
|
||||
status: 1,
|
||||
expireTime: null,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
companyFormModalRef.value?.open(false);
|
||||
}
|
||||
|
||||
// 处理编辑公司
|
||||
function handleEdit(record: CompanyVO.CompanyInfoVO) {
|
||||
modalTitle.value = '编辑公司';
|
||||
isEdit.value = true;
|
||||
currentCompanyId.value = record.id;
|
||||
formData.value = {
|
||||
name: record.name,
|
||||
address: record.address || '',
|
||||
contactPerson: record.contactPerson || '',
|
||||
contactPhone: record.contactPhone || '',
|
||||
email: record.email || '',
|
||||
logo: record.logo || '',
|
||||
status: record.status,
|
||||
expireTime: record.expireTime ? dayjs(record.expireTime) : null,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
companyFormModalRef.value?.open(true, record);
|
||||
}
|
||||
|
||||
|
||||
@@ -219,11 +202,6 @@ function handleEdit(record: CompanyVO.CompanyInfoVO) {
|
||||
// 组件卸载标志
|
||||
let isUnmounted = false;
|
||||
|
||||
// 组件卸载时设置标志
|
||||
onUnmounted(() => {
|
||||
isUnmounted = true;
|
||||
});
|
||||
|
||||
// 获取公司列表
|
||||
async function fetchCompanyList() {
|
||||
if (isUnmounted) return;
|
||||
@@ -235,7 +213,11 @@ async function fetchCompanyList() {
|
||||
pageSize: pageSize.value,
|
||||
filters: {
|
||||
name: searchForm.value.name || undefined,
|
||||
contactPerson: searchForm.value.contactPerson || undefined,
|
||||
contactPhone: searchForm.value.contactPhone || undefined,
|
||||
email: searchForm.value.email || undefined,
|
||||
status: searchForm.value.status,
|
||||
expired: searchForm.value.expired === 'true' ? true : searchForm.value.expired === 'false' ? false : undefined,
|
||||
},
|
||||
};
|
||||
const data = await getCompanyPageApi(params);
|
||||
@@ -273,41 +255,13 @@ async function handleDelete(record: CompanyVO.CompanyInfoVO) {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理表单提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
|
||||
// 准备提交数据,转换日期格式
|
||||
const submitData = {
|
||||
...formData.value,
|
||||
expireTime: formData.value.expireTime ? formData.value.expireTime.format('YYYY-MM-DD HH:mm:ss') : undefined,
|
||||
};
|
||||
|
||||
if (isEdit.value && currentCompanyId.value) {
|
||||
await updateCompanyApi(currentCompanyId.value, submitData);
|
||||
|
||||
if (isUnmounted) return;
|
||||
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createCompanyApi(submitData);
|
||||
|
||||
if (isUnmounted) return;
|
||||
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
modalVisible.value = false;
|
||||
await fetchCompanyList();
|
||||
} catch (error) {
|
||||
if (isUnmounted) return;
|
||||
|
||||
console.error('保存公司失败:', error);
|
||||
message.error('保存公司失败');
|
||||
}
|
||||
// 处理模态框成功回调
|
||||
async function handleModalSuccess() {
|
||||
await fetchCompanyList();
|
||||
}
|
||||
|
||||
// Logo相关方法已移至CompanyFormModal组件
|
||||
|
||||
// 初始化
|
||||
fetchCompanyList();
|
||||
</script>
|
||||
@@ -338,6 +292,33 @@ fetchCompanyList();
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">联系人</label>
|
||||
<Input
|
||||
v-model:value="searchForm.contactPerson"
|
||||
placeholder="请输入联系人"
|
||||
style="width: 150px;"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">联系电话</label>
|
||||
<Input
|
||||
v-model:value="searchForm.contactPhone"
|
||||
placeholder="请输入联系电话"
|
||||
style="width: 150px;"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">邮箱</label>
|
||||
<Input
|
||||
v-model:value="searchForm.email"
|
||||
placeholder="请输入邮箱"
|
||||
style="width: 200px;"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">状态</label>
|
||||
<Select
|
||||
@@ -348,6 +329,19 @@ fetchCompanyList();
|
||||
allow-clear
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">过期状态</label>
|
||||
<Select
|
||||
v-model:value="searchForm.expired"
|
||||
placeholder="请选择过期状态"
|
||||
style="width: 120px;"
|
||||
:options="[
|
||||
{ label: '已过期', value: 'true' },
|
||||
{ label: '正常', value: 'false' }
|
||||
]"
|
||||
allow-clear
|
||||
/>
|
||||
</div>
|
||||
<div style="display: flex; gap: 8px; align-items: end;">
|
||||
<Button type="primary" @click="handleSearch">搜索</Button>
|
||||
<Button @click="handleReset">重置</Button>
|
||||
@@ -372,61 +366,10 @@ fetchCompanyList();
|
||||
@change="handleTableChange"
|
||||
/>
|
||||
|
||||
<!-- 添加/编辑模态框 -->
|
||||
<Modal
|
||||
v-model:open="modalVisible"
|
||||
:title="modalTitle"
|
||||
width="600px"
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="公司名称" name="name" :rules="[{ required: true, message: '请输入公司名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入公司名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="公司地址" name="address">
|
||||
<Input v-model:value="formData.address" placeholder="请输入公司地址" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="联系人" name="contactPerson">
|
||||
<Input v-model:value="formData.contactPerson" placeholder="请输入联系人" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="联系电话" name="contactPhone" :rules="[{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码' }]">
|
||||
<Input v-model:value="formData.contactPhone" placeholder="请输入联系电话" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="邮箱" name="email" :rules="[{ type: 'email', message: '请输入正确的邮箱地址' }]">
|
||||
<Input v-model:value="formData.email" placeholder="请输入邮箱" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="Logo" name="logo" :rules="[{ type: 'url', message: '请输入正确的URL地址' }]">
|
||||
<Input v-model:value="formData.logo" placeholder="请输入Logo地址" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="状态" name="status" :rules="[{ required: true, message: '请选择状态' }]">
|
||||
<Select
|
||||
v-model:value="formData.status"
|
||||
placeholder="请选择状态"
|
||||
:options="statusOptions"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="订阅到期时间" name="expireTime">
|
||||
<DatePicker
|
||||
v-model:value="formData.expireTime"
|
||||
placeholder="请选择订阅到期时间"
|
||||
style="width: 100%;"
|
||||
show-time
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
<!-- 公司表单模态框 -->
|
||||
<CompanyFormModal
|
||||
ref="companyFormModalRef"
|
||||
@success="handleModalSuccess"
|
||||
/>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { Form, Input, Modal, Select, message } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
createDepartmentApi,
|
||||
updateDepartmentApi,
|
||||
type DepartmentVO,
|
||||
type DepartmentDTO
|
||||
} from '#/api/org';
|
||||
|
||||
interface Props {
|
||||
departmentList: DepartmentVO.DepartmentInfoVO[];
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'success'): void;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 响应式数据
|
||||
const formRef = ref();
|
||||
const loading = ref(false);
|
||||
const visible = ref(false);
|
||||
const isEdit = ref(false);
|
||||
const currentDepartmentData = ref<DepartmentVO.DepartmentInfoVO | null>(null);
|
||||
|
||||
// 表单数据
|
||||
const formData = ref<DepartmentDTO.CreateDepartmentDTO>({
|
||||
name: '',
|
||||
parentId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
});
|
||||
|
||||
// 状态选项
|
||||
const statusOptions = [
|
||||
{ label: '禁用', value: 0 },
|
||||
{ label: '启用', value: 1 },
|
||||
];
|
||||
|
||||
// 父部门选项
|
||||
const parentDepartmentOptions = computed(() => {
|
||||
const options: Array<{ label: string; value: number | undefined }> = [{ label: '根部门', value: undefined }];
|
||||
|
||||
const addDepartmentOptions = (departments: DepartmentVO.DepartmentInfoVO[], level = 0) => {
|
||||
departments.forEach(dept => {
|
||||
// 编辑时排除自己和自己的子部门
|
||||
if (isEdit.value && currentDepartmentData.value &&
|
||||
(dept.id === currentDepartmentData.value.id || isChildDepartment(dept, currentDepartmentData.value.id))) {
|
||||
return;
|
||||
}
|
||||
|
||||
const prefix = ' '.repeat(level);
|
||||
options.push({
|
||||
label: `${prefix}${dept.name}`,
|
||||
value: dept.id,
|
||||
});
|
||||
if (dept.children && dept.children.length > 0) {
|
||||
addDepartmentOptions(dept.children, level + 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
addDepartmentOptions(props.departmentList);
|
||||
return options;
|
||||
});
|
||||
|
||||
// 检查是否为子部门
|
||||
function isChildDepartment(department: DepartmentVO.DepartmentInfoVO, parentId: number): boolean {
|
||||
if (department.children) {
|
||||
for (const child of department.children) {
|
||||
if (child.id === parentId || isChildDepartment(child, parentId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 模态框标题
|
||||
const modalTitle = computed(() => isEdit.value ? '编辑部门' : '添加部门');
|
||||
|
||||
// 重置表单
|
||||
function resetForm() {
|
||||
formData.value = {
|
||||
name: '',
|
||||
parentId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
};
|
||||
formRef.value?.resetFields();
|
||||
}
|
||||
|
||||
// 处理模态框关闭
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 处理表单提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
loading.value = true;
|
||||
|
||||
if (isEdit.value && currentDepartmentData.value) {
|
||||
await updateDepartmentApi(currentDepartmentData.value.id, formData.value);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createDepartmentApi(formData.value);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
visible.value = false;
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('保存部门失败:', error);
|
||||
message.error('保存部门失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 暴露给父组件的方法
|
||||
function open(editMode: boolean = false, departmentData?: DepartmentVO.DepartmentInfoVO | null) {
|
||||
isEdit.value = editMode;
|
||||
currentDepartmentData.value = departmentData || null;
|
||||
|
||||
resetForm();
|
||||
|
||||
if (editMode && departmentData) {
|
||||
formData.value = {
|
||||
name: departmentData.name,
|
||||
parentId: departmentData.parentId,
|
||||
remark: departmentData.remark || '',
|
||||
status: departmentData.status,
|
||||
};
|
||||
}
|
||||
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal
|
||||
:open="visible"
|
||||
:title="modalTitle"
|
||||
width="500px"
|
||||
:confirm-loading="loading"
|
||||
@ok="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="父部门" name="parentId">
|
||||
<Select
|
||||
v-model:value="formData.parentId"
|
||||
placeholder="请选择父部门"
|
||||
:options="parentDepartmentOptions"
|
||||
allow-clear
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="部门名称" name="name" :rules="[{ required: true, message: '请输入部门名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入部门名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="描述" name="remark">
|
||||
<Input.TextArea v-model:value="formData.remark" placeholder="请输入部门描述" :rows="3" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="状态" name="status">
|
||||
<Select
|
||||
v-model:value="formData.status"
|
||||
placeholder="请选择状态"
|
||||
:options="statusOptions"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</template>
|
||||
+28
-95
@@ -2,17 +2,16 @@
|
||||
import { computed, h, ref } from 'vue';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { Button, Form, Input, Modal, Select, Table, message } from 'ant-design-vue';
|
||||
import { Button, Input, Select, Table, message } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
createDepartmentApi,
|
||||
deleteDepartmentApi,
|
||||
getDepartmentPageApi,
|
||||
updateDepartmentApi,
|
||||
getDepartmentPageApi,
|
||||
type DepartmentVO,
|
||||
type DepartmentDTO
|
||||
} from '#/api/org';
|
||||
import type { PageQueryDTO } from '#/types/common';
|
||||
import DepartmentModal from './components/DepartmentModal.vue';
|
||||
|
||||
defineOptions({ name: 'DepartmentManagement' });
|
||||
|
||||
@@ -22,26 +21,15 @@ const departmentList = ref<DepartmentVO.DepartmentInfoVO[]>([]);
|
||||
const total = ref(0);
|
||||
const current = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const modalVisible = ref(false);
|
||||
const modalTitle = ref('');
|
||||
const isEdit = ref(false);
|
||||
const currentDepartmentId = ref<number | null>(null);
|
||||
const formRef = ref();
|
||||
const departmentModalRef = ref();
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = ref({
|
||||
name: '',
|
||||
parentId: undefined as number | undefined,
|
||||
status: undefined as number | undefined,
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = ref<DepartmentDTO.CreateDepartmentDTO>({
|
||||
name: '',
|
||||
parentId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
});
|
||||
|
||||
// 状态选项
|
||||
const statusOptions = [
|
||||
{ label: '禁用', value: 0 },
|
||||
@@ -155,6 +143,7 @@ async function fetchDepartmentList() {
|
||||
pageSize: pageSize.value,
|
||||
filters: {
|
||||
name: searchForm.value.name || undefined,
|
||||
parentId: searchForm.value.parentId,
|
||||
status: searchForm.value.status,
|
||||
},
|
||||
};
|
||||
@@ -179,6 +168,7 @@ function handleSearch() {
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: '',
|
||||
parentId: undefined,
|
||||
status: undefined,
|
||||
};
|
||||
current.value = 1;
|
||||
@@ -194,30 +184,12 @@ function handleTableChange(pagination: any) {
|
||||
|
||||
// 处理添加部门
|
||||
function handleAdd() {
|
||||
modalTitle.value = '添加部门';
|
||||
isEdit.value = false;
|
||||
currentDepartmentId.value = null;
|
||||
formData.value = {
|
||||
name: '',
|
||||
parentId: undefined as number | undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
departmentModalRef.value?.open(false);
|
||||
}
|
||||
|
||||
// 处理编辑部门
|
||||
function handleEdit(record: DepartmentVO.DepartmentInfoVO) {
|
||||
modalTitle.value = '编辑部门';
|
||||
isEdit.value = true;
|
||||
currentDepartmentId.value = record.id;
|
||||
formData.value = {
|
||||
name: record.name,
|
||||
parentId: record.parentId,
|
||||
remark: record.remark || '',
|
||||
status: record.status,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
departmentModalRef.value?.open(true, record);
|
||||
}
|
||||
|
||||
// 处理删除部门
|
||||
@@ -232,25 +204,9 @@ async function handleDelete(record: DepartmentVO.DepartmentInfoVO) {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理表单提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
|
||||
if (isEdit.value && currentDepartmentId.value) {
|
||||
await updateDepartmentApi(currentDepartmentId.value, formData.value);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createDepartmentApi(formData.value);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
modalVisible.value = false;
|
||||
await fetchDepartmentList();
|
||||
} catch (error) {
|
||||
console.error('保存部门失败:', error);
|
||||
message.error('保存部门失败');
|
||||
}
|
||||
// 处理模态框成功回调
|
||||
async function handleModalSuccess() {
|
||||
await fetchDepartmentList();
|
||||
}
|
||||
|
||||
// 初始化
|
||||
@@ -283,6 +239,16 @@ fetchDepartmentList();
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">父部门</label>
|
||||
<Select
|
||||
v-model:value="searchForm.parentId"
|
||||
placeholder="请选择父部门"
|
||||
style="width: 200px;"
|
||||
:options="parentDepartmentOptions"
|
||||
allow-clear
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">状态</label>
|
||||
<Select
|
||||
@@ -317,44 +283,11 @@ fetchDepartmentList();
|
||||
@change="handleTableChange"
|
||||
/>
|
||||
|
||||
<!-- 添加/编辑模态框 -->
|
||||
<Modal
|
||||
v-model:open="modalVisible"
|
||||
:title="modalTitle"
|
||||
width="500px"
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="父部门" name="parentId">
|
||||
<Select
|
||||
v-model:value="formData.parentId"
|
||||
placeholder="请选择父部门"
|
||||
:options="parentDepartmentOptions"
|
||||
allow-clear
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="部门名称" name="name" :rules="[{ required: true, message: '请输入部门名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入部门名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="描述" name="remark">
|
||||
<Input.TextArea v-model:value="formData.remark" placeholder="请输入部门描述" :rows="3" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="状态" name="status">
|
||||
<Select
|
||||
v-model:value="formData.status"
|
||||
placeholder="请选择状态"
|
||||
:options="statusOptions"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
<!-- 部门模态框组件 -->
|
||||
<DepartmentModal
|
||||
ref="departmentModalRef"
|
||||
:department-list="departmentList"
|
||||
@success="handleModalSuccess"
|
||||
/>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { Form, Input, Modal, Select, message } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
createPositionApi,
|
||||
updatePositionApi,
|
||||
type PositionVO,
|
||||
type PositionDTO
|
||||
} from '#/api/org';
|
||||
|
||||
interface Props {
|
||||
departmentOptions: Array<{ label: string; value: number }>;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'success'): void;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 响应式数据
|
||||
const formRef = ref();
|
||||
const loading = ref(false);
|
||||
const visible = ref(false);
|
||||
const isEdit = ref(false);
|
||||
const currentPositionData = ref<PositionVO.PositionInfoVO | null>(null);
|
||||
|
||||
// 表单数据
|
||||
const formData = ref<PositionDTO.CreatePositionDTO>({
|
||||
name: '',
|
||||
code: '',
|
||||
departmentId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
});
|
||||
|
||||
// 状态选项
|
||||
const statusOptions = [
|
||||
{ label: '禁用', value: 0 },
|
||||
{ label: '启用', value: 1 },
|
||||
];
|
||||
|
||||
// 模态框标题
|
||||
const modalTitle = computed(() => isEdit.value ? '编辑岗位' : '添加岗位');
|
||||
|
||||
// 重置表单
|
||||
function resetForm() {
|
||||
formData.value = {
|
||||
name: '',
|
||||
code: '',
|
||||
departmentId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
};
|
||||
formRef.value?.resetFields();
|
||||
}
|
||||
|
||||
// 处理模态框关闭
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 处理表单提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
loading.value = true;
|
||||
|
||||
if (isEdit.value && currentPositionData.value) {
|
||||
await updatePositionApi(currentPositionData.value.id, formData.value);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createPositionApi(formData.value);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
visible.value = false;
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('保存岗位失败:', error);
|
||||
message.error('保存岗位失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 暴露给父组件的方法
|
||||
function open(editMode: boolean = false, positionData?: PositionVO.PositionInfoVO | null) {
|
||||
isEdit.value = editMode;
|
||||
currentPositionData.value = positionData || null;
|
||||
|
||||
resetForm();
|
||||
|
||||
if (editMode && positionData) {
|
||||
formData.value = {
|
||||
name: positionData.name,
|
||||
code: positionData.code || '',
|
||||
departmentId: positionData.departmentId,
|
||||
remark: positionData.remark || '',
|
||||
status: positionData.status,
|
||||
};
|
||||
}
|
||||
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal
|
||||
:open="visible"
|
||||
:title="modalTitle"
|
||||
width="500px"
|
||||
:confirm-loading="loading"
|
||||
@ok="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="岗位名称" name="name" :rules="[{ required: true, message: '请输入岗位名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入岗位名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="岗位编码" name="code">
|
||||
<Input v-model:value="formData.code" placeholder="请输入岗位编码" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="所属部门" name="departmentId">
|
||||
<Select
|
||||
v-model:value="formData.departmentId"
|
||||
placeholder="请选择所属部门"
|
||||
:options="departmentOptions"
|
||||
allow-clear
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="描述" name="remark">
|
||||
<Input.TextArea v-model:value="formData.remark" placeholder="请输入岗位描述" :rows="3" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="状态" name="status">
|
||||
<Select
|
||||
v-model:value="formData.status"
|
||||
placeholder="请选择状态"
|
||||
:options="statusOptions"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</template>
|
||||
+15
-102
@@ -2,17 +2,16 @@
|
||||
import { h, ref } from 'vue';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { Button, Form, Input, Modal, Select, Table, message } from 'ant-design-vue';
|
||||
import { Button, Input, Select, Table, message } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
createPositionApi,
|
||||
deletePositionApi,
|
||||
getPositionPageApi,
|
||||
updatePositionApi,
|
||||
getPositionPageApi,
|
||||
type PositionVO,
|
||||
type PositionDTO
|
||||
} from '#/api/org';
|
||||
import type { PageQueryDTO } from '#/types/common';
|
||||
import PositionModal from './components/PositionModal.vue';
|
||||
|
||||
defineOptions({ name: 'PositionManagement' });
|
||||
|
||||
@@ -22,11 +21,7 @@ const positionList = ref<PositionVO.PositionInfoVO[]>([]);
|
||||
const total = ref(0);
|
||||
const current = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const modalVisible = ref(false);
|
||||
const modalTitle = ref('');
|
||||
const isEdit = ref(false);
|
||||
const currentPositionId = ref<number | null>(null);
|
||||
const formRef = ref();
|
||||
const positionModalRef = ref();
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = ref({
|
||||
@@ -34,15 +29,6 @@ const searchForm = ref({
|
||||
status: undefined as number | undefined,
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = ref<PositionDTO.CreatePositionDTO>({
|
||||
name: '',
|
||||
code: '',
|
||||
departmentId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
});
|
||||
|
||||
// 状态选项
|
||||
const statusOptions = [
|
||||
{ label: '禁用', value: 0 },
|
||||
@@ -174,32 +160,12 @@ function handleTableChange(pagination: any) {
|
||||
|
||||
// 处理添加岗位
|
||||
function handleAdd() {
|
||||
modalTitle.value = '添加岗位';
|
||||
isEdit.value = false;
|
||||
currentPositionId.value = null;
|
||||
formData.value = {
|
||||
name: '',
|
||||
code: '',
|
||||
departmentId: undefined,
|
||||
remark: '',
|
||||
status: 1,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
positionModalRef.value?.open(false);
|
||||
}
|
||||
|
||||
// 处理编辑岗位
|
||||
function handleEdit(record: PositionVO.PositionInfoVO) {
|
||||
modalTitle.value = '编辑岗位';
|
||||
isEdit.value = true;
|
||||
currentPositionId.value = record.id;
|
||||
formData.value = {
|
||||
name: record.name,
|
||||
code: record.code || '',
|
||||
departmentId: record.departmentId,
|
||||
remark: record.remark || '',
|
||||
status: record.status,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
positionModalRef.value?.open(true, record);
|
||||
}
|
||||
|
||||
// 处理删除岗位
|
||||
@@ -214,25 +180,9 @@ async function handleDelete(record: PositionVO.PositionInfoVO) {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理表单提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
|
||||
if (isEdit.value && currentPositionId.value) {
|
||||
await updatePositionApi(currentPositionId.value, formData.value);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createPositionApi(formData.value);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
modalVisible.value = false;
|
||||
await fetchPositionList();
|
||||
} catch (error) {
|
||||
console.error('保存岗位失败:', error);
|
||||
message.error('保存岗位失败');
|
||||
}
|
||||
// 处理模态框成功回调
|
||||
async function handleModalSuccess() {
|
||||
await fetchPositionList();
|
||||
}
|
||||
|
||||
// 初始化
|
||||
@@ -299,48 +249,11 @@ fetchPositionList();
|
||||
@change="handleTableChange"
|
||||
/>
|
||||
|
||||
<!-- 添加/编辑模态框 -->
|
||||
<Modal
|
||||
v-model:open="modalVisible"
|
||||
:title="modalTitle"
|
||||
width="500px"
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="岗位名称" name="name" :rules="[{ required: true, message: '请输入岗位名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入岗位名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="岗位编码" name="code">
|
||||
<Input v-model:value="formData.code" placeholder="请输入岗位编码" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="所属部门" name="departmentId">
|
||||
<Select
|
||||
v-model:value="formData.departmentId"
|
||||
placeholder="请选择所属部门"
|
||||
:options="departmentOptions"
|
||||
allow-clear
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="描述" name="remark">
|
||||
<Input.TextArea v-model:value="formData.remark" placeholder="请输入岗位描述" :rows="3" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="状态" name="status">
|
||||
<Select
|
||||
v-model:value="formData.status"
|
||||
placeholder="请选择状态"
|
||||
:options="statusOptions"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
<!-- 岗位模态框组件 -->
|
||||
<PositionModal
|
||||
ref="positionModalRef"
|
||||
:department-options="departmentOptions"
|
||||
@success="handleModalSuccess"
|
||||
/>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
+248
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<Modal
|
||||
:open="visible"
|
||||
title="创建缺失的实体"
|
||||
width="800px"
|
||||
:confirm-loading="loading"
|
||||
@ok="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<div class="space-y-6">
|
||||
<!-- 店铺创建 -->
|
||||
<div v-if="entitiesToCreate.shops.length > 0" class="border border-gray-200 rounded-lg p-4">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">需要创建的店铺 ({{ entitiesToCreate.shops.length }} 个)</h3>
|
||||
<div class="space-y-3">
|
||||
<div
|
||||
v-for="(shopName, index) in entitiesToCreate.shops"
|
||||
:key="`shop-${index}`"
|
||||
class="flex items-center gap-4 p-3 bg-gray-50 rounded"
|
||||
>
|
||||
<span class="font-medium">{{ shopName }}</span>
|
||||
<Button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="openShopModal(shopName)"
|
||||
>
|
||||
创建店铺
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 商品创建 -->
|
||||
<div v-if="entitiesToCreate.products.length > 0" class="border border-gray-200 rounded-lg p-4">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">需要创建的商品 ({{ entitiesToCreate.products.length }} 个)</h3>
|
||||
<div class="space-y-3">
|
||||
<div
|
||||
v-for="(productName, index) in entitiesToCreate.products"
|
||||
:key="`product-${index}`"
|
||||
class="flex items-center gap-4 p-3 bg-gray-50 rounded"
|
||||
>
|
||||
<span class="font-medium">{{ productName }}</span>
|
||||
<Button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="openProductModal(productName)"
|
||||
>
|
||||
创建商品
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 商品规格创建 -->
|
||||
<div v-if="entitiesToCreate.specs.length > 0" class="border border-gray-200 rounded-lg p-4">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">需要创建的商品规格 ({{ entitiesToCreate.specs.length }} 个)</h3>
|
||||
<div class="space-y-3">
|
||||
<div
|
||||
v-for="(spec, index) in entitiesToCreate.specs"
|
||||
:key="`spec-${index}`"
|
||||
class="flex items-center gap-4 p-3 bg-gray-50 rounded"
|
||||
>
|
||||
<span class="font-medium">{{ spec.productName }} - {{ spec.specCode }}</span>
|
||||
<Button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="openProductSpecModal(spec)"
|
||||
>
|
||||
创建规格
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
|
||||
<div class="flex items-start">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-blue-800">提示</h3>
|
||||
<div class="mt-2 text-sm text-blue-700">
|
||||
<p>请先创建所有缺失的实体,然后再进行数据导入。创建完成后,系统将自动重新匹配数据。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<!-- 店铺创建模态框 -->
|
||||
<ShopFormModal
|
||||
ref="shopFormModalRef"
|
||||
@success="handleShopCreated"
|
||||
/>
|
||||
|
||||
<!-- 商品创建模态框 -->
|
||||
<ProductFormModal
|
||||
ref="productFormModalRef"
|
||||
@success="handleProductCreated"
|
||||
/>
|
||||
|
||||
<!-- 商品规格创建模态框 -->
|
||||
<ProductSpecModal
|
||||
ref="productSpecModalRef"
|
||||
@success="handleProductSpecCreated"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { Modal, Button, message } from 'ant-design-vue';
|
||||
import ShopFormModal from '../../shop-management/components/ShopFormModal.vue';
|
||||
import ProductFormModal from '../../product-management/components/ProductFormModal.vue';
|
||||
import ProductSpecModal from '../../product-management/components/ProductSpecModal.vue';
|
||||
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
entitiesToCreate: {
|
||||
shops: string[];
|
||||
products: string[];
|
||||
specs: { productName: string; specCode: string; specName?: string }[];
|
||||
};
|
||||
csvData?: any[]; // 传递CSV数据用于获取更多信息
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'success'): void;
|
||||
(e: 'cancel'): void;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const shopFormModalRef = ref();
|
||||
const productFormModalRef = ref();
|
||||
const productSpecModalRef = ref();
|
||||
|
||||
// 当前正在创建的实体
|
||||
const currentCreatingShop = ref<string>('');
|
||||
const currentCreatingProduct = ref<string>('');
|
||||
const currentCreatingSpec = ref<{ productName: string; specCode: string } | null>(null);
|
||||
|
||||
// 处理提交
|
||||
function handleSubmit() {
|
||||
// 检查是否还有未创建的实体
|
||||
const { entitiesToCreate } = defineProps<Props>();
|
||||
|
||||
if (entitiesToCreate.shops.length > 0 ||
|
||||
entitiesToCreate.products.length > 0 ||
|
||||
entitiesToCreate.specs.length > 0) {
|
||||
message.warning('请先创建所有缺失的实体');
|
||||
return;
|
||||
}
|
||||
|
||||
emit('success');
|
||||
}
|
||||
|
||||
// 处理取消
|
||||
function handleCancel() {
|
||||
emit('cancel');
|
||||
}
|
||||
|
||||
// 打开店铺创建模态框
|
||||
function openShopModal(shopName: string) {
|
||||
currentCreatingShop.value = shopName;
|
||||
// 从CSV数据中获取更多店铺信息
|
||||
const shopData = {
|
||||
name: shopName,
|
||||
description: `从CSV文件导入的店铺:${shopName}`,
|
||||
// 可以根据需要添加更多默认值
|
||||
};
|
||||
shopFormModalRef.value?.open(false, shopData);
|
||||
}
|
||||
|
||||
// 打开商品创建模态框
|
||||
function openProductModal(productName: string) {
|
||||
currentCreatingProduct.value = productName;
|
||||
|
||||
// 从CSV数据中获取该商品的所有规格信息
|
||||
const csvSpecs = props.csvData?.filter(row => row.productName === productName) || [];
|
||||
|
||||
// 对规格进行去重处理,使用Map来去重
|
||||
const specMap = new Map<string, { specCode: string; specName: string }>();
|
||||
csvSpecs.forEach(row => {
|
||||
const specCode = row.specCode;
|
||||
const specName = row.productSpecName;
|
||||
if (specCode && !specMap.has(specCode)) {
|
||||
specMap.set(specCode, {
|
||||
specCode: specCode,
|
||||
specName: specName || specCode // 如果没有规格名称,使用规格编码
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 转换为数组
|
||||
const uniqueSpecs = Array.from(specMap.values());
|
||||
|
||||
// 构建商品数据,包含规格信息
|
||||
const productData = {
|
||||
name: productName,
|
||||
description: `从CSV文件导入的商品:${productName}`,
|
||||
// 添加规格信息
|
||||
specs: uniqueSpecs
|
||||
};
|
||||
|
||||
console.log('商品数据:', productData);
|
||||
productFormModalRef.value?.open(false, productData);
|
||||
}
|
||||
|
||||
// 打开商品规格创建模态框
|
||||
function openProductSpecModal(spec: { productName: string; specCode: string; specName?: string }) {
|
||||
currentCreatingSpec.value = spec;
|
||||
// 由于ProductSpecModal需要完整的商品对象,这里需要先创建商品
|
||||
// 或者修改ProductSpecModal以支持部分数据
|
||||
message.info('请先创建对应的商品,然后再创建规格');
|
||||
}
|
||||
|
||||
// 处理店铺创建成功
|
||||
function handleShopCreated() {
|
||||
message.success(`店铺 "${currentCreatingShop.value}" 创建成功`);
|
||||
currentCreatingShop.value = '';
|
||||
// 这里可以触发重新匹配
|
||||
emit('success');
|
||||
}
|
||||
|
||||
// 处理商品创建成功
|
||||
function handleProductCreated() {
|
||||
message.success(`商品 "${currentCreatingProduct.value}" 创建成功`);
|
||||
currentCreatingProduct.value = '';
|
||||
// 这里可以触发重新匹配
|
||||
emit('success');
|
||||
}
|
||||
|
||||
// 处理商品规格创建成功
|
||||
function handleProductSpecCreated() {
|
||||
if (currentCreatingSpec.value) {
|
||||
message.success(`商品规格 "${currentCreatingSpec.value.productName} - ${currentCreatingSpec.value.specCode}" 创建成功`);
|
||||
currentCreatingSpec.value = null;
|
||||
// 这里可以触发重新匹配
|
||||
emit('success');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -43,6 +43,50 @@
|
||||
<p class="text-sm text-green-600 mt-1">{{ uploadedFile.name }} ({{ formatFileSize(uploadedFile.size) }})</p>
|
||||
</div>
|
||||
|
||||
<!-- 实体匹配结果 -->
|
||||
<div v-if="matchingResult" class="space-y-4">
|
||||
<VbenCard title="实体匹配结果">
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
|
||||
<div class="bg-green-50 border border-green-200 rounded-lg p-4">
|
||||
<div class="text-green-800 font-medium">匹配成功</div>
|
||||
<div class="text-2xl font-bold text-green-600">{{ matchingResult.matchedOrders.length }}</div>
|
||||
<div class="text-sm text-green-600">条订单数据</div>
|
||||
</div>
|
||||
<div class="bg-red-50 border border-red-200 rounded-lg p-4">
|
||||
<div class="text-red-800 font-medium">匹配失败</div>
|
||||
<div class="text-2xl font-bold text-red-600">{{ matchingResult.failedRecords.length }}</div>
|
||||
<div class="text-sm text-red-600">条记录</div>
|
||||
</div>
|
||||
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
|
||||
<div class="text-blue-800 font-medium">需要创建</div>
|
||||
<div class="text-2xl font-bold text-blue-600">
|
||||
{{ matchingResult.entitiesToCreate.shops.length + matchingResult.entitiesToCreate.products.length + matchingResult.entitiesToCreate.specs.length }}
|
||||
</div>
|
||||
<div class="text-sm text-blue-600">个实体</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-2">
|
||||
<VbenButton
|
||||
@click="performImport"
|
||||
type="primary"
|
||||
:loading="importLoading"
|
||||
:disabled="matchingResult.matchedOrders.length === 0"
|
||||
>
|
||||
开始导入 ({{ matchingResult.matchedOrders.length }})
|
||||
</VbenButton>
|
||||
<VbenButton @click="performEntityMatching" size="small">
|
||||
重新匹配
|
||||
</VbenButton>
|
||||
</div>
|
||||
|
||||
<!-- 导入进度 -->
|
||||
<div v-if="importLoading" class="mt-4">
|
||||
<Progress :percent="importProgress" />
|
||||
</div>
|
||||
</VbenCard>
|
||||
</div>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<div v-if="csvData.length > 0" class="space-y-4">
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -69,7 +113,16 @@
|
||||
<Grid
|
||||
@checkbox-change="handleCheckboxChange"
|
||||
@checkbox-all="handleCheckboxAll"
|
||||
/>
|
||||
>
|
||||
<template #action="{ row }">
|
||||
<VbenButton size="small" @click="handleEditRow(row)">
|
||||
编辑
|
||||
</VbenButton>
|
||||
<VbenButton size="small" type="primary" @click="handleMatchRow(row)">
|
||||
匹配
|
||||
</VbenButton>
|
||||
</template>
|
||||
</Grid>
|
||||
</div>
|
||||
</div>
|
||||
</VbenCard>
|
||||
@@ -88,14 +141,26 @@
|
||||
@cancel="showFieldMapping = false"
|
||||
/>
|
||||
</VbenModal>
|
||||
|
||||
<!-- 实体创建模态框 -->
|
||||
<EntityCreationModal
|
||||
:visible="showEntityCreationModal"
|
||||
:entities-to-create="matchingResult?.entitiesToCreate || { shops: [], products: [], specs: [] }"
|
||||
:csv-data="csvData"
|
||||
@success="handleEntityCreationSuccess"
|
||||
@cancel="handleEntityCreationCancel"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { message, Progress } from 'ant-design-vue'
|
||||
import FieldMapping from '#/views/ecommerce/data-import/components/FieldMapping.vue'
|
||||
import { parseCSV, extractShopNameFromFilename, validateCSVData, cleanAndFormatData } from '#/utils/csv-utils'
|
||||
import EntityCreationModal from './components/EntityCreationModal.vue'
|
||||
import { EntityMatchingService, type EntityMatchingResult } from './services/EntityMatchingService'
|
||||
import { batchImportOrdersApi } from '#/api/ecommerce'
|
||||
import { parseOrderCSV, extractShopNameFromFilename, convertToCSVOrderData } from './utils/csvParser'
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table'
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table'
|
||||
|
||||
@@ -108,6 +173,13 @@ const isDragOver = ref(false)
|
||||
const fileInputRef = ref<HTMLInputElement>()
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
// 实体匹配相关
|
||||
const entityMatchingService = new EntityMatchingService()
|
||||
const matchingResult = ref<EntityMatchingResult | null>(null)
|
||||
const showEntityCreationModal = ref(false)
|
||||
const importLoading = ref(false)
|
||||
const importProgress = ref(0)
|
||||
|
||||
// VxeTable 配置
|
||||
const gridOptions: VxeGridProps<any> = {
|
||||
columns: [
|
||||
@@ -122,6 +194,62 @@ const gridOptions: VxeGridProps<any> = {
|
||||
fixed: 'left',
|
||||
title: '序号',
|
||||
},
|
||||
{
|
||||
field: 'productName',
|
||||
title: '商品名称',
|
||||
width: 200,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'orderNumber',
|
||||
title: '订单编号',
|
||||
width: 180,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'orderStatusName',
|
||||
title: '订单状态',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
field: 'quantity',
|
||||
title: '数量',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
field: 'productId',
|
||||
title: '商品ID',
|
||||
width: 120,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'productSpecName',
|
||||
title: '商品规格',
|
||||
width: 200,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'shopName',
|
||||
title: '店铺名称',
|
||||
width: 150,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'afterSaleStatus',
|
||||
title: '售后状态',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
field: 'shopActualAmount',
|
||||
title: '实收金额',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' }
|
||||
}
|
||||
],
|
||||
data: [],
|
||||
height: 500,
|
||||
@@ -161,13 +289,68 @@ const updateTableColumns = () => {
|
||||
fixed: 'left',
|
||||
title: '序号',
|
||||
},
|
||||
...csvHeaders.value.map((header) => ({
|
||||
field: header,
|
||||
title: header,
|
||||
{
|
||||
field: 'productName',
|
||||
title: '商品名称',
|
||||
width: 200,
|
||||
showOverflow: 'tooltip',
|
||||
sortable: true,
|
||||
}))
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'orderNumber',
|
||||
title: '订单编号',
|
||||
width: 180,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'orderStatusName',
|
||||
title: '订单状态',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
field: 'quantity',
|
||||
title: '数量',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
field: 'productId',
|
||||
title: '商品ID',
|
||||
width: 120,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'productSpecName',
|
||||
title: '商品规格',
|
||||
width: 200,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'specCode',
|
||||
title: '规格编码',
|
||||
width: 120,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'shopName',
|
||||
title: '店铺名称',
|
||||
width: 150,
|
||||
showOverflow: 'tooltip'
|
||||
},
|
||||
{
|
||||
field: 'afterSaleStatus',
|
||||
title: '售后状态',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
field: 'shopActualAmount',
|
||||
title: '实收金额',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' }
|
||||
}
|
||||
]
|
||||
|
||||
gridApi.setGridOptions({
|
||||
@@ -200,28 +383,21 @@ const processFile = async (file: File) => {
|
||||
uploadedFile.value = file
|
||||
|
||||
try {
|
||||
// 使用工具函数解析CSV
|
||||
const result = await parseCSV(file)
|
||||
// 使用新的CSV解析器
|
||||
const result = await parseOrderCSV(file)
|
||||
|
||||
if (result.errors.length > 0) {
|
||||
message.error('CSV文件解析失败: ' + result.errors[0].message)
|
||||
message.error('CSV文件解析失败: ' + result.errors.join(', '))
|
||||
return
|
||||
}
|
||||
|
||||
// 验证数据格式
|
||||
const validation = validateCSVData(result.data)
|
||||
if (!validation.isValid) {
|
||||
message.error('数据格式验证失败: ' + validation.errors.join(', '))
|
||||
return
|
||||
}
|
||||
|
||||
// 清洗和格式化数据,并添加唯一ID
|
||||
const cleanedData = cleanAndFormatData(result.data).map((item, index) => ({
|
||||
// 添加唯一ID并转换为表格数据
|
||||
const tableData = result.data.map((item, index) => ({
|
||||
...item,
|
||||
id: `row_${index}`,
|
||||
}))
|
||||
|
||||
csvData.value = cleanedData
|
||||
csvData.value = tableData
|
||||
csvHeaders.value = result.headers
|
||||
selectedRows.value = []
|
||||
|
||||
@@ -230,7 +406,10 @@ const processFile = async (file: File) => {
|
||||
|
||||
// 从文件名提取店铺名称
|
||||
const shopName = extractShopNameFromFilename(file.name)
|
||||
message.success(`成功解析 ${cleanedData.length} 条数据,店铺:${shopName}`)
|
||||
message.success(`成功解析 ${tableData.length} 条数据,店铺:${shopName}`)
|
||||
|
||||
// 自动进行实体匹配
|
||||
await performEntityMatching()
|
||||
|
||||
} catch (error: any) {
|
||||
message.error('文件读取失败: ' + error.message)
|
||||
@@ -314,6 +493,111 @@ const handleFieldMapping = (mappedData: any) => {
|
||||
message.success('字段映射配置完成')
|
||||
}
|
||||
|
||||
// 执行实体匹配
|
||||
const performEntityMatching = async () => {
|
||||
if (csvData.value.length === 0) return
|
||||
|
||||
try {
|
||||
// 转换为EntityMatchingService需要的格式
|
||||
const shopName = uploadedFile.value ? extractShopNameFromFilename(uploadedFile.value.name) : '未知店铺'
|
||||
const orderData = convertToCSVOrderData(csvData.value as any[], shopName)
|
||||
|
||||
// 执行实体匹配
|
||||
const result = await entityMatchingService.matchEntities(orderData)
|
||||
matchingResult.value = result
|
||||
|
||||
// 显示匹配结果
|
||||
if (result.matchedOrders.length > 0) {
|
||||
message.success(`成功匹配 ${result.matchedOrders.length} 条订单数据`)
|
||||
}
|
||||
|
||||
if (result.failedRecords.length > 0) {
|
||||
message.warning(`${result.failedRecords.length} 条记录需要手动处理,可以在表格中操作`)
|
||||
}
|
||||
|
||||
// 如果有需要创建的实体,显示创建模态框
|
||||
if (result.entitiesToCreate.shops.length > 0 ||
|
||||
result.entitiesToCreate.products.length > 0 ||
|
||||
result.entitiesToCreate.specs.length > 0) {
|
||||
showEntityCreationModal.value = true
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('实体匹配失败:', error)
|
||||
message.error('实体匹配失败: ' + (error instanceof Error ? error.message : '未知错误'))
|
||||
}
|
||||
}
|
||||
|
||||
// 执行数据导入
|
||||
const performImport = async () => {
|
||||
if (!matchingResult.value || matchingResult.value.matchedOrders.length === 0) {
|
||||
message.warning('没有可导入的数据')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
importLoading.value = true
|
||||
importProgress.value = 0
|
||||
|
||||
// 模拟进度更新
|
||||
const progressInterval = setInterval(() => {
|
||||
if (importProgress.value < 90) {
|
||||
importProgress.value += 10
|
||||
}
|
||||
}, 200)
|
||||
|
||||
// 调用批量导入API
|
||||
const result = await batchImportOrdersApi({
|
||||
orders: matchingResult.value.matchedOrders
|
||||
})
|
||||
|
||||
clearInterval(progressInterval)
|
||||
importProgress.value = 100
|
||||
|
||||
message.success(`导入完成!成功导入 ${result.successCount} 条,失败 ${result.failureCount} 条`)
|
||||
|
||||
// 显示失败详情
|
||||
if (result.failureDetails.length > 0) {
|
||||
console.warn('导入失败详情:', result.failureDetails)
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('数据导入失败:', error)
|
||||
message.error('数据导入失败: ' + (error instanceof Error ? error.message : '未知错误'))
|
||||
} finally {
|
||||
importLoading.value = false
|
||||
importProgress.value = 0
|
||||
}
|
||||
}
|
||||
|
||||
// 处理实体创建成功
|
||||
const handleEntityCreationSuccess = async () => {
|
||||
showEntityCreationModal.value = false
|
||||
message.success('实体创建成功,正在重新匹配...')
|
||||
|
||||
// 重新执行实体匹配
|
||||
await performEntityMatching()
|
||||
}
|
||||
|
||||
// 处理实体创建取消
|
||||
const handleEntityCreationCancel = () => {
|
||||
showEntityCreationModal.value = false
|
||||
}
|
||||
|
||||
// 处理行编辑
|
||||
const handleEditRow = (row: any) => {
|
||||
// 可以打开编辑模态框或内联编辑
|
||||
console.log('编辑行:', row)
|
||||
message.info('编辑功能待实现')
|
||||
}
|
||||
|
||||
// 处理行匹配
|
||||
const handleMatchRow = (row: any) => {
|
||||
// 可以打开匹配模态框,让用户手动匹配实体
|
||||
console.log('匹配行:', row)
|
||||
message.info('匹配功能待实现')
|
||||
}
|
||||
|
||||
// 格式化文件大小
|
||||
const formatFileSize = (bytes: number) => {
|
||||
if (bytes === 0) return '0 Bytes'
|
||||
|
||||
+302
@@ -0,0 +1,302 @@
|
||||
/**
|
||||
* 实体匹配服务
|
||||
* 用于匹配CSV数据中的实体(店铺、商品、规格、订单状态)到数据库中的ID
|
||||
*/
|
||||
|
||||
import {
|
||||
getShopsByNamesApi,
|
||||
getProductsByNamesApi,
|
||||
getProductSpecsByProductAndSpecsApi,
|
||||
type ShopVO,
|
||||
type ProductVO,
|
||||
type OrderDTO
|
||||
} from '#/api/ecommerce';
|
||||
|
||||
export interface EntityMatchingResult {
|
||||
/** 匹配成功的订单数据 */
|
||||
matchedOrders: OrderDTO.CreateOrderDTO[];
|
||||
/** 匹配失败的记录 */
|
||||
failedRecords: FailedRecord[];
|
||||
/** 需要创建的实体 */
|
||||
entitiesToCreate: {
|
||||
shops: string[];
|
||||
products: string[];
|
||||
specs: { productName: string; specCode: string }[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface FailedRecord {
|
||||
/** 行号 */
|
||||
rowIndex: number;
|
||||
/** 原始数据 */
|
||||
originalData: any;
|
||||
/** 失败原因 */
|
||||
reason: string;
|
||||
}
|
||||
|
||||
export interface CSVOrderData {
|
||||
/** 店铺名称 */
|
||||
shopName: string;
|
||||
/** 商品名称 */
|
||||
productName: string;
|
||||
/** 商品规格编码 */
|
||||
specCode: string;
|
||||
/** 订单状态名称 */
|
||||
orderStatusName: string;
|
||||
/** 商品数量 */
|
||||
quantity: number;
|
||||
/** 订单编号 */
|
||||
orderNumber: string;
|
||||
/** 商品规格名称 */
|
||||
productSpecName: string;
|
||||
/** 店铺实际收入 */
|
||||
shopActualAmount: number;
|
||||
}
|
||||
|
||||
export class EntityMatchingService {
|
||||
private shopCache: Map<string, ShopVO.ShopInfoVO> = new Map();
|
||||
private productCache: Map<string, ProductVO.ProductInfoVO> = new Map();
|
||||
private specCache: Map<string, ProductVO.ProductSpecInfoVO> = new Map();
|
||||
private orderStatusMap: Map<string, number> = new Map();
|
||||
|
||||
constructor() {
|
||||
this.initializeOrderStatusMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化订单状态映射
|
||||
*/
|
||||
private initializeOrderStatusMap() {
|
||||
// 根据CSV文件中的订单状态,映射到对应的ID
|
||||
// 这里需要根据实际的订单状态配置来设置
|
||||
this.orderStatusMap.set('已发货,待收货', 1);
|
||||
this.orderStatusMap.set('未发货,退款成功', 2);
|
||||
this.orderStatusMap.set('已取消', 3);
|
||||
this.orderStatusMap.set('退款成功', 2);
|
||||
// 可以根据需要添加更多状态映射
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配实体并生成订单数据
|
||||
*/
|
||||
async matchEntities(csvData: CSVOrderData[]): Promise<EntityMatchingResult> {
|
||||
// 清空缓存
|
||||
this.clearCache();
|
||||
|
||||
// 提取所有需要查询的实体名称
|
||||
const shopNames = [...new Set(csvData.map(row => row.shopName))];
|
||||
const productNames = [...new Set(csvData.map(row => row.productName))];
|
||||
|
||||
// 对规格查询进行去重处理
|
||||
const specQueriesMap = new Map<string, { productName: string; specCode: string }>();
|
||||
csvData.forEach(row => {
|
||||
const key = `${row.productName}_${row.specCode}`;
|
||||
if (!specQueriesMap.has(key)) {
|
||||
specQueriesMap.set(key, { productName: row.productName, specCode: row.specCode });
|
||||
}
|
||||
});
|
||||
const specQueries = Array.from(specQueriesMap.values());
|
||||
|
||||
// 批量查询所有实体
|
||||
await this.loadEntitiesBatch(shopNames, productNames, specQueries);
|
||||
|
||||
const matchedOrders: OrderDTO.CreateOrderDTO[] = [];
|
||||
const failedRecords: FailedRecord[] = [];
|
||||
const entitiesToCreate = {
|
||||
shops: new Set<string>(),
|
||||
products: new Set<string>(),
|
||||
specs: new Set<{ productName: string; specCode: string }>()
|
||||
};
|
||||
|
||||
for (let i = 0; i < csvData.length; i++) {
|
||||
const row = csvData[i];
|
||||
|
||||
// 检查行数据是否存在
|
||||
if (!row) {
|
||||
failedRecords.push({
|
||||
rowIndex: i + 1,
|
||||
originalData: null,
|
||||
reason: '行数据为空'
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
// 匹配店铺
|
||||
const shop = this.shopCache.get(row.shopName);
|
||||
if (!shop) {
|
||||
entitiesToCreate.shops.add(row.shopName);
|
||||
failedRecords.push({
|
||||
rowIndex: i + 1,
|
||||
originalData: row,
|
||||
reason: `店铺 "${row.shopName}" 不存在`
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 匹配商品
|
||||
const product = this.productCache.get(row.productName);
|
||||
if (!product) {
|
||||
entitiesToCreate.products.add(row.productName);
|
||||
failedRecords.push({
|
||||
rowIndex: i + 1,
|
||||
originalData: row,
|
||||
reason: `商品 "${row.productName}" 不存在`
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 匹配商品规格
|
||||
const specKey = `${row.productName}_${row.specCode}`;
|
||||
const spec = this.specCache.get(specKey);
|
||||
if (!spec) {
|
||||
entitiesToCreate.specs.add({ productName: row.productName, specCode: row.specCode });
|
||||
failedRecords.push({
|
||||
rowIndex: i + 1,
|
||||
originalData: row,
|
||||
reason: `商品规格 "${row.productName}" - "${row.specCode}" 不存在`
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 匹配订单状态
|
||||
const orderStatusId = this.orderStatusMap.get(row.orderStatusName);
|
||||
if (!orderStatusId) {
|
||||
failedRecords.push({
|
||||
rowIndex: i + 1,
|
||||
originalData: row,
|
||||
reason: `订单状态 "${row.orderStatusName}" 不存在`
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 从订单号中提取日期信息(格式:250913-341248633251447,前6位是日期)
|
||||
let orderDate = new Date().toISOString(); // 默认使用当前时间
|
||||
if (row.orderNumber && row.orderNumber.length >= 6) {
|
||||
try {
|
||||
const dateStr = row.orderNumber.substring(0, 6); // 提取前6位
|
||||
const year = '20' + dateStr.substring(0, 2); // 25 -> 2025
|
||||
const month = dateStr.substring(2, 4); // 09
|
||||
const day = dateStr.substring(4, 6); // 13
|
||||
orderDate = new Date(`${year}-${month}-${day}T00:00:00`).toISOString();
|
||||
} catch (error) {
|
||||
console.warn('无法解析订单号中的日期,使用当前时间:', row.orderNumber);
|
||||
}
|
||||
}
|
||||
|
||||
// 创建订单数据(简化结构,直接包含订单明细字段)
|
||||
const orderData: OrderDTO.CreateOrderDTO = {
|
||||
shopId: shop.id,
|
||||
platformOrderNo: row.orderNumber,
|
||||
statusId: orderStatusId,
|
||||
receivedAmount: row.shopActualAmount,
|
||||
shippingFee: 0, // 运费暂时设为0
|
||||
orderDate: orderDate,
|
||||
productId: product.id,
|
||||
productSpecId: spec.id,
|
||||
quantity: row.quantity,
|
||||
};
|
||||
|
||||
matchedOrders.push(orderData);
|
||||
} catch (error) {
|
||||
failedRecords.push({
|
||||
rowIndex: i + 1,
|
||||
originalData: row,
|
||||
reason: `处理失败: ${error instanceof Error ? error.message : '未知错误'}`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
matchedOrders,
|
||||
failedRecords,
|
||||
entitiesToCreate: {
|
||||
shops: Array.from(entitiesToCreate.shops),
|
||||
products: Array.from(entitiesToCreate.products),
|
||||
specs: Array.from(entitiesToCreate.specs)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量加载实体数据
|
||||
*/
|
||||
private async loadEntitiesBatch(
|
||||
shopNames: string[],
|
||||
productNames: string[],
|
||||
specQueries: { productName: string; specCode: string }[]
|
||||
): Promise<void> {
|
||||
try {
|
||||
// 并行查询所有实体
|
||||
const [shops, products, productsWithSpecs] = await Promise.all([
|
||||
shopNames.length > 0 ? getShopsByNamesApi(shopNames) : Promise.resolve([]),
|
||||
productNames.length > 0 ? getProductsByNamesApi(productNames) : Promise.resolve([]),
|
||||
specQueries.length > 0 ? getProductSpecsByProductAndSpecsApi(specQueries) : Promise.resolve([])
|
||||
]);
|
||||
|
||||
// 缓存店铺数据
|
||||
shops.forEach(shop => {
|
||||
this.shopCache.set(shop.name, shop);
|
||||
});
|
||||
|
||||
// 缓存商品数据
|
||||
products.forEach(product => {
|
||||
this.productCache.set(product.name, product);
|
||||
});
|
||||
|
||||
// 缓存包含规格信息的商品数据
|
||||
productsWithSpecs.forEach(product => {
|
||||
// 更新商品缓存
|
||||
this.productCache.set(product.name, product);
|
||||
|
||||
// 缓存该商品的规格数据
|
||||
if (product.specs && product.specs.length > 0) {
|
||||
product.specs.forEach(spec => {
|
||||
const key = `${product.name}_${spec.specCode || ''}`;
|
||||
this.specCache.set(key, spec);
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('批量加载实体数据失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空缓存
|
||||
*/
|
||||
private clearCache(): void {
|
||||
this.shopCache.clear();
|
||||
this.productCache.clear();
|
||||
this.specCache.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺信息
|
||||
*/
|
||||
getShopByName(name: string): ShopVO.ShopInfoVO | undefined {
|
||||
return this.shopCache.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品信息
|
||||
*/
|
||||
getProductByName(name: string): ProductVO.ProductInfoVO | undefined {
|
||||
return this.productCache.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品规格信息
|
||||
*/
|
||||
getProductSpecByKey(productName: string, specCode: string): ProductVO.ProductSpecInfoVO | undefined {
|
||||
const key = `${productName}_${specCode}`;
|
||||
return this.specCache.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单状态ID
|
||||
*/
|
||||
getOrderStatusId(statusName: string): number | undefined {
|
||||
return this.orderStatusMap.get(statusName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
/**
|
||||
* CSV数据解析工具
|
||||
* 专门用于解析订单导入的CSV文件
|
||||
*/
|
||||
|
||||
import Papa from 'papaparse';
|
||||
|
||||
export interface ParsedOrderData {
|
||||
/** 商品名称 */
|
||||
productName: string;
|
||||
/** 订单编号 */
|
||||
orderNumber: string;
|
||||
/** 订单状态名称 */
|
||||
orderStatusName: string;
|
||||
/** 商品数量 */
|
||||
quantity: number;
|
||||
/** 商品ID */
|
||||
productId: string;
|
||||
/** 商品规格名称 */
|
||||
productSpecName: string;
|
||||
/** 规格编码 */
|
||||
specCode: string;
|
||||
/** 店铺名称 */
|
||||
shopName: string;
|
||||
/** 售后状态 */
|
||||
afterSaleStatus: string;
|
||||
/** 店铺实际收入 */
|
||||
shopActualAmount: number;
|
||||
}
|
||||
|
||||
export interface CSVParseResult {
|
||||
/** 解析成功的数据 */
|
||||
data: ParsedOrderData[];
|
||||
/** 解析错误 */
|
||||
errors: string[];
|
||||
/** 表头 */
|
||||
headers: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析CSV文件 - 使用papaparse库,支持多种编码
|
||||
*/
|
||||
export async function parseOrderCSV(file: File): Promise<CSVParseResult> {
|
||||
const errors: string[] = [];
|
||||
const data: ParsedOrderData[] = [];
|
||||
let headers: string[] = [];
|
||||
|
||||
// 尝试多种编码格式
|
||||
const encodings = ['GBK', 'UTF-8', 'GB2312'];
|
||||
let result: Papa.ParseResult<any> | null = null;
|
||||
|
||||
for (const encoding of encodings) {
|
||||
try {
|
||||
console.log(`尝试使用${encoding}编码解析文件...`);
|
||||
|
||||
result = await new Promise<Papa.ParseResult<any>>((resolve, reject) => {
|
||||
Papa.parse(file, {
|
||||
header: true,
|
||||
skipEmptyLines: true,
|
||||
encoding: encoding as any,
|
||||
complete: (results) => {
|
||||
resolve(results);
|
||||
},
|
||||
error: (error) => {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 检查是否成功解析出中文内容
|
||||
if (result.data && result.data.length > 0) {
|
||||
const firstRow = result.data[0];
|
||||
const hasChineseContent = Object.values(firstRow).some(value =>
|
||||
typeof value === 'string' && /[\u4e00-\u9fa5]/.test(value)
|
||||
);
|
||||
|
||||
if (hasChineseContent) {
|
||||
console.log(`成功使用${encoding}编码解析文件`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`使用${encoding}编码解析失败:`, error);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
errors.push('无法解析CSV文件,请检查文件格式和编码');
|
||||
return { data, errors, headers };
|
||||
}
|
||||
|
||||
if (result.errors.length > 0) {
|
||||
errors.push(`CSV解析错误: ${result.errors.map(e => e.message).join(', ')}`);
|
||||
}
|
||||
|
||||
if (!result.data || result.data.length === 0) {
|
||||
errors.push('CSV文件为空或没有有效数据');
|
||||
return { data, errors, headers };
|
||||
}
|
||||
|
||||
// 获取表头
|
||||
headers = result.meta.fields || [];
|
||||
console.log('解析到的表头:', headers);
|
||||
|
||||
// 验证表头 - 使用更灵活的表头匹配
|
||||
const requiredHeaders = ['商品', '订单号', '订单状态', '商品数量(件)', '商品id', '商品规格', '商家编码-规格维度', '售后状态', '商家实收金额(元)'];
|
||||
const missingHeaders = requiredHeaders.filter(requiredHeader => {
|
||||
// 检查是否有匹配的表头(支持部分匹配)
|
||||
return !headers.some(header =>
|
||||
header.includes(requiredHeader) || requiredHeader.includes(header)
|
||||
);
|
||||
});
|
||||
|
||||
if (missingHeaders.length > 0) {
|
||||
console.log('缺少的列:', missingHeaders);
|
||||
console.log('实际表头:', headers);
|
||||
console.log('期望表头:', requiredHeaders);
|
||||
// 不再阻止导入,只是记录警告
|
||||
errors.push(`警告:缺少部分列: ${missingHeaders.join(', ')},可以在导入后手动处理`);
|
||||
}
|
||||
|
||||
// 解析数据行
|
||||
for (let i = 0; i < result.data.length; i++) {
|
||||
try {
|
||||
const row = result.data[i];
|
||||
const rowData = parseOrderRowFromObject(row, i + 2); // +2 因为从第2行开始(第1行是表头)
|
||||
if (rowData) {
|
||||
data.push(rowData);
|
||||
}
|
||||
} catch (error) {
|
||||
errors.push(`第${i + 2}行解析失败: ${error instanceof Error ? error.message : '未知错误'}`);
|
||||
console.log(`第${i + 2}行解析错误:`, error);
|
||||
}
|
||||
}
|
||||
|
||||
return { data, errors, headers };
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析订单行数据 - 从papaparse对象格式
|
||||
*/
|
||||
function parseOrderRowFromObject(row: any, rowNumber: number): ParsedOrderData | null {
|
||||
try {
|
||||
// 获取字段值,支持多种可能的字段名
|
||||
const getValue = (fieldNames: string[]): string => {
|
||||
for (const fieldName of fieldNames) {
|
||||
if (row[fieldName] !== undefined && row[fieldName] !== null && row[fieldName] !== '') {
|
||||
return String(row[fieldName]).trim();
|
||||
}
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
const productName = getValue(['商品', '商品名称', 'productName']);
|
||||
const orderNumber = getValue(['订单号', '订单编号', 'orderNumber']);
|
||||
const orderStatusName = getValue(['订单状态', 'orderStatus', '状态']);
|
||||
const quantityStr = getValue(['商品数量(件)', '商品数量', '数量', 'quantity']);
|
||||
const productId = getValue(['商品id', '商品ID', 'productId', '商品编码']);
|
||||
const productSpecName = getValue(['商品规格', '规格', 'spec', 'productSpec']);
|
||||
const specCode = getValue(['商家编码-规格维度', '规格编码', 'specCode']);
|
||||
// 店铺名称应该从文件名获取,这里不设置shopName
|
||||
const afterSaleStatus = getValue(['售后状态', '售后', 'afterSale']);
|
||||
const shopActualAmountStr = getValue(['商家实收金额(元)', '店铺实际收入(元)', '店铺实际收入', '收入', 'amount']);
|
||||
|
||||
// 验证必填字段 - 只验证最核心的字段
|
||||
if (!productName) {
|
||||
throw new Error('商品名称不能为空');
|
||||
}
|
||||
if (!orderNumber) {
|
||||
throw new Error('订单编号不能为空');
|
||||
}
|
||||
|
||||
// 其他字段可以为空,在后续处理中处理
|
||||
|
||||
// 解析数量 - 允许为0或空
|
||||
const quantity = parseFloat(quantityStr) || 0;
|
||||
|
||||
// 解析金额 - 允许为0或空
|
||||
const shopActualAmount = parseFloat(shopActualAmountStr) || 0;
|
||||
|
||||
return {
|
||||
productName,
|
||||
orderNumber,
|
||||
orderStatusName,
|
||||
quantity,
|
||||
productId,
|
||||
productSpecName,
|
||||
specCode,
|
||||
shopName: '', // 店铺名称将从文件名获取
|
||||
afterSaleStatus,
|
||||
shopActualAmount,
|
||||
};
|
||||
} catch (error) {
|
||||
throw new Error(`第${rowNumber}行数据验证失败: ${error instanceof Error ? error.message : '未知错误'}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从文件名提取店铺名称
|
||||
*/
|
||||
export function extractShopNameFromFilename(filename: string): string {
|
||||
// 移除文件扩展名,整个文件名就是店铺名称
|
||||
return filename.replace(/\.(csv|CSV)$/, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为EntityMatchingService需要的格式
|
||||
*/
|
||||
export function convertToCSVOrderData(parsedData: ParsedOrderData[], shopName: string): any[] {
|
||||
return parsedData.map(row => ({
|
||||
productName: row.productName,
|
||||
orderNumber: row.orderNumber,
|
||||
orderStatusName: row.orderStatusName,
|
||||
quantity: row.quantity,
|
||||
productId: row.productId,
|
||||
productSpecName: row.productSpecName,
|
||||
specCode: row.specCode,
|
||||
shopName: shopName, // 使用从文件名提取的店铺名称
|
||||
afterSaleStatus: row.afterSaleStatus,
|
||||
shopActualAmount: row.shopActualAmount
|
||||
}));
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
<script lang="ts" setup>
|
||||
import { Card, Image, Tag, Button, Space, Popconfirm, Tooltip } from 'ant-design-vue';
|
||||
import { createIconifyIcon } from '@vben/icons';
|
||||
import type { ProductVO } from '#/api/ecommerce';
|
||||
|
||||
// 创建图标组件
|
||||
const EditIcon = createIconifyIcon('lucide:edit');
|
||||
const TrashIcon = createIconifyIcon('lucide:trash-2');
|
||||
const SettingsIcon = createIconifyIcon('lucide:settings');
|
||||
const EyeIcon = createIconifyIcon('lucide:eye');
|
||||
|
||||
interface Props {
|
||||
product: ProductVO.ProductInfoVO;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'edit', product: ProductVO.ProductInfoVO): void;
|
||||
(e: 'delete', product: ProductVO.ProductInfoVO): void;
|
||||
(e: 'manage-specs', product: ProductVO.ProductInfoVO): void;
|
||||
(e: 'view-details', product: ProductVO.ProductInfoVO): void;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
const handleEdit = (product: ProductVO.ProductInfoVO) => {
|
||||
emit('edit', product);
|
||||
};
|
||||
|
||||
const handleDelete = (product: ProductVO.ProductInfoVO) => {
|
||||
emit('delete', product);
|
||||
};
|
||||
|
||||
const handleManageSpecs = (product: ProductVO.ProductInfoVO) => {
|
||||
emit('manage-specs', product);
|
||||
};
|
||||
|
||||
const handleViewDetails = (product: ProductVO.ProductInfoVO) => {
|
||||
emit('view-details', product);
|
||||
};
|
||||
|
||||
const handleImageError = (event: Event) => {
|
||||
const img = event.target as HTMLImageElement;
|
||||
img.style.display = 'none';
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card
|
||||
hoverable
|
||||
:body-style="{ padding: '12px' }"
|
||||
class="product-card"
|
||||
>
|
||||
<div class="relative">
|
||||
<!-- 商品图片 -->
|
||||
<div class="aspect-square bg-gray-100 rounded-lg overflow-hidden">
|
||||
<Image
|
||||
v-if="product.mainImage"
|
||||
:src="product.mainImage"
|
||||
:alt="product.name"
|
||||
class="w-full h-full object-cover"
|
||||
:preview="true"
|
||||
@error="handleImageError"
|
||||
/>
|
||||
<div v-else class="w-full h-full flex items-center justify-center text-gray-400">
|
||||
<div class="text-center">
|
||||
<div class="text-4xl mb-2">📦</div>
|
||||
<div class="text-sm">暂无图片</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 规格数量标签 -->
|
||||
<div v-if="product.specs && product.specs.length > 0" class="absolute top-2 left-2">
|
||||
<Tag color="blue">
|
||||
{{ product.specs.length }} 个规格
|
||||
</Tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 商品信息 -->
|
||||
<div class="mt-3">
|
||||
<div class="text-sm font-medium text-gray-900 mb-2 line-clamp-2" :title="product.name">
|
||||
{{ product.name }}
|
||||
</div>
|
||||
|
||||
<!-- 规格信息 -->
|
||||
<div v-if="product.specs && product.specs.length > 0" class="mb-2">
|
||||
<div class="text-xs text-gray-500 mb-1">规格信息:</div>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
v-for="spec in product.specs.slice(0, 2)"
|
||||
:key="spec.id"
|
||||
class="text-xs bg-gray-50 px-2 py-1 rounded"
|
||||
>
|
||||
<span class="font-medium">{{ spec.name }}</span>
|
||||
<span class="text-red-500 ml-1">¥{{ spec.costPrice.toFixed(2) }}</span>
|
||||
</div>
|
||||
<div v-if="product.specs.length > 2" class="text-xs text-gray-400">
|
||||
还有 {{ product.specs.length - 2 }} 个规格...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 创建时间 -->
|
||||
<div class="text-xs text-gray-500 mb-3">
|
||||
{{ product.createTime }}
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="flex justify-between items-center">
|
||||
<Space size="small">
|
||||
<Tooltip title="编辑">
|
||||
<Button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleEdit(product)"
|
||||
>
|
||||
<EditIcon class="w-4 h-4" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title="管理规格">
|
||||
<Button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleManageSpecs(product)"
|
||||
>
|
||||
<SettingsIcon class="w-4 h-4" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title="查看详情">
|
||||
<Button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleViewDetails(product)"
|
||||
>
|
||||
<EyeIcon class="w-4 h-4" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Space>
|
||||
<Popconfirm
|
||||
title="确定要删除这个商品吗?"
|
||||
@confirm="handleDelete(product)"
|
||||
>
|
||||
<Button
|
||||
type="text"
|
||||
size="small"
|
||||
danger
|
||||
>
|
||||
<TrashIcon class="w-4 h-4" />
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.product-card {
|
||||
transition: all 0.3s ease;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.product-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.line-clamp-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
+419
@@ -0,0 +1,419 @@
|
||||
<template>
|
||||
<Modal
|
||||
:open="visible"
|
||||
:title="modalTitle"
|
||||
width="600px"
|
||||
:confirm-loading="loading"
|
||||
@ok="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="商品主图" name="mainImageId">
|
||||
<div style="display: flex; align-items: center; gap: 16px;">
|
||||
|
||||
<!-- 主图预览区域 -->
|
||||
<div style="position: relative; display: inline-block;">
|
||||
<!-- 有图片时显示图片 -->
|
||||
<img
|
||||
v-if="currentImageUrl && !imageLoadError"
|
||||
:src="currentImageUrl"
|
||||
alt="商品主图"
|
||||
style="width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid #d9d9d9; background-color: #f5f5f5;"
|
||||
@error="handleImageError"
|
||||
/>
|
||||
<!-- 无图片或加载失败时显示空状态 -->
|
||||
<div
|
||||
v-else
|
||||
style="width: 80px; height: 80px; border: 1px dashed #d9d9d9; border-radius: 8px; background-color: #fafafa; display: flex; align-items: center; justify-content: center; color: #999; font-size: 12px; text-align: center; line-height: 1.2;">
|
||||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
<CameraIcon style="font-size: 16px; margin-bottom: 4px;" />
|
||||
<div>上传主图</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 点击更换遮罩 -->
|
||||
<div
|
||||
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); border-radius: 8px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; cursor: pointer;"
|
||||
@mouseenter="($event.target as HTMLElement).style.opacity = '1'"
|
||||
@mouseleave="($event.target as HTMLElement).style.opacity = '0'"
|
||||
@click="selectImageFile">
|
||||
<div style="color: white; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
<CameraIcon style="font-size: 16px; margin-bottom: 4px;" />
|
||||
<div style="font-size: 12px;">{{ currentImageUrl && !imageLoadError ? '更换主图' : '上传主图' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 重置按钮 -->
|
||||
<div v-if="newImageFile">
|
||||
<Button size="small" @click="removeNewImage">重置</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="商品名称" name="name" :rules="[{ required: true, message: '请输入商品名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入商品名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item v-if="isEdit" label="商品编码" name="specCode">
|
||||
<Input v-model:value="formData.specCode" placeholder="请输入商品编码" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item v-if="isEdit" label="商品SKU" name="skuCode">
|
||||
<Input v-model:value="formData.skuCode" placeholder="请输入商品SKU" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item v-if="isEdit" label="成本价" name="costPrice" :rules="[{ required: true, message: '请输入成本价' }]">
|
||||
<InputNumber
|
||||
v-model:value="formData.costPrice"
|
||||
placeholder="请输入成本价"
|
||||
style="width: 100%;"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<!-- 规格管理 -->
|
||||
<Form.Item v-if="!isEdit" label="商品规格">
|
||||
<div class="space-y-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<Button
|
||||
type="dashed"
|
||||
@click="showSpecs = !showSpecs"
|
||||
:icon="showSpecs ? 'up' : 'down'"
|
||||
>
|
||||
{{ showSpecs ? '收起规格' : '添加规格' }}
|
||||
</Button>
|
||||
<span class="text-sm text-gray-500">
|
||||
可以添加多个规格,每个规格包含名称、编码和成本价
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div v-if="showSpecs" class="border border-gray-200 rounded-lg p-4 bg-gray-50">
|
||||
<div class="space-y-3">
|
||||
<div
|
||||
v-for="(spec, index) in specs"
|
||||
:key="index"
|
||||
class="flex items-center gap-2 p-3 bg-white rounded border"
|
||||
>
|
||||
<Input
|
||||
v-model:value="spec.name"
|
||||
placeholder="规格名称"
|
||||
style="flex: 1;"
|
||||
/>
|
||||
<Input
|
||||
v-model:value="spec.specCode"
|
||||
placeholder="规格编码"
|
||||
style="flex: 1;"
|
||||
/>
|
||||
<InputNumber
|
||||
v-model:value="spec.costPrice"
|
||||
placeholder="成本价"
|
||||
style="width: 120px;"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
/>
|
||||
<Button
|
||||
type="text"
|
||||
danger
|
||||
@click="removeSpec(index)"
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="dashed"
|
||||
@click="addSpec"
|
||||
style="width: 100%;"
|
||||
>
|
||||
+ 添加规格
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, onUnmounted } from 'vue';
|
||||
import { Form, Input, Modal, InputNumber, Button, message } from 'ant-design-vue';
|
||||
import { createIconifyIcon } from '@vben/icons';
|
||||
import {
|
||||
createProductApi,
|
||||
updateProductApi,
|
||||
createProductWithSpecsApi,
|
||||
type ProductVO,
|
||||
type ProductDTO
|
||||
} from '#/api/ecommerce';
|
||||
import { uploadImageApi } from '#/api/media';
|
||||
|
||||
interface Emits {
|
||||
(e: 'success'): void;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 创建相机图标组件
|
||||
const CameraIcon = createIconifyIcon('mdi:camera');
|
||||
|
||||
// 内部状态管理
|
||||
const visible = ref(false);
|
||||
const isEdit = ref(false);
|
||||
const currentProductData = ref<ProductVO.ProductInfoVO | Partial<ProductVO.ProductInfoVO> | null>(null);
|
||||
|
||||
// 响应式数据
|
||||
const formRef = ref();
|
||||
const loading = ref(false);
|
||||
const newImageFile = ref<File | null>(null); // 新选择的图片文件
|
||||
const originalImageUrl = ref(''); // 原始图片 URL
|
||||
const imageLoadError = ref(false); // 图片加载错误状态
|
||||
|
||||
// 表单数据
|
||||
const formData = ref({
|
||||
name: '',
|
||||
specCode: '',
|
||||
skuCode: '',
|
||||
mainImageId: undefined as number | undefined,
|
||||
costPrice: 0,
|
||||
});
|
||||
|
||||
// 规格数据
|
||||
const specs = ref<ProductDTO.ProductSpecDTO[]>([]);
|
||||
const showSpecs = ref(false);
|
||||
|
||||
// 模态框标题
|
||||
const modalTitle = computed(() => isEdit.value ? '编辑商品' : '添加商品');
|
||||
|
||||
// 当前显示的图片 URL(优先显示新选择的)
|
||||
const currentImageUrl = computed(() => {
|
||||
if (newImageFile.value) {
|
||||
return URL.createObjectURL(newImageFile.value);
|
||||
}
|
||||
return originalImageUrl.value;
|
||||
});
|
||||
|
||||
// 初始化表单数据
|
||||
function initFormData() {
|
||||
if (isEdit.value && currentProductData.value) {
|
||||
// 编辑模式
|
||||
formData.value = {
|
||||
name: currentProductData.value.name || '',
|
||||
specCode: '',
|
||||
skuCode: '',
|
||||
mainImageId: undefined,
|
||||
costPrice: 0,
|
||||
};
|
||||
|
||||
// 设置原始图片 URL
|
||||
originalImageUrl.value = currentProductData.value.mainImage || '';
|
||||
} else {
|
||||
// 创建模式 - 如果有传入的productData,则使用它来初始化表单
|
||||
formData.value = {
|
||||
name: currentProductData.value?.name || '',
|
||||
specCode: '',
|
||||
skuCode: '',
|
||||
mainImageId: undefined,
|
||||
costPrice: 0,
|
||||
};
|
||||
originalImageUrl.value = currentProductData.value?.mainImage || '';
|
||||
}
|
||||
|
||||
// 重置新选择的图片和图片加载状态
|
||||
newImageFile.value = null;
|
||||
imageLoadError.value = false;
|
||||
|
||||
// 重置规格数据
|
||||
specs.value = [];
|
||||
showSpecs.value = false;
|
||||
|
||||
// 如果有传入的规格信息,则自动填入
|
||||
if (!isEdit.value && currentProductData.value && 'specs' in currentProductData.value && currentProductData.value.specs) {
|
||||
specs.value = currentProductData.value.specs.map(spec => ({
|
||||
name: (spec as any).specName || spec.specCode || '',
|
||||
specCode: spec.specCode || '',
|
||||
costPrice: spec.costPrice || 0
|
||||
}));
|
||||
showSpecs.value = specs.value.length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 重置表单(在open方法中调用)
|
||||
function resetForm() {
|
||||
formRef.value?.resetFields();
|
||||
newImageFile.value = null;
|
||||
originalImageUrl.value = '';
|
||||
imageLoadError.value = false;
|
||||
specs.value = [];
|
||||
showSpecs.value = false;
|
||||
}
|
||||
|
||||
// 处理提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
loading.value = true;
|
||||
|
||||
// 准备提交数据
|
||||
const submitData = { ...formData.value };
|
||||
|
||||
// 如果有新选择的图片,先上传获取ID
|
||||
if (newImageFile.value) {
|
||||
const mainImageId = await uploadImageAndGetId();
|
||||
if (mainImageId) {
|
||||
submitData.mainImageId = mainImageId;
|
||||
}
|
||||
} else if (!isEdit.value) {
|
||||
// 创建模式且没有选择图片,移除mainImageId字段
|
||||
delete submitData.mainImageId;
|
||||
}
|
||||
|
||||
// 调用API
|
||||
if (isEdit.value && currentProductData.value && 'id' in currentProductData.value && currentProductData.value.id) {
|
||||
await updateProductApi(currentProductData.value.id, submitData as ProductDTO.UpdateProductDTO);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
// 创建模式:如果有规格,使用一键创建接口
|
||||
if (specs.value.length > 0) {
|
||||
const createWithSpecsData: ProductDTO.CreateProductWithSpecsDTO = {
|
||||
name: submitData.name,
|
||||
mainImageId: submitData.mainImageId,
|
||||
specs: specs.value,
|
||||
};
|
||||
await createProductWithSpecsApi(createWithSpecsData);
|
||||
message.success('商品和规格创建成功');
|
||||
} else {
|
||||
await createProductApi(submitData as ProductDTO.CreateProductDTO);
|
||||
message.success('创建成功');
|
||||
}
|
||||
}
|
||||
|
||||
visible.value = false;
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('保存商品失败:', error);
|
||||
message.error('保存商品失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理取消
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 暴露给父组件的方法
|
||||
function open(editMode: boolean = false, productData?: ProductVO.ProductInfoVO | Partial<ProductVO.ProductInfoVO> | null) {
|
||||
isEdit.value = editMode;
|
||||
currentProductData.value = productData || null;
|
||||
|
||||
resetForm(); // 先重置表单
|
||||
initFormData(); // 再初始化数据
|
||||
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
|
||||
// 选择图片文件
|
||||
function selectImageFile() {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = 'image/*';
|
||||
input.style.display = 'none';
|
||||
document.body.appendChild(input);
|
||||
|
||||
input.onchange = (e) => {
|
||||
const file = (e.target as HTMLInputElement).files?.[0];
|
||||
if (file) {
|
||||
// 验证文件
|
||||
const isImage = file.type.startsWith('image/');
|
||||
if (!isImage) {
|
||||
message.error('只能上传图片文件');
|
||||
document.body.removeChild(input);
|
||||
return;
|
||||
}
|
||||
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
message.error('图片大小不能超过 2MB');
|
||||
document.body.removeChild(input);
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置新选择的文件
|
||||
newImageFile.value = file;
|
||||
imageLoadError.value = false; // 重置图片加载错误状态
|
||||
message.success('图片选择成功');
|
||||
}
|
||||
|
||||
document.body.removeChild(input);
|
||||
};
|
||||
|
||||
input.click();
|
||||
}
|
||||
|
||||
// 重置新选择的图片
|
||||
function removeNewImage() {
|
||||
newImageFile.value = null;
|
||||
imageLoadError.value = false; // 重置图片加载错误状态
|
||||
message.success('已重置图片');
|
||||
}
|
||||
|
||||
// 添加规格
|
||||
function addSpec() {
|
||||
specs.value.push({
|
||||
name: '',
|
||||
specCode: '',
|
||||
costPrice: 0,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除规格
|
||||
function removeSpec(index: number) {
|
||||
specs.value.splice(index, 1);
|
||||
}
|
||||
|
||||
// 上传图片并获取图片ID
|
||||
async function uploadImageAndGetId(): Promise<number | undefined> {
|
||||
if (!newImageFile.value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await uploadImageApi(newImageFile.value);
|
||||
console.log('图片上传成功:', response);
|
||||
return response.id;
|
||||
} catch (error) {
|
||||
console.error('图片上传失败:', error);
|
||||
message.error('图片上传失败');
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// 图片加载错误处理
|
||||
function handleImageError(event: Event) {
|
||||
console.error('图片加载失败:', event);
|
||||
imageLoadError.value = true;
|
||||
message.error('图片加载失败,请重新选择');
|
||||
}
|
||||
|
||||
// 组件卸载时清理
|
||||
onUnmounted(() => {
|
||||
if (newImageFile.value) {
|
||||
const url = URL.createObjectURL(newImageFile.value);
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
+322
@@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<Modal
|
||||
:open="visible"
|
||||
:title="modalTitle"
|
||||
width="800px"
|
||||
:confirm-loading="loading"
|
||||
@ok="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<div class="space-y-4">
|
||||
<!-- 商品信息 -->
|
||||
<div class="bg-gray-50 p-4 rounded-lg">
|
||||
<h3 class="font-medium text-gray-900 mb-2">商品信息</h3>
|
||||
<div class="grid grid-cols-2 gap-4 text-sm">
|
||||
<div>
|
||||
<span class="text-gray-500">商品名称:</span>
|
||||
<span class="ml-2 font-medium">{{ currentProduct?.name }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-gray-500">商品ID:</span>
|
||||
<span class="ml-2 font-medium">{{ currentProduct?.id }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 规格列表 -->
|
||||
<div>
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="font-medium text-gray-900">商品规格</h3>
|
||||
<Button type="primary" @click="handleAddSpec">
|
||||
添加规格
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Table
|
||||
:columns="columns"
|
||||
:data-source="specList"
|
||||
:loading="specLoading"
|
||||
:pagination="{
|
||||
current: specCurrent,
|
||||
pageSize: specPageSize,
|
||||
total: specTotal,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
showTotal: (total, range) => `第 ${range[0]}-${range[1]} 条/共 ${total} 条`,
|
||||
}"
|
||||
row-key="id"
|
||||
@change="handleSpecTableChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<!-- 规格表单模态框 -->
|
||||
<Modal
|
||||
:open="specFormVisible"
|
||||
:title="specFormTitle"
|
||||
width="500px"
|
||||
:confirm-loading="specFormLoading"
|
||||
@ok="handleSpecSubmit"
|
||||
@cancel="handleSpecCancel"
|
||||
>
|
||||
<Form
|
||||
ref="specFormRef"
|
||||
:model="specFormData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="规格名称" name="name" :rules="[{ required: true, message: '请输入规格名称' }]">
|
||||
<Input v-model:value="specFormData.name" placeholder="请输入规格名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="规格编码" name="specCode">
|
||||
<Input v-model:value="specFormData.specCode" placeholder="请输入规格编码" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="成本价" name="costPrice" :rules="[{ required: true, message: '请输入成本价' }]">
|
||||
<InputNumber
|
||||
v-model:value="specFormData.costPrice"
|
||||
placeholder="请输入成本价"
|
||||
style="width: 100%;"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, h } from 'vue';
|
||||
import { Form, Input, Modal, InputNumber, Button, Table, message } from 'ant-design-vue';
|
||||
import {
|
||||
getProductSpecPageApi,
|
||||
createProductSpecApi,
|
||||
updateProductSpecApi,
|
||||
deleteProductSpecApi,
|
||||
type ProductVO,
|
||||
type ProductDTO
|
||||
} from '#/api/ecommerce';
|
||||
import type { PageQueryDTO } from '#/types/common';
|
||||
|
||||
interface Emits {
|
||||
(e: 'success'): void;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 内部状态管理
|
||||
const visible = ref(false);
|
||||
const currentProduct = ref<ProductVO.ProductInfoVO | null>(null);
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const specLoading = ref(false);
|
||||
const specList = ref<ProductVO.ProductSpecInfoVO[]>([]);
|
||||
const specTotal = ref(0);
|
||||
const specCurrent = ref(1);
|
||||
const specPageSize = ref(10);
|
||||
|
||||
// 规格表单相关
|
||||
const specFormVisible = ref(false);
|
||||
const specFormLoading = ref(false);
|
||||
const specFormRef = ref();
|
||||
const isEditSpec = ref(false);
|
||||
const currentSpecId = ref<number | null>(null);
|
||||
|
||||
const specFormData = ref({
|
||||
name: '',
|
||||
specCode: '',
|
||||
costPrice: 0,
|
||||
});
|
||||
|
||||
// 模态框标题
|
||||
const modalTitle = computed(() =>
|
||||
currentProduct.value ? `管理规格 - ${currentProduct.value.name}` : '管理规格'
|
||||
);
|
||||
|
||||
// 规格表单标题
|
||||
const specFormTitle = computed(() => isEditSpec.value ? '编辑规格' : '添加规格');
|
||||
|
||||
// 表格列配置
|
||||
const columns = [
|
||||
{
|
||||
title: '规格名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '规格编码',
|
||||
dataIndex: 'specCode',
|
||||
key: 'specCode',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '成本价',
|
||||
dataIndex: 'costPrice',
|
||||
key: 'costPrice',
|
||||
width: 120,
|
||||
customRender: ({ record }: { record: ProductVO.ProductSpecInfoVO }) => {
|
||||
return `¥${record.costPrice.toFixed(2)}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 150,
|
||||
fixed: 'right' as const,
|
||||
customRender: ({ record }: { record: ProductVO.ProductSpecInfoVO }) => {
|
||||
return h('div', { style: 'display: flex; gap: 8px;' }, [
|
||||
h(Button, {
|
||||
size: 'small',
|
||||
onClick: () => handleEditSpec(record),
|
||||
}, { default: () => '编辑' }),
|
||||
h(Button, {
|
||||
size: 'small',
|
||||
danger: true,
|
||||
onClick: () => handleDeleteSpec(record),
|
||||
}, { default: () => '删除' }),
|
||||
]);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
// 获取规格列表
|
||||
async function fetchSpecList() {
|
||||
if (!currentProduct.value) return;
|
||||
|
||||
try {
|
||||
specLoading.value = true;
|
||||
const params: PageQueryDTO<ProductDTO.ProductSpecFilterDTO> = {
|
||||
page: specCurrent.value,
|
||||
pageSize: specPageSize.value,
|
||||
filters: {
|
||||
productId: currentProduct.value.id,
|
||||
},
|
||||
};
|
||||
const data = await getProductSpecPageApi(params);
|
||||
specList.value = data.records;
|
||||
specTotal.value = data.total;
|
||||
} catch (error) {
|
||||
console.error('获取规格列表失败:', error);
|
||||
message.error('获取规格列表失败');
|
||||
} finally {
|
||||
specLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理规格表格变化
|
||||
function handleSpecTableChange(pagination: any) {
|
||||
specCurrent.value = pagination.current;
|
||||
specPageSize.value = pagination.pageSize;
|
||||
fetchSpecList();
|
||||
}
|
||||
|
||||
// 处理添加规格
|
||||
function handleAddSpec() {
|
||||
isEditSpec.value = false;
|
||||
currentSpecId.value = null;
|
||||
specFormData.value = {
|
||||
name: '',
|
||||
specCode: '',
|
||||
costPrice: 0,
|
||||
};
|
||||
specFormVisible.value = true;
|
||||
}
|
||||
|
||||
// 处理编辑规格
|
||||
function handleEditSpec(record: ProductVO.ProductSpecInfoVO) {
|
||||
isEditSpec.value = true;
|
||||
currentSpecId.value = record.id;
|
||||
specFormData.value = {
|
||||
name: record.name,
|
||||
specCode: record.specCode || '',
|
||||
costPrice: record.costPrice,
|
||||
};
|
||||
specFormVisible.value = true;
|
||||
}
|
||||
|
||||
// 处理删除规格
|
||||
async function handleDeleteSpec(record: ProductVO.ProductSpecInfoVO) {
|
||||
try {
|
||||
await deleteProductSpecApi(record.id);
|
||||
message.success('删除成功');
|
||||
await fetchSpecList();
|
||||
} catch (error) {
|
||||
console.error('删除规格失败:', error);
|
||||
message.error('删除规格失败');
|
||||
}
|
||||
}
|
||||
|
||||
// 处理规格表单提交
|
||||
async function handleSpecSubmit() {
|
||||
try {
|
||||
await specFormRef.value?.validate();
|
||||
specFormLoading.value = true;
|
||||
|
||||
if (isEditSpec.value && currentSpecId.value) {
|
||||
await updateProductSpecApi(currentSpecId.value, specFormData.value as ProductDTO.UpdateProductSpecDTO);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
if (!currentProduct.value) {
|
||||
message.error('商品信息不存在');
|
||||
return;
|
||||
}
|
||||
|
||||
const createData: ProductDTO.CreateProductSpecDTO = {
|
||||
productId: currentProduct.value.id,
|
||||
...specFormData.value,
|
||||
};
|
||||
await createProductSpecApi(createData);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
specFormVisible.value = false;
|
||||
await fetchSpecList();
|
||||
} catch (error) {
|
||||
console.error('保存规格失败:', error);
|
||||
message.error('保存规格失败');
|
||||
} finally {
|
||||
specFormLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理规格表单取消
|
||||
function handleSpecCancel() {
|
||||
specFormVisible.value = false;
|
||||
}
|
||||
|
||||
// 处理提交
|
||||
function handleSubmit() {
|
||||
// 规格管理模态框不需要提交操作
|
||||
handleCancel();
|
||||
}
|
||||
|
||||
// 处理取消
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
emit('success');
|
||||
}
|
||||
|
||||
// 暴露给父组件的方法
|
||||
function open(product: ProductVO.ProductInfoVO) {
|
||||
currentProduct.value = product;
|
||||
specCurrent.value = 1;
|
||||
specPageSize.value = 10;
|
||||
visible.value = true;
|
||||
fetchSpecList();
|
||||
}
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
</script>
|
||||
+219
-205
@@ -1,18 +1,184 @@
|
||||
<template>
|
||||
<Page>
|
||||
<template #title>商品管理</template>
|
||||
|
||||
<!-- 搜索区域 -->
|
||||
<div class="mb-4 p-4 bg-white rounded-lg shadow-sm">
|
||||
<Form :model="searchForm" layout="inline">
|
||||
<Form.Item label="商品名称">
|
||||
<Input
|
||||
v-model:value="searchForm.name"
|
||||
placeholder="请输入商品名称"
|
||||
style="width: 200px"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="商品编码">
|
||||
<Input
|
||||
v-model:value="searchForm.specCode"
|
||||
placeholder="请输入商品编码"
|
||||
style="width: 150px"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="商品SKU">
|
||||
<Input
|
||||
v-model:value="searchForm.skuCode"
|
||||
placeholder="请输入商品SKU"
|
||||
style="width: 150px"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="成本价范围">
|
||||
<div class="flex items-center gap-2">
|
||||
<InputNumber
|
||||
v-model:value="searchForm.minCostPrice"
|
||||
placeholder="最小值"
|
||||
style="width: 100px"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
/>
|
||||
<span class="text-gray-500">-</span>
|
||||
<InputNumber
|
||||
v-model:value="searchForm.maxCostPrice"
|
||||
placeholder="最大值"
|
||||
style="width: 100px"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
/>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Space>
|
||||
<Button type="primary" @click="handleSearch">搜索</Button>
|
||||
<Button @click="handleReset">重置</Button>
|
||||
</Space>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
<!-- 操作区域 -->
|
||||
<div class="mb-4 flex justify-between items-center">
|
||||
<div class="flex items-center gap-4">
|
||||
<Button type="primary" @click="handleAdd">
|
||||
<PlusIcon class="w-4 h-4 mr-2" />
|
||||
添加商品
|
||||
</Button>
|
||||
<span class="text-gray-500">支持商品和规格的一键创建</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<Button
|
||||
:type="viewMode === 'grid' ? 'primary' : 'default'"
|
||||
@click="toggleViewMode"
|
||||
>
|
||||
<GridIcon class="w-4 h-4 mr-2" />
|
||||
网格视图
|
||||
</Button>
|
||||
<Button
|
||||
:type="viewMode === 'table' ? 'primary' : 'default'"
|
||||
@click="toggleViewMode"
|
||||
>
|
||||
<ListIcon class="w-4 h-4 mr-2" />
|
||||
列表视图
|
||||
</Button>
|
||||
<span class="text-gray-500">
|
||||
共 {{ total }} 个商品
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 列表视图 -->
|
||||
<div v-if="viewMode === 'table'" class="bg-white rounded-lg shadow-sm">
|
||||
<Table
|
||||
:columns="columns"
|
||||
:data-source="productList"
|
||||
:loading="loading"
|
||||
:pagination="{
|
||||
current: current,
|
||||
pageSize: pageSize,
|
||||
total: total,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
showTotal: (total, range) => `第 ${range[0]}-${range[1]} 条/共 ${total} 条`,
|
||||
}"
|
||||
row-key="id"
|
||||
@change="handleTableChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 网格视图 -->
|
||||
<div v-if="viewMode === 'grid'" class="bg-white rounded-lg shadow-sm p-4">
|
||||
<Row :gutter="[16, 16]">
|
||||
<Col
|
||||
v-for="product in productList"
|
||||
:key="product.id"
|
||||
:xs="12"
|
||||
:sm="8"
|
||||
:md="6"
|
||||
:lg="4"
|
||||
:xl="3"
|
||||
>
|
||||
<ProductCard
|
||||
:product="product"
|
||||
@edit="handleEdit"
|
||||
@delete="handleDelete"
|
||||
@manage-specs="handleManageSpecs"
|
||||
@view-details="handleViewDetails"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="mt-4 flex justify-center">
|
||||
<Pagination
|
||||
v-model:current="current"
|
||||
v-model:page-size="pageSize"
|
||||
:total="total"
|
||||
:show-size-changer="true"
|
||||
:show-quick-jumper="true"
|
||||
:show-total="(total, range) => `第 ${range[0]}-${range[1]} 条/共 ${total} 条`"
|
||||
@change="handleTableChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 商品表单模态框 -->
|
||||
<ProductFormModal
|
||||
ref="productFormModalRef"
|
||||
@success="handleModalSuccess"
|
||||
/>
|
||||
|
||||
<!-- 商品规格管理模态框 -->
|
||||
<ProductSpecModal
|
||||
ref="productSpecModalRef"
|
||||
@success="handleSpecModalSuccess"
|
||||
/>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h, ref } from 'vue';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { Button, Form, Input, InputNumber, Modal, Table, message } from 'ant-design-vue';
|
||||
import { Button, Input, InputNumber, Table, message, Row, Col, Pagination, Form, Space, Tag } from 'ant-design-vue';
|
||||
import { createIconifyIcon } from '@vben/icons';
|
||||
|
||||
import {
|
||||
createProductApi,
|
||||
deleteProductApi,
|
||||
getProductPageApi,
|
||||
updateProductApi,
|
||||
type ProductVO,
|
||||
type ProductDTO
|
||||
} from '#/api/ecommerce';
|
||||
import type { PageQueryDTO } from '#/types/common';
|
||||
import ProductFormModal from './components/ProductFormModal.vue';
|
||||
// @ts-ignore
|
||||
import ProductSpecModal from './components/ProductSpecModal.vue';
|
||||
import ProductCard from './components/ProductCard.vue';
|
||||
|
||||
// 创建图标组件
|
||||
const GridIcon = createIconifyIcon('lucide:grid-3x3');
|
||||
const ListIcon = createIconifyIcon('lucide:list');
|
||||
const PlusIcon = createIconifyIcon('lucide:plus');
|
||||
|
||||
defineOptions({ name: 'ProductManagement' });
|
||||
|
||||
@@ -22,11 +188,9 @@ const productList = ref<ProductVO.ProductInfoVO[]>([]);
|
||||
const total = ref(0);
|
||||
const current = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const modalVisible = ref(false);
|
||||
const modalTitle = ref('');
|
||||
const isEdit = ref(false);
|
||||
const currentProductId = ref<number | null>(null);
|
||||
const formRef = ref();
|
||||
const viewMode = ref<'table' | 'grid'>('grid');
|
||||
const productFormModalRef = ref();
|
||||
const productSpecModalRef = ref();
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = ref({
|
||||
@@ -37,15 +201,6 @@ const searchForm = ref({
|
||||
maxCostPrice: undefined as number | undefined,
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = ref<ProductDTO.CreateProductDTO>({
|
||||
name: '',
|
||||
specCode: '',
|
||||
skuCode: '',
|
||||
mainImage: '',
|
||||
costPrice: 0,
|
||||
});
|
||||
|
||||
// 表格列配置
|
||||
const columns = [
|
||||
{
|
||||
@@ -54,18 +209,6 @@ const columns = [
|
||||
key: 'name',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '商品编码',
|
||||
dataIndex: 'specCode',
|
||||
key: 'specCode',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '商品SKU',
|
||||
dataIndex: 'skuCode',
|
||||
key: 'skuCode',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '主图',
|
||||
dataIndex: 'mainImage',
|
||||
@@ -83,12 +226,13 @@ const columns = [
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '成本价',
|
||||
dataIndex: 'costPrice',
|
||||
key: 'costPrice',
|
||||
width: 120,
|
||||
title: '规格数量',
|
||||
dataIndex: 'specs',
|
||||
key: 'specs',
|
||||
width: 100,
|
||||
customRender: ({ record }: { record: ProductVO.ProductInfoVO }) => {
|
||||
return h('span', { style: { color: '#f50' } }, `¥${record.costPrice.toFixed(2)}`);
|
||||
const specCount = record.specs?.length || 0;
|
||||
return h(Tag, { color: specCount > 0 ? 'blue' : 'default' }, () => `${specCount} 个规格`);
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -114,6 +258,10 @@ const columns = [
|
||||
size: 'small',
|
||||
onClick: () => handleEdit(record),
|
||||
}, { default: () => '编辑' }),
|
||||
h(Button, {
|
||||
size: 'small',
|
||||
onClick: () => handleManageSpecs(record),
|
||||
}, { default: () => '规格' }),
|
||||
h(Button, {
|
||||
size: 'small',
|
||||
danger: true,
|
||||
@@ -176,34 +324,19 @@ function handleTableChange(pagination: any) {
|
||||
fetchProductList();
|
||||
}
|
||||
|
||||
// 切换视图模式
|
||||
function toggleViewMode() {
|
||||
viewMode.value = viewMode.value === 'table' ? 'grid' : 'table';
|
||||
}
|
||||
|
||||
// 处理添加商品
|
||||
function handleAdd() {
|
||||
modalTitle.value = '添加商品';
|
||||
isEdit.value = false;
|
||||
currentProductId.value = null;
|
||||
formData.value = {
|
||||
name: '',
|
||||
specCode: '',
|
||||
skuCode: '',
|
||||
mainImage: '',
|
||||
costPrice: 0,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
productFormModalRef.value?.open(false);
|
||||
}
|
||||
|
||||
// 处理编辑商品
|
||||
function handleEdit(record: ProductVO.ProductInfoVO) {
|
||||
modalTitle.value = '编辑商品';
|
||||
isEdit.value = true;
|
||||
currentProductId.value = record.id;
|
||||
formData.value = {
|
||||
name: record.name,
|
||||
specCode: record.specCode || '',
|
||||
skuCode: record.skuCode || '',
|
||||
mainImage: record.mainImage || '',
|
||||
costPrice: record.costPrice,
|
||||
};
|
||||
modalVisible.value = true;
|
||||
productFormModalRef.value?.open(true, record);
|
||||
}
|
||||
|
||||
// 处理删除商品
|
||||
@@ -218,158 +351,39 @@ async function handleDelete(record: ProductVO.ProductInfoVO) {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理表单提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
|
||||
if (isEdit.value && currentProductId.value) {
|
||||
await updateProductApi(currentProductId.value, formData.value);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createProductApi(formData.value);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
modalVisible.value = false;
|
||||
await fetchProductList();
|
||||
} catch (error) {
|
||||
console.error('保存商品失败:', error);
|
||||
message.error('保存商品失败');
|
||||
}
|
||||
// 处理管理规格
|
||||
function handleManageSpecs(record: ProductVO.ProductInfoVO) {
|
||||
productSpecModalRef.value?.open(record);
|
||||
}
|
||||
|
||||
// 处理查看详情
|
||||
function handleViewDetails() {
|
||||
// TODO: 实现查看详情功能
|
||||
message.info('查看详情功能待实现');
|
||||
}
|
||||
|
||||
// 处理模态框成功
|
||||
function handleModalSuccess() {
|
||||
fetchProductList();
|
||||
}
|
||||
|
||||
// 处理规格模态框成功
|
||||
function handleSpecModalSuccess() {
|
||||
// 规格管理成功后可能需要刷新商品列表
|
||||
fetchProductList();
|
||||
}
|
||||
|
||||
|
||||
// 初始化
|
||||
fetchProductList();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page title="商品管理">
|
||||
<template #description>
|
||||
<div class="text-foreground/80 mt-2">
|
||||
管理商品信息,包括商品基本信息、编码、SKU和价格设置
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #extra>
|
||||
<Button type="primary" @click="handleAdd">
|
||||
添加商品
|
||||
</Button>
|
||||
</template>
|
||||
|
||||
<!-- 搜索表单 -->
|
||||
<div class="mb-4 p-4 bg-gray-50 rounded-lg">
|
||||
<div style="display: flex; gap: 16px; align-items: center; flex-wrap: wrap;">
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">商品名称</label>
|
||||
<Input
|
||||
v-model:value="searchForm.name"
|
||||
placeholder="请输入商品名称"
|
||||
style="width: 200px;"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">商品编码</label>
|
||||
<Input
|
||||
v-model:value="searchForm.specCode"
|
||||
placeholder="请输入商品编码"
|
||||
style="width: 150px;"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">商品SKU</label>
|
||||
<Input
|
||||
v-model:value="searchForm.skuCode"
|
||||
placeholder="请输入商品SKU"
|
||||
style="width: 150px;"
|
||||
@press-enter="handleSearch"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 4px; font-weight: 500;">成本价范围</label>
|
||||
<div style="display: flex; gap: 8px; align-items: center;">
|
||||
<InputNumber
|
||||
v-model:value="searchForm.minCostPrice"
|
||||
placeholder="最小值"
|
||||
style="width: 100px;"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
/>
|
||||
<span>-</span>
|
||||
<InputNumber
|
||||
v-model:value="searchForm.maxCostPrice"
|
||||
placeholder="最大值"
|
||||
style="width: 100px;"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 8px; align-items: end;">
|
||||
<Button type="primary" @click="handleSearch">搜索</Button>
|
||||
<Button @click="handleReset">重置</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<Table
|
||||
:columns="columns"
|
||||
:data-source="productList"
|
||||
:loading="loading"
|
||||
:pagination="{
|
||||
current: current,
|
||||
pageSize: pageSize,
|
||||
total: total,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
showTotal: (total, range) => `第 ${range[0]}-${range[1]} 条/共 ${total} 条`,
|
||||
}"
|
||||
row-key="id"
|
||||
@change="handleTableChange"
|
||||
/>
|
||||
|
||||
<!-- 添加/编辑模态框 -->
|
||||
<Modal
|
||||
v-model:open="modalVisible"
|
||||
:title="modalTitle"
|
||||
width="600px"
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="商品名称" name="name" :rules="[{ required: true, message: '请输入商品名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入商品名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="商品编码" name="specCode">
|
||||
<Input v-model:value="formData.specCode" placeholder="请输入商品编码" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="商品SKU" name="skuCode">
|
||||
<Input v-model:value="formData.skuCode" placeholder="请输入商品SKU" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="主图URL" name="mainImage">
|
||||
<Input v-model:value="formData.mainImage" placeholder="请输入主图URL" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="成本价" name="costPrice" :rules="[{ required: true, message: '请输入成本价' }]">
|
||||
<InputNumber
|
||||
v-model:value="formData.costPrice"
|
||||
placeholder="请输入成本价"
|
||||
style="width: 100%;"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</Page>
|
||||
</template>
|
||||
<style scoped>
|
||||
.line-clamp-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
+305
@@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<Modal
|
||||
:open="visible"
|
||||
:title="modalTitle"
|
||||
width="600px"
|
||||
:confirm-loading="loading"
|
||||
@ok="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="店铺Logo" name="logoImageId">
|
||||
<div style="display: flex; align-items: center; gap: 16px;">
|
||||
|
||||
<!-- Logo预览区域 -->
|
||||
<div style="position: relative; display: inline-block;">
|
||||
<!-- 有图片时显示图片 -->
|
||||
<img
|
||||
v-if="currentLogoUrl && !imageLoadError"
|
||||
:src="currentLogoUrl"
|
||||
alt="店铺Logo"
|
||||
style="width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid #d9d9d9; background-color: #f5f5f5;"
|
||||
@error="handleImageError"
|
||||
/>
|
||||
<!-- 无图片或加载失败时显示空状态 -->
|
||||
<div
|
||||
v-else
|
||||
style="width: 80px; height: 80px; border: 1px dashed #d9d9d9; border-radius: 8px; background-color: #fafafa; display: flex; align-items: center; justify-content: center; color: #999; font-size: 12px; text-align: center; line-height: 1.2;">
|
||||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
<CameraIcon style="font-size: 16px; margin-bottom: 4px;" />
|
||||
<div>上传Logo</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 点击更换遮罩 -->
|
||||
<div
|
||||
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); border-radius: 8px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; cursor: pointer;"
|
||||
@mouseenter="($event.target as HTMLElement).style.opacity = '1'"
|
||||
@mouseleave="($event.target as HTMLElement).style.opacity = '0'"
|
||||
@click="selectLogoFile">
|
||||
<div style="color: white; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
<CameraIcon style="font-size: 16px; margin-bottom: 4px;" />
|
||||
<div style="font-size: 12px;">{{ currentLogoUrl && !imageLoadError ? '更换Logo' : '上传Logo' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 重置按钮 -->
|
||||
<div v-if="newLogoFile">
|
||||
<Button size="small" @click="removeNewLogo">重置</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="店铺名称" name="name" :rules="[{ required: true, message: '请输入店铺名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入店铺名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="平台" name="platform">
|
||||
<Select
|
||||
v-model:value="formData.platform"
|
||||
placeholder="请选择平台"
|
||||
:options="platformOptions"
|
||||
allow-clear
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, onUnmounted } from 'vue';
|
||||
import { Form, Input, Modal, Select, Button, message } from 'ant-design-vue';
|
||||
import { createIconifyIcon } from '@vben/icons';
|
||||
import {
|
||||
uploadShopLogoApi,
|
||||
createShopApi,
|
||||
updateShopApi,
|
||||
type ShopVO,
|
||||
type ShopDTO
|
||||
} from '#/api/ecommerce';
|
||||
|
||||
interface Emits {
|
||||
(e: 'success'): void;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 创建相机图标组件
|
||||
const CameraIcon = createIconifyIcon('mdi:camera');
|
||||
|
||||
// 内部状态管理
|
||||
const visible = ref(false);
|
||||
const isEdit = ref(false);
|
||||
const currentShopData = ref<ShopVO.ShopInfoVO | Partial<ShopVO.ShopInfoVO> | null>(null);
|
||||
|
||||
// 响应式数据
|
||||
const formRef = ref();
|
||||
const loading = ref(false);
|
||||
const newLogoFile = ref<File | null>(null); // 新选择的logo文件
|
||||
const originalLogoUrl = ref(''); // 原始logo URL
|
||||
const imageLoadError = ref(false); // 图片加载错误状态
|
||||
|
||||
// 表单数据
|
||||
const formData = ref({
|
||||
name: '',
|
||||
platform: '',
|
||||
logoImageId: undefined as number | undefined,
|
||||
});
|
||||
|
||||
// 平台选项
|
||||
const platformOptions = [
|
||||
{ label: '淘宝', value: '淘宝' },
|
||||
{ label: '京东', value: '京东' },
|
||||
{ label: '拼多多', value: '拼多多' },
|
||||
{ label: '天猫', value: '天猫' },
|
||||
];
|
||||
|
||||
// 模态框标题
|
||||
const modalTitle = computed(() => isEdit.value ? '编辑店铺' : '添加店铺');
|
||||
|
||||
// 当前显示的logo URL(优先显示新选择的)
|
||||
const currentLogoUrl = computed(() => {
|
||||
if (newLogoFile.value) {
|
||||
return URL.createObjectURL(newLogoFile.value);
|
||||
}
|
||||
return originalLogoUrl.value;
|
||||
});
|
||||
|
||||
// 初始化表单数据
|
||||
function initFormData() {
|
||||
if (isEdit.value && currentShopData.value) {
|
||||
// 编辑模式
|
||||
formData.value = {
|
||||
name: currentShopData.value.name || '',
|
||||
platform: currentShopData.value.platform || '',
|
||||
logoImageId: undefined,
|
||||
};
|
||||
|
||||
// 设置原始Logo URL
|
||||
originalLogoUrl.value = currentShopData.value.logo || '';
|
||||
} else {
|
||||
// 创建模式 - 如果有传入的shopData,则使用它来初始化表单
|
||||
formData.value = {
|
||||
name: currentShopData.value?.name || '',
|
||||
platform: currentShopData.value?.platform || '',
|
||||
logoImageId: undefined,
|
||||
};
|
||||
originalLogoUrl.value = currentShopData.value?.logo || '';
|
||||
}
|
||||
|
||||
// 重置新选择的logo和图片加载状态
|
||||
newLogoFile.value = null;
|
||||
imageLoadError.value = false;
|
||||
}
|
||||
|
||||
// 重置表单(在open方法中调用)
|
||||
function resetForm() {
|
||||
formRef.value?.resetFields();
|
||||
newLogoFile.value = null;
|
||||
originalLogoUrl.value = '';
|
||||
imageLoadError.value = false;
|
||||
}
|
||||
|
||||
// 处理提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
loading.value = true;
|
||||
|
||||
// 准备提交数据
|
||||
const submitData = { ...formData.value };
|
||||
|
||||
// 如果有新选择的logo,先上传获取ID
|
||||
if (newLogoFile.value) {
|
||||
const logoImageId = await uploadLogoAndGetId();
|
||||
if (logoImageId) {
|
||||
submitData.logoImageId = logoImageId;
|
||||
}
|
||||
} else if (!isEdit.value) {
|
||||
// 创建模式且没有选择Logo,移除logoImageId字段
|
||||
delete submitData.logoImageId;
|
||||
}
|
||||
|
||||
// 调用API
|
||||
if (isEdit.value && currentShopData.value && 'id' in currentShopData.value && currentShopData.value.id) {
|
||||
await updateShopApi(currentShopData.value.id, submitData as ShopDTO.UpdateShopDTO);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createShopApi(submitData as ShopDTO.CreateShopDTO);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
visible.value = false;
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('保存店铺失败:', error);
|
||||
message.error('保存店铺失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理取消
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 暴露给父组件的方法
|
||||
function open(editMode: boolean = false, shopData?: ShopVO.ShopInfoVO | Partial<ShopVO.ShopInfoVO> | null) {
|
||||
isEdit.value = editMode;
|
||||
currentShopData.value = shopData || null;
|
||||
|
||||
resetForm(); // 先重置表单
|
||||
initFormData(); // 再初始化数据
|
||||
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
|
||||
// 选择logo文件
|
||||
function selectLogoFile() {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = 'image/*';
|
||||
input.style.display = 'none';
|
||||
document.body.appendChild(input);
|
||||
|
||||
input.onchange = (e) => {
|
||||
const file = (e.target as HTMLInputElement).files?.[0];
|
||||
if (file) {
|
||||
// 验证文件
|
||||
const isImage = file.type.startsWith('image/');
|
||||
if (!isImage) {
|
||||
message.error('只能上传图片文件');
|
||||
document.body.removeChild(input);
|
||||
return;
|
||||
}
|
||||
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
message.error('图片大小不能超过 2MB');
|
||||
document.body.removeChild(input);
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置新选择的文件
|
||||
newLogoFile.value = file;
|
||||
imageLoadError.value = false; // 重置图片加载错误状态
|
||||
message.success('Logo选择成功');
|
||||
}
|
||||
|
||||
document.body.removeChild(input);
|
||||
};
|
||||
|
||||
input.click();
|
||||
}
|
||||
|
||||
// 重置新选择的logo
|
||||
function removeNewLogo() {
|
||||
newLogoFile.value = null;
|
||||
imageLoadError.value = false; // 重置图片加载错误状态
|
||||
message.success('已重置logo');
|
||||
}
|
||||
|
||||
// 上传Logo并获取图片ID
|
||||
async function uploadLogoAndGetId(): Promise<number | undefined> {
|
||||
if (!newLogoFile.value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await uploadShopLogoApi(newLogoFile.value);
|
||||
console.log('Logo上传成功:', response);
|
||||
return response.id;
|
||||
} catch (error) {
|
||||
console.error('Logo上传失败:', error);
|
||||
message.error('Logo上传失败');
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// 图片加载错误处理
|
||||
function handleImageError(event: Event) {
|
||||
console.error('图片加载失败:', event);
|
||||
imageLoadError.value = true;
|
||||
message.error('图片加载失败,请重新选择');
|
||||
}
|
||||
|
||||
// 组件卸载时清理
|
||||
onUnmounted(() => {
|
||||
if (newLogoFile.value) {
|
||||
const url = URL.createObjectURL(newLogoFile.value);
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -2,7 +2,7 @@
|
||||
import { h, ref } from 'vue';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { Button, Form, Input, Modal, Select, Table, message } from 'ant-design-vue';
|
||||
import { Button, Input, Select, Table, message } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
createShopApi,
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
type ShopDTO
|
||||
} from '#/api/ecommerce';
|
||||
import type { PageQueryDTO } from '#/types/common';
|
||||
import ShopFormModal from './components/ShopFormModal.vue';
|
||||
|
||||
defineOptions({ name: 'ShopManagement' });
|
||||
|
||||
@@ -22,11 +23,7 @@ const shopList = ref<ShopVO.ShopInfoVO[]>([]);
|
||||
const total = ref(0);
|
||||
const current = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const modalVisible = ref(false);
|
||||
const modalTitle = ref('');
|
||||
const isEdit = ref(false);
|
||||
const currentShopId = ref<number | null>(null);
|
||||
const formRef = ref();
|
||||
const shopFormModalRef = ref();
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = ref({
|
||||
@@ -34,12 +31,7 @@ const searchForm = ref({
|
||||
platform: undefined as string | undefined,
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = ref<ShopDTO.CreateShopDTO>({
|
||||
name: '',
|
||||
logo: '',
|
||||
platform: '',
|
||||
});
|
||||
// 表单数据(已移至ShopFormModal组件)
|
||||
|
||||
// 平台选项
|
||||
const platformOptions = [
|
||||
@@ -160,28 +152,12 @@ function handleTableChange(pagination: any) {
|
||||
|
||||
// 处理添加店铺
|
||||
function handleAdd() {
|
||||
modalTitle.value = '添加店铺';
|
||||
isEdit.value = false;
|
||||
currentShopId.value = null;
|
||||
formData.value = {
|
||||
name: '',
|
||||
logo: '',
|
||||
platform: '',
|
||||
};
|
||||
modalVisible.value = true;
|
||||
shopFormModalRef.value?.open(false);
|
||||
}
|
||||
|
||||
// 处理编辑店铺
|
||||
function handleEdit(record: ShopVO.ShopInfoVO) {
|
||||
modalTitle.value = '编辑店铺';
|
||||
isEdit.value = true;
|
||||
currentShopId.value = record.id;
|
||||
formData.value = {
|
||||
name: record.name,
|
||||
logo: record.logo || '',
|
||||
platform: record.platform || '',
|
||||
};
|
||||
modalVisible.value = true;
|
||||
shopFormModalRef.value?.open(true, record);
|
||||
}
|
||||
|
||||
// 处理删除店铺
|
||||
@@ -196,25 +172,9 @@ async function handleDelete(record: ShopVO.ShopInfoVO) {
|
||||
}
|
||||
}
|
||||
|
||||
// 处理表单提交
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
|
||||
if (isEdit.value && currentShopId.value) {
|
||||
await updateShopApi(currentShopId.value, formData.value);
|
||||
message.success('更新成功');
|
||||
} else {
|
||||
await createShopApi(formData.value);
|
||||
message.success('创建成功');
|
||||
}
|
||||
|
||||
modalVisible.value = false;
|
||||
await fetchShopList();
|
||||
} catch (error) {
|
||||
console.error('保存店铺失败:', error);
|
||||
message.error('保存店铺失败');
|
||||
}
|
||||
// 处理模态框成功
|
||||
function handleModalSuccess() {
|
||||
fetchShopList();
|
||||
}
|
||||
|
||||
// 初始化
|
||||
@@ -281,36 +241,10 @@ fetchShopList();
|
||||
@change="handleTableChange"
|
||||
/>
|
||||
|
||||
<!-- 添加/编辑模态框 -->
|
||||
<Modal
|
||||
v-model:open="modalVisible"
|
||||
:title="modalTitle"
|
||||
width="600px"
|
||||
@ok="handleSubmit"
|
||||
>
|
||||
<Form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:label-col="{ span: 6 }"
|
||||
:wrapper-col="{ span: 18 }"
|
||||
>
|
||||
<Form.Item label="店铺名称" name="name" :rules="[{ required: true, message: '请输入店铺名称' }]">
|
||||
<Input v-model:value="formData.name" placeholder="请输入店铺名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="平台" name="platform">
|
||||
<Select
|
||||
v-model:value="formData.platform"
|
||||
placeholder="请选择平台"
|
||||
:options="platformOptions"
|
||||
allow-clear
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="Logo URL" name="logo">
|
||||
<Input v-model:value="formData.logo" placeholder="请输入Logo URL" />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
<!-- 店铺表单模态框 -->
|
||||
<ShopFormModal
|
||||
ref="shopFormModalRef"
|
||||
@success="handleModalSuccess"
|
||||
/>
|
||||
</Page>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
商品,订单编号,订单状态,商品数量(件),商品id,商品规格,店铺名称-店铺二维码,售后状态,店铺实际收入(元)
|
||||
威露士消毒液,250909-020557402512836,已发货待确认收货,4,776809698859,威露士消毒液-500ml装,创意家居,无售后,119.6
|
||||
威露士消毒液,250909-327860887132793,已发货待确认收货,2,776809698859,威露士消毒液-500ml装,创意家居,无售后,59.8
|
||||
威露士消毒液,250909-191231444621615,已发货待确认收货,1,776809698859,威露士消毒液-500ml装,创意家居,无售后,29.9
|
||||
|
@@ -0,0 +1,58 @@
|
||||
商品,订单号,订单状态,商品数量(件),商品id,商品规格,商家编码-规格维度,售后状态,商家实收金额(元)
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-020557402512836,已发货,待收货,"4 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,119.6
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-327860887132793,已发货,待收货,"2 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,59.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-191231444621615,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-032718200552900,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-263614635552343,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-142768873170631,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-630812905850513,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-419317685990247,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-274813427271655,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-003864072623620,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-540430866002738,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-065580572260452,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-247597657700311,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-645718423931113,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-017461429890914,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-571298311900778,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-278174133791638,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-630954443193163,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-049482351010760,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-339466001941552,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-251160236453630,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-353469754901552,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-527821771171956,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-137164296573058,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-637916956172581,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-647464251000050,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-603329676893861,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-409201579543689,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-374944570940057,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-261981478611311,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-076441208393837,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-307127938560182,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-456675857981095,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-130128289351297,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-569471189370198,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-578819202561596,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-089915430552824,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,退款成功,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-343817654712968,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-631777554003451,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-285569205930995,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-081060217202353,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-018607061430640,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-526524096160724,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆精选】家用多用途衣物消毒除螨除菌液玩具内衣裤洗衣消毒水,250909-620885450263895,已发货,待收货,"1 ","809507961075 ","【远离细菌螨虫困扰/专业级消毒防护】,1大瓶【整整2斤】99.99%消毒抑味",SLJ0031,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-205342687673192,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-278963177031461,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-598527209040569,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-519488151111080,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆精选】家用多用途衣物消毒除螨除菌液玩具内衣裤洗衣消毒水,250909-420924628702930,已发货,待收货,"1 ","809507961075 ","【远离细菌螨虫困扰/专业级消毒防护】,1大瓶【整整2斤】99.99%消毒抑味",SLJ0031,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-564909862493868,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-479639703941185,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-364736756152968,已取消,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【商超爆款】多效净柔洗衣液持久留香抑菌除螨去污渍母婴学生家用,250909-524403381981816,已发货,待收货,"1 ","804654320839 ","花香四溢*留香持久*洁净无忧,到手4斤【天然洁净因子丨去黄亮白】",SLJ008,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-566314933990350,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,退款成功,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-507521329583297,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-185212608060224,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,无售后或售后取消,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-450138028441003,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,无售后或售后取消,6.8
|
||||
|
@@ -0,0 +1,4 @@
|
||||
商品,订单号,订单状态,商品数量(件),商品id,商品规格,商家编码-规格维度,售后状态,商家实收金额(元)
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-047002457780454,已发货,待收货,1,776809698859,【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力,SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-166938549771506,已发货,待收货,1,776809698859,【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力,SLJ123,无售后或售后取消,29.9
|
||||
【爆香除臭】香氛洗衣消毒液衣物杀菌留香植源温和消毒水公共环境【9月15日发完】,250913-341248633251447,未发货,退款成功,1,806892003345,全新香氛体验【48h满屋西柚味/好闻不刺激】,99.99%有效杀菌丨消菌杀毒【到手2瓶】,YQ395,退款成功,32.8
|
||||
|
@@ -0,0 +1,67 @@
|
||||
商品,订单号,订单状态,商品数量(件),商品id,商品规格,商家编码-规格维度,售后状态,商家实收金额(元)
|
||||
【爆香除臭】香氛洗衣消毒液衣物杀菌留香植源温和消毒水公共环境【9月15日发完】,250913-341248633251447,未发货,退款成功,1 ,806892003345 ,"全新香氛体验【48h满屋西柚味/好闻不刺激】,99.99%有效杀菌丨消菌杀毒【到手2瓶】",YQ395,退款成功,32.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-047002457780454,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-166938549771506,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-660309317292288,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-490613020261331,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-535083128492119,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-158513314222867,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-345442957741789,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-210312896053523,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-452423851741368,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-238016294471227,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-273426737542889,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-370933767721210,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-205672967682686,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-114284326532203,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-088651886263610,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-579338278453221,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-597688348190510,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,8斤(洁净混搭)除螨香氛*1+多重净柔*1",YQ300,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-557873907411936,未发货,退款成功,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-481888868062366,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-317770974810077,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-043647004301820,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-284310914690683,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-502792230522573,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-223011182220640,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-243626207641784,已发货,待收货,2 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,66.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-541447984842074,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆精选】家用多用途衣物消毒除螨除菌液玩具内衣裤洗衣消毒水,250913-487189419601851,已发货,待收货,1 ,809507961075 ,"【远离细菌螨虫困扰/专业级消毒防护】,2大瓶【整整4斤】99.99%杀菌灭螨",YQ091,无售后或售后取消,30.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-084819351052049,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-005940201152572,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-360757368370964,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,无售后或售后取消,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-534239046020853,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-626807283371164,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-369109307821785,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-408703475231077,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-624841223751990,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-193913188063125,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-472729556512780,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-656214597323415,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,无售后或售后取消,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-675330147981125,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-026550004153850,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-464445827490703,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-174105618872317,未发货,退款成功,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,退款成功,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-601337392720784,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-067135106740029,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-455920894320788,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-335083016633762,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-205122496892331,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-011681144540767,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-644412946830672,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-599041001112702,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-490277465693136,已取消,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,8斤(洁净混搭)除螨香氛*1+多重净柔*1",YQ300,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-020358121142947,未发货,退款成功,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-121058106951769,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-026591915680950,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-506011328082993,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-163226621621851,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-513665943192835,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-609862347144051,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-000445673052184,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-103494489790137,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-351021361563188,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-679042127533783,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-451747582361772,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-604278627982354,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250913-171515594390525,已发货,待收货,1 ,776809698859 ,"【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
|
@@ -0,0 +1,58 @@
|
||||
商品,订单号,订单状态,商品数量(件),商品id,商品规格,商家编码-规格维度,售后状态,商家实收金额(元)
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-020557402512836,已发货,待收货,"4 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,119.6
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-327860887132793,已发货,待收货,"2 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,59.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-191231444621615,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-032718200552900,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-263614635552343,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-142768873170631,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-630812905850513,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-419317685990247,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-274813427271655,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-003864072623620,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-540430866002738,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-065580572260452,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-247597657700311,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-645718423931113,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-017461429890914,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-571298311900778,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-278174133791638,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-630954443193163,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-049482351010760,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-339466001941552,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-251160236453630,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-353469754901552,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-527821771171956,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-137164296573058,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-637916956172581,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-647464251000050,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-603329676893861,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-409201579543689,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-374944570940057,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-261981478611311,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-076441208393837,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-307127938560182,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-456675857981095,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-130128289351297,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-569471189370198,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-578819202561596,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-089915430552824,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,退款成功,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-343817654712968,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-631777554003451,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-285569205930995,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-081060217202353,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-018607061430640,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-526524096160724,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆精选】家用多用途衣物消毒除螨除菌液玩具内衣裤洗衣消毒水,250909-620885450263895,已发货,待收货,"1 ","809507961075 ","【远离细菌螨虫困扰/专业级消毒防护】,1大瓶【整整2斤】99.99%消毒抑味",SLJ0031,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-205342687673192,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-278963177031461,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-598527209040569,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-519488151111080,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆精选】家用多用途衣物消毒除螨除菌液玩具内衣裤洗衣消毒水,250909-420924628702930,已发货,待收货,"1 ","809507961075 ","【远离细菌螨虫困扰/专业级消毒防护】,1大瓶【整整2斤】99.99%消毒抑味",SLJ0031,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-564909862493868,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-479639703941185,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,4斤(初次品尝)多效净柔洗衣液*1",SLJ0039,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-364736756152968,已取消,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,无售后或售后取消,29.9
|
||||
【商超爆款】多效净柔洗衣液持久留香抑菌除螨去污渍母婴学生家用,250909-524403381981816,已发货,待收货,"1 ","804654320839 ","花香四溢*留香持久*洁净无忧,到手4斤【天然洁净因子丨去黄亮白】",SLJ008,无售后或售后取消,18.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-566314933990350,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,退款成功,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-507521329583297,未发货,退款成功,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,10斤(小店爆款)洁净护色丨8倍洁净力",SLJ123,退款成功,29.9
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-185212608060224,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,无售后或售后取消,6.8
|
||||
【山姆特惠选】花香洗衣液持久留香深层洁净去污去渍除螨抑菌大桶,250909-450138028441003,已发货,待收货,"1 ","776809698859 ","【72小时留香丨强效去渍丨99.99除菌】,1斤(新客体验)试样补充液",SLJ0054,无售后或售后取消,6.8
|
||||
|
@@ -1,72 +0,0 @@
|
||||
商品,订单号,订单状态,商品数量(件),商品id,商品规格,售后状态,商家实收金额(元)
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-427708925610575,待发货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,超值推荐【10斤/1大桶】加量不加价",无售后或售后取消,29.9
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-275702147461177,待发货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,日用套装【4斤/1瓶】植萃护衣",无售后或售后取消,18.8
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-419461895710461,待发货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,单人套装【9斤/2件套】洁净抑菌",无售后或售后取消,29.9
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-181319790151824,待发货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,日用套装【4斤/1瓶】植萃护衣",无售后或售后取消,18.8
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-529069514462938,待发货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,袋袋体验【500g*1斤装】先试后囤",无售后或售后取消,6.8
|
||||
【山姆特惠选】洗衣液持久留香抑菌去污渍深层洁净学生母婴家用装,250908-287288870500093,待发货,1 ,791577788174 ,【差旅便携】500g/1小袋,无售后或售后取消,6.8
|
||||
【山姆特惠选】洗衣液持久留香抑菌去污渍深层洁净学生母婴家用装,250908-244748152533198,待发货,1 ,791577788174 ,推荐【加量不加价】10斤/1大桶,无售后或售后取消,29.9
|
||||
【官方正品】冰箱厨电清洁剂厨房烤箱微波炉锅底强力除臭清洗神器,250908-361244925540370,待发货,1 ,703756505366 ,"20倍消臭+安全无毒+消毒抑菌,3瓶+喷头【重度污渍推荐】限量优惠",无售后或售后取消,31.9
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-622980043121994,待发货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,日用套装【4斤/1瓶】植萃护衣",无售后或售后取消,18.8
|
||||
【商超惠购】栀子花香洗衣液深层洁净污渍高效抑菌除螨低泡易漂洗,250908-103971591912636,待发货,1 ,810241992329 ,"【升级配方】易溶解易漂洗无残留,热销爆款【10斤大桶装】",无售后或售后取消,29.9
|
||||
【母婴适用】洗衣液香味持久强效除污渍抑菌除螨洁净家庭装大容量,250908-426770491780102,待发货,1 ,796923055655 ,"x8倍洁净*净柔抑菌*温和亲肤,8斤丨1瓶1袋【升级洁净因子】",无售后或售后取消,29.9
|
||||
【母婴适用】洗衣液香味持久强效除污渍抑菌除螨洁净家庭装大容量,250908-383144435202973,未发货,退款成功,1 ,796923055655 ,"x8倍洁净*净柔抑菌*温和亲肤,推荐丨10斤丨超大桶【93%家庭选择】",退款成功,29.9
|
||||
【商超惠购】栀子花香洗衣液深层洁净污渍高效抑菌除螨低泡易漂洗,250908-158015168031913,待发货,1 ,810241992329 ,"【升级配方】易溶解易漂洗无残留,热销爆款【10斤大桶装】",无售后或售后取消,29.9
|
||||
【母婴适用】洗衣液香味持久强效除污渍抑菌除螨洁净家庭装大容量,250908-322783178380654,待发货,1 ,796923055655 ,"x8倍洁净*净柔抑菌*温和亲肤,推荐丨10斤丨超大桶【93%家庭选择】",无售后或售后取消,29.9
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-100783890103132,待发货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级深层洁净】特惠桶:10斤",无售后或售后取消,29.9
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-539057231390199,待发货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级深层洁净】特惠桶:10斤",无售后或售后取消,29.9
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-383652994771256,待发货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,日用套装【4斤/1瓶】植萃护衣",无售后或售后取消,18.8
|
||||
【商超惠购】栀子花香洗衣液深层洁净污渍高效抑菌除螨低泡易漂洗,250908-661630523101982,已发货,待收货,1 ,810241992329 ,"【升级配方】易溶解易漂洗无残留,日用优享【4斤装】",无售后或售后取消,18.8
|
||||
【山姆特惠选】洗衣液持久留香抑菌去污渍深层洁净学生母婴家用装,250908-568600850010625,已发货,待收货,1 ,791577788174 ,【x8倍净柔抑菌】8斤/2件套,无售后或售后取消,29.9
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-478884729233348,已发货,待收货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,日用套装【4斤/1瓶】植萃护衣",无售后或售后取消,18.8
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-590767736390080,已发货,待收货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级去污去渍】双拼组:8斤",无售后或售后取消,29.9
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-247170352710080,已发货,待收货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级深层洁净】特惠桶:10斤",无售后或售后取消,29.9
|
||||
【商超同源】衣物除菌液洗衣服仰菌去异味洗裤子衣物除菌率99.9%,250908-615954583932546,待发货,2 ,770186328515 ,"母婴安心用丨松木萃取,1000ml*2桶【买一送一】",无售后或售后取消,61.6
|
||||
香氛衣物消毒除菌液温和植源杀菌灭螨三合一公共环境玩具消毒留香,250908-610543921541583,已发货,待收货,1 ,800691802832 ,"99.9%杀真菌+细菌+灭活HPV,衣物香氛除菌液【两斤装/到手1瓶】",无售后或售后取消,20.8
|
||||
【山姆特惠购】香水洗衣液持久留香去污净柔抑菌灭螨家庭装大容量,250908-552683518352807,已发货,待收货,1 ,810986984285 ,"【去渍丨抑菌丨留香】3合1洁净护衣洗衣液,9斤:到手1瓶1袋【7重去污力】",无售后或售后取消,29.9
|
||||
【山姆特惠购】香水洗衣液持久留香去污净柔抑菌灭螨家庭装大容量,250908-293533130430583,已发货,待收货,1 ,810986984285 ,"【去渍丨抑菌丨留香】3合1洁净护衣洗衣液,18斤:到手2瓶2袋【7重净渍力】",无售后或售后取消,59.9
|
||||
【商超同源】衣物除菌液洗衣服仰菌去异味洗裤子衣物除菌率99.9%,250908-671623431831105,已发货,待收货,1 ,770186328515 ,"母婴安心用丨松木萃取,1000ml*2桶【买一送一】",无售后或售后取消,30.8
|
||||
【99.99%除菌】香氛衣物除菌消毒液杀菌除螨留香公共环境宠物玩具,250908-581550743093190,已发货,待收货,1 ,799337212611 ,"专业级杀菌丨消毒除螨丨守护全家健康,家庭常备【2瓶到手四斤】杀菌除螨",无售后或售后取消,32.8
|
||||
【99.99%除菌】香氛衣物除菌消毒液杀菌除螨留香公共环境宠物玩具,250908-131302714902363,已发货,待收货,1 ,799337212611 ,"专业级杀菌丨消毒除螨丨守护全家健康,家庭常备【2瓶到手四斤】杀菌除螨",无售后或售后取消,32.8
|
||||
【山姆特惠选】洗衣液持久留香抑菌去污渍深层洁净学生母婴家用装,250908-377607984800638,已发货,待收货,3 ,791577788174 ,推荐【加量不加价】10斤/1大桶,无售后或售后取消,89.7
|
||||
【山姆特惠选】洗衣液持久留香抑菌去污渍深层洁净学生母婴家用装,250908-469578575520638,已发货,待收货,1 ,791577788174 ,推荐【加量不加价】10斤/1大桶,无售后或售后取消,29.9
|
||||
【商超同源】衣物除菌液洗衣服仰菌去异味洗裤子衣物除菌率99.9%,250908-607371947641440,已发货,待收货,1 ,770186328515 ,"母婴安心用丨松木萃取,1000ml*2桶【买一送一】",无售后或售后取消,30.8
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-141950983860854,已发货,待收货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级抑菌除螨】超量囤:16斤",无售后或售后取消,59.9
|
||||
香氛衣物消毒除菌液温和植源杀菌灭螨三合一公共环境玩具消毒留香,250908-188156485240248,已发货,待收货,1 ,800691802832 ,"99.9%杀真菌+细菌+灭活HPV,衣物香氛除菌液【两斤装/到手1瓶】",无售后或售后取消,20.8
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-356699369131949,已发货,待收货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级深层洁净】特惠桶:10斤",无售后或售后取消,29.9
|
||||
【山姆特惠购】香水洗衣液持久留香去污净柔抑菌灭螨家庭装大容量,250908-686502735383822,已发货,待收货,1 ,810986984285 ,"【去渍丨抑菌丨留香】3合1洁净护衣洗衣液,10斤:到手一大桶【7重抑菌力】",无售后或售后取消,29.9
|
||||
【山姆特惠选】洗衣液持久留香抑菌去污渍深层洁净学生母婴家用装,250908-654856691332706,已发货,待收货,1 ,791577788174 ,推荐【加量不加价】10斤/1大桶,无售后或售后取消,29.9
|
||||
【山姆同源】香氛洗衣液持久留香抑菌去污渍除螨家庭通用大容量装,250908-189341386310748,已发货,待收货,1 ,810980221137 ,"植萃洁净*鲜花洗衣*强效去污,【特惠推荐】超大一桶*10斤丨升级加量",无售后或售后取消,29.9
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-627509839530943,未发货,退款成功,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级深层洁净】特惠桶:10斤",退款成功,29.9
|
||||
【山姆优选】多效净柔洗衣液除螨抑菌深层洁净污渍婴儿大人通用,250908-574368070050000,已发货,待收货,1 ,810259323402 ,"【专研幼儿配方】杀菌率达99.99%,热销爆款【8斤组合装】",无售后或售后取消,29.9
|
||||
【山姆同源】香氛洗衣液持久留香抑菌去污渍除螨家庭通用大容量装,250908-328670942840824,已发货,待收货,1 ,810980221137 ,"植萃洁净*鲜花洗衣*强效去污,【特惠推荐】超大一桶*10斤丨升级加量",无售后或售后取消,29.9
|
||||
【开学必备】洗衣液持久留香净柔抑菌去污除螨学生宿舍家用大容量,250908-180627740220315,已发货,待收货,1 ,808785299487 ,【强抑菌】4斤*1瓶,无售后或售后取消,18.8
|
||||
【商超惠购】栀子花香洗衣液深层洁净污渍高效抑菌除螨低泡易漂洗,250908-501266531893440,已发货,待收货,1 ,810241992329 ,"【升级配方】易溶解易漂洗无残留,日用优享【4斤装】",无售后或售后取消,18.8
|
||||
【官方正品】冰箱厨电清洁剂厨房烤箱微波炉锅底强力除臭清洗神器,250908-256528914083663,已发货,待收货,1 ,703756505366 ,"20倍消臭+安全无毒+消毒抑菌,2瓶+喷头【护守冰箱62天】",无售后或售后取消,22.9
|
||||
【商超惠购】栀子花香洗衣液深层洁净污渍高效抑菌除螨低泡易漂洗,250908-202757926562711,未发货,退款成功,1 ,810241992329 ,"【升级配方】易溶解易漂洗无残留,热销爆款【10斤大桶装】",退款成功,29.9
|
||||
【商超惠购】栀子花香洗衣液深层洁净污渍高效抑菌除螨低泡易漂洗,250908-597919014562711,已发货,待收货,1 ,810241992329 ,"【升级配方】易溶解易漂洗无残留,热销爆款【10斤大桶装】",无售后或售后取消,29.9
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-182242547351885,已发货,待收货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级深层洁净】特惠桶:10斤",无售后或售后取消,29.9
|
||||
【99.99%除菌】香氛衣物除菌消毒液杀菌除螨留香公共环境宠物玩具,250908-372433303943737,已发货,待收货,1 ,799337212611 ,"专业级杀菌丨消毒除螨丨守护全家健康,家庭常备【2瓶到手四斤】杀菌除螨",无售后或售后取消,32.8
|
||||
【母婴适用】洗衣液香味持久强效除污渍抑菌除螨洁净家庭装大容量,250908-199350054480624,已发货,待收货,1 ,796923055655 ,"x8倍洁净*净柔抑菌*温和亲肤,量大丨16斤丨2瓶2袋【全家够用一年】",无售后或售后取消,59.9
|
||||
【山姆严选】洗衣液持久留香去污渍抑菌除螨母婴学生家庭装大容量,250908-440968158742087,已发货,待收货,1 ,808123522501 ,"温和植萃配方*香氛萦绕*高效洁净,500g*1袋【便携装丨小份量无负担】",无售后或售后取消,6.8
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-620515837482823,已发货,待收货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级深层洁净】特惠桶:10斤",无售后或售后取消,29.9
|
||||
香氛衣物消毒除菌液温和植源杀菌灭螨三合一公共环境玩具消毒留香,250908-341710006671686,已发货,待收货,1 ,800691802832 ,"99.9%杀真菌+细菌+灭活HPV,衣物香氛除菌液【四斤装/到手2瓶】",无售后或售后取消,32.8
|
||||
【商超惠购】栀子花香洗衣液深层洁净污渍高效抑菌除螨低泡易漂洗,250908-648696338132729,已发货,待收货,1 ,810241992329 ,"【升级配方】易溶解易漂洗无残留,体验补充【1斤装】",无售后或售后取消,6.8
|
||||
【母婴适用】洗衣液香味持久强效除污渍抑菌除螨洁净家庭装大容量,250908-449692331681791,已发货,待收货,1 ,796923055655 ,"x8倍洁净*净柔抑菌*温和亲肤,初试丨500g*1袋【新客专享】",无售后或售后取消,6.8
|
||||
香氛衣物消毒除菌液温和植源杀菌灭螨三合一公共环境玩具消毒留香,250908-481133893222372,已发货,待收货,1 ,800691802832 ,"99.9%杀真菌+细菌+灭活HPV,衣物香氛除菌液【两斤装/到手1瓶】",无售后或售后取消,20.8
|
||||
【商超惠购】栀子花香洗衣液深层洁净污渍高效抑菌除螨低泡易漂洗,250908-292458370760620,已发货,待收货,1 ,810241992329 ,"【升级配方】易溶解易漂洗无残留,热销爆款【10斤大桶装】",无售后或售后取消,29.9
|
||||
【商超惠选】洗衣液持久留香去污除螨洁净抑菌母婴学生家庭大容量,250908-670003371661919,已发货,待收货,1 ,810992619613 ,"多巴胺香气丨栀子花爆香丨芳香四溢,【纳米级深层洁净】特惠桶:10斤",无售后或售后取消,29.9
|
||||
【官方正品】冰箱厨电清洁剂厨房烤箱微波炉锅底强力除臭清洗神器,250908-256964084151069,已发货,待收货,1 ,703756505366 ,"20倍消臭+安全无毒+消毒抑菌,2瓶+喷头【护守冰箱62天】",无售后或售后取消,22.9
|
||||
香氛衣物消毒除菌液温和植源杀菌灭螨三合一公共环境玩具消毒留香,250908-220505085523416,已发货,待收货,1 ,800691802832 ,"99.9%杀真菌+细菌+灭活HPV,衣物香氛除菌液【两斤装/到手1瓶】",无售后或售后取消,20.8
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-062872624723144,已发货,待收货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,超值推荐【10斤/1大桶】加量不加价",无售后或售后取消,29.9
|
||||
【山姆同源】香氛洗衣液持久留香抑菌去污渍除螨家庭通用大容量装,250908-358502919881591,已发货,待收货,1 ,810980221137 ,"植萃洁净*鲜花洗衣*强效去污,【特惠推荐】超大一桶*10斤丨升级加量",无售后或售后取消,29.9
|
||||
【山姆同源】香氛洗衣液持久留香抑菌去污渍除螨家庭通用大容量装,250908-666716116480099,已发货,待收货,1 ,810980221137 ,"植萃洁净*鲜花洗衣*强效去污,【特惠推荐】超大一桶*10斤丨升级加量",无售后或售后取消,29.9
|
||||
【山姆同源】香氛洗衣液持久留香抑菌去污渍除螨家庭通用大容量装,250908-147555632682379,已发货,待收货,1 ,810980221137 ,"植萃洁净*鲜花洗衣*强效去污,【特惠推荐】超大一桶*10斤丨升级加量",无售后或售后取消,29.9
|
||||
【99.99%除菌】香氛衣物除菌消毒液杀菌除螨留香公共环境宠物玩具,250908-622036293242338,已发货,待收货,1 ,799337212611 ,"专业级杀菌丨消毒除螨丨守护全家健康,家庭常备【2瓶到手四斤】杀菌除螨",无售后或售后取消,32.8
|
||||
【母婴适用】洗衣液香味持久强效除污渍抑菌除螨洁净家庭装大容量,250908-239762173671450,已发货,待收货,1 ,796923055655 ,"x8倍洁净*净柔抑菌*温和亲肤,初试丨500g*1袋【新客专享】",无售后或售后取消,6.8
|
||||
【山姆同源】香氛洗衣液持久留香抑菌去污渍除螨家庭通用大容量装,250908-555394024960608,已发货,待收货,1 ,810980221137 ,"植萃洁净*鲜花洗衣*强效去污,【不够用】小袋装*500g丨短期日用",无售后或售后取消,6.8
|
||||
【母婴适用】洗衣液香味持久强效除污渍抑菌除螨洁净家庭装大容量,250908-603020336641661,未发货,退款成功,1 ,796923055655 ,"x8倍洁净*净柔抑菌*温和亲肤,推荐丨10斤丨超大桶【93%家庭选择】",退款成功,29.9
|
||||
【山姆同源】香氛洗衣液持久留香抑菌去污渍除螨家庭通用大容量装,250908-134579525252405,已发货,待收货,1 ,810980221137 ,"植萃洁净*鲜花洗衣*强效去污,【特惠推荐】超大一桶*10斤丨升级加量",无售后或售后取消,29.9
|
||||
【山姆特惠购】洗衣液香味持久留香强效洁净抑菌除污学生母婴家用,250908-451747561874041,已发货,待收货,1 ,787611070565 ,"摩擦生香/打造自然伪体香/72h优雅香随,超值推荐【10斤/1大桶】加量不加价",无售后或售后取消,29.9
|
||||
【山姆同源】香氛洗衣液持久留香抑菌去污渍除螨家庭通用大容量装,250908-500537771653665,已发货,待收货,1 ,810980221137 ,"植萃洁净*鲜花洗衣*强效去污,【不够用】小袋装*500g丨短期日用",无售后或售后取消,6.8
|
||||
香氛衣物消毒除菌液温和植源杀菌灭螨三合一公共环境玩具消毒留香,250908-436464555713361,已发货,待收货,1 ,800691802832 ,"99.9%杀真菌+细菌+灭活HPV,衣物香氛除菌液【四斤装/到手2瓶】",无售后或售后取消,32.8
|
||||
|
Reference in New Issue
Block a user