diff --git a/src/api/mall/statistics/devicelog.ts b/src/api/mall/statistics/devicelog.ts new file mode 100644 index 00000000..25b0fb94 --- /dev/null +++ b/src/api/mall/statistics/devicelog.ts @@ -0,0 +1,45 @@ +import request from '@/config/axios' + +// 贩卖机出货日志 VO +export interface DeviceLogVO { + id: number // 日志主键 + userId: number // 用户编号 + orderId: number // 订单号 + orderNo: string // 订单流水号 + deviceId: string // 设备IMEI + deviceStatus: number // 出货状态 + content: string // 内容 +} + +// 贩卖机出货日志 API +export const DeviceLogApi = { + // 查询贩卖机出货日志分页 + getDeviceLogPage: async (params: any) => { + return await request.get({ url: `/trade/device-log/page`, params }) + }, + + // 查询贩卖机出货日志详情 + getDeviceLog: async (id: number) => { + return await request.get({ url: `/trade/device-log/get?id=` + id }) + }, + + // 新增贩卖机出货日志 + createDeviceLog: async (data: DeviceLogVO) => { + return await request.post({ url: `/trade/device-log/create`, data }) + }, + + // 修改贩卖机出货日志 + updateDeviceLog: async (data: DeviceLogVO) => { + return await request.put({ url: `/trade/device-log/update`, data }) + }, + + // 删除贩卖机出货日志 + deleteDeviceLog: async (id: number) => { + return await request.delete({ url: `/trade/device-log/delete?id=` + id }) + }, + + // 导出贩卖机出货日志 Excel + exportDeviceLog: async (params) => { + return await request.download({ url: `/trade/device-log/export-excel`, params }) + } +} diff --git a/src/views/mall/product/summary/index.vue b/src/views/mall/product/summary/index.vue index c02ba89e..ee0fad7c 100644 --- a/src/views/mall/product/summary/index.vue +++ b/src/views/mall/product/summary/index.vue @@ -322,22 +322,22 @@ const fetchAllProducts = async () => { barCode: queryParams.value.barCode } - console.log('获取商品数据,参数:', largePageParams) + // console.log('获取商品数据,参数:', largePageParams) const [mallResponse, containerResponse] = await Promise.all([ ProductSpuApi.getSpuPage({ ...largePageParams, types: 0 }), // 商城商品 ProductSpuApi.getSpuPage({ ...largePageParams, types: 1 }) // 提货柜商品 ]) - console.log('商城商品响应:', mallResponse) - console.log('提货柜商品响应:', containerResponse) + // console.log('商城商品响应:', mallResponse) + // console.log('提货柜商品响应:', containerResponse) return [ ...(mallResponse.list || []).map((product) => ({ ...product, source: 'mall' })), ...(containerResponse.list || []).map((product) => ({ ...product, source: 'container' })) ] } catch (error) { - console.error('获取商品数据失败:', error) + // console.error('获取商品数据失败:', error) throw error } } @@ -347,19 +347,19 @@ const fetchAllProducts = async () => { */ const fetchProductDetails = async (products) => { if (!products || products.length === 0) { - console.log('没有商品数据需要获取详情') + // console.log('没有商品数据需要获取详情') return [] } const spuIds = products.map((item) => item.id).filter(Boolean) if (spuIds.length === 0) { - console.log('没有有效的SPU ID') + // console.log('没有有效的SPU ID') return [] } try { - console.log('获取商品详情,SPU IDs:', spuIds) + // console.log('获取商品详情,SPU IDs:', spuIds) const detailResponse = await ProductSpuApi.getSpuDetailList(spuIds) console.log('商品详情响应:', detailResponse) @@ -368,7 +368,7 @@ const fetchProductDetails = async (products) => { return { ...product, source: originalProduct?.source || 'unknown' } }) } catch (error) { - console.error('获取商品详情失败:', error) + // console.error('获取商品详情失败:', error) throw error } } @@ -377,15 +377,15 @@ const fetchProductDetails = async (products) => { const getList = async () => { loading.value = true try { - console.log('开始获取商品汇总列表,查询参数:', queryParams.value) + // console.log('开始获取商品汇总列表,查询参数:', queryParams.value) // Step 1: 获取所有商品数据 const allProducts = await fetchAllProducts() - console.log('获取到的所有商品数据:', allProducts) + // console.log('获取到的所有商品数据:', allProducts) // Step 2: 获取详细信息 const detailedProducts = await fetchProductDetails(allProducts) - console.log('获取到的详细商品数据:', detailedProducts) + // console.log('获取到的详细商品数据:', detailedProducts) // Step 3: 获取汇总数据(如果需要) let summaryData = [] @@ -418,9 +418,9 @@ const getList = async () => { createTime: summary.createTime }] })) - console.log('转换后的汇总数据:', summaryData) + // console.log('转换后的汇总数据:', summaryData) } catch (summaryError) { - console.warn('获取汇总数据失败,继续处理商品数据:', summaryError) + // console.warn('获取汇总数据失败,继续处理商品数据:', summaryError) } // Step 4: 按barCode分组合并商品 diff --git a/src/views/mall/statistics/devicelog/DeviceLogForm.vue b/src/views/mall/statistics/devicelog/DeviceLogForm.vue new file mode 100644 index 00000000..4204af62 --- /dev/null +++ b/src/views/mall/statistics/devicelog/DeviceLogForm.vue @@ -0,0 +1,124 @@ + + diff --git a/src/views/mall/statistics/devicelog/index.vue b/src/views/mall/statistics/devicelog/index.vue new file mode 100644 index 00000000..028ed6c7 --- /dev/null +++ b/src/views/mall/statistics/devicelog/index.vue @@ -0,0 +1,234 @@ + + + diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index 9407aeac..103a9ff7 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -289,6 +289,7 @@ const getList = async () => { const data = await TradeOrderApi.getOrderPage(unref(queryParams)) list.value = data.list total.value = data.total + console.log("订单列表",data) } finally { loading.value = false } diff --git a/src/views/mall/trade/statistics/index.vue b/src/views/mall/trade/statistics/index.vue index 4512e9e8..e196403b 100644 --- a/src/views/mall/trade/statistics/index.vue +++ b/src/views/mall/trade/statistics/index.vue @@ -71,7 +71,7 @@ - + @@ -79,6 +79,7 @@ {{ scope.row.orderCount }} + { const data = await OrderSalesStatisticsApi.getSalesStatistics(queryParams) list.value = data.list total.value = data.total + console.log("销售订单",data) } finally { loading.value = false }