From 7d0e83c23f5731e71ebe7e183a408603f159b0ca Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Tue, 21 Oct 2025 10:34:17 +0800 Subject: [PATCH 1/9] =?UTF-8?q?feat:=E5=AF=BC=E5=87=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/other.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/other.ts b/src/utils/other.ts index 251f19b..3cd5bd5 100644 --- a/src/utils/other.ts +++ b/src/utils/other.ts @@ -278,9 +278,13 @@ export function postDownBlobFile(url: any, data: any, fileName: string) { descs: data?.descs ?? [], }, data, - }).then((response) => { - handleBlobFile(response, fileName) }) + .then((response) => { + handleBlobFile(response, fileName) + }) + .catch((error) => { + useMessage().error(error.msg || "下载失败") + }) } /** From 6fc521b8bdcf2d42800133e5ca49b6c3c3bc3d0e Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Tue, 21 Oct 2025 16:44:03 +0800 Subject: [PATCH 2/9] =?UTF-8?q?feat:=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictSelect/index.vue | 4 +- src/utils/jsonp.ts | 57 +------- src/views/hard/hard-order/index.vue | 4 + src/views/test-jsonp.vue | 208 ---------------------------- 4 files changed, 14 insertions(+), 259 deletions(-) delete mode 100644 src/views/test-jsonp.vue diff --git a/src/components/DictSelect/index.vue b/src/components/DictSelect/index.vue index 6433532..9711e8a 100644 --- a/src/components/DictSelect/index.vue +++ b/src/components/DictSelect/index.vue @@ -1,6 +1,6 @@ @@ -16,9 +16,11 @@ export type Props = { dictCode: string placeholder?: string hideIds?: string | Array + multiple?: boolean } const props = withDefaults(defineProps(), { placeholder: "请选择", + multiple: false, }) const state = reactive({ diff --git a/src/utils/jsonp.ts b/src/utils/jsonp.ts index bcd3676..d1b6420 100644 --- a/src/utils/jsonp.ts +++ b/src/utils/jsonp.ts @@ -7,7 +7,6 @@ interface JsonpOptions { timeout?: number callbackName?: string callbackParam?: string - debug?: boolean } /** @@ -18,17 +17,11 @@ interface JsonpOptions { */ export function jsonp(url: string, options: JsonpOptions = {}): Promise { const { - timeout = 15000, + timeout = 10000, callbackName = `jsonp_callback_${Date.now()}_${Math.random().toString(36).substr(2)}`, callbackParam = "callback", - debug = false } = options - if (debug) { - console.log('[JSONP] 发起请求:', url) - console.log('[JSONP] 回调函数名:', callbackName) - } - return new Promise((resolve, reject) => { // 创建 script 标签 const script = document.createElement("script") @@ -36,11 +29,7 @@ export function jsonp(url: string, options: JsonpOptions = {}): Promise { // 设置超时 const timer = setTimeout(() => { cleanup() - const error = new Error(`JSONP request timeout after ${timeout}ms`) - if (debug) { - console.error('[JSONP] 请求超时:', error) - } - reject(error) + reject(new Error("JSONP request timeout")) }, timeout) // 清理函数 @@ -56,34 +45,22 @@ export function jsonp(url: string, options: JsonpOptions = {}): Promise { // 设置全局回调函数 ;(window as any)[callbackName] = (data: any) => { - if (debug) { - console.log('[JSONP] 收到响应:', data) - } cleanup() resolve(data) } // 处理错误 - script.onerror = (event) => { + script.onerror = () => { cleanup() - const error = new Error("JSONP request failed to load script") - if (debug) { - console.error('[JSONP] 脚本加载失败:', event) - } - reject(error) + reject(new Error("JSONP request failed")) } // 构建请求 URL const separator = url.includes("?") ? "&" : "?" const requestUrl = `${url}${separator}${callbackParam}=${callbackName}` - if (debug) { - console.log('[JSONP] 完整请求URL:', requestUrl) - } - // 发起请求 script.src = requestUrl - script.async = true document.head.appendChild(script) }) } @@ -93,11 +70,9 @@ export function jsonp(url: string, options: JsonpOptions = {}): Promise { */ export class TencentMapAPI { private apiKey: string - private debug: boolean - constructor(apiKey: string, debug: boolean = false) { + constructor(apiKey: string) { this.apiKey = apiKey - this.debug = debug } /** @@ -109,17 +84,8 @@ export class TencentMapAPI { async reverseGeocode(lat: number, lng: number): Promise { const url = `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=${this.apiKey}&get_poi=1&output=jsonp` - if (this.debug) { - console.log('[TencentMapAPI] 逆地址解析请求:', { lat, lng }) - } - try { - const data = await jsonp(url, { debug: this.debug }) - - if (this.debug) { - console.log('[TencentMapAPI] 逆地址解析响应:', data) - } - + const data = await jsonp(url) return data } catch (error) { console.error("逆地址解析失败:", error) @@ -138,17 +104,8 @@ export class TencentMapAPI { keyword, )}&page_size=10&page_index=1&key=${this.apiKey}&output=jsonp` - if (this.debug) { - console.log('[TencentMapAPI] 地址搜索请求:', { keyword, boundary }) - } - try { - const data = await jsonp(url, { debug: this.debug }) - - if (this.debug) { - console.log('[TencentMapAPI] 地址搜索响应:', data) - } - + const data = await jsonp(url) return data } catch (error) { console.error("地址搜索失败:", error) diff --git a/src/views/hard/hard-order/index.vue b/src/views/hard/hard-order/index.vue index 930c02f..746ce9b 100644 --- a/src/views/hard/hard-order/index.vue +++ b/src/views/hard/hard-order/index.vue @@ -30,6 +30,10 @@ + + + diff --git a/src/views/test-jsonp.vue b/src/views/test-jsonp.vue deleted file mode 100644 index 997254d..0000000 --- a/src/views/test-jsonp.vue +++ /dev/null @@ -1,208 +0,0 @@ - - - - - \ No newline at end of file From dd16169396c983bc3f0bc3502f354342aa07f9b9 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Tue, 21 Oct 2025 16:52:44 +0800 Subject: [PATCH 3/9] =?UTF-8?q?feat:=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/hard/hard-order/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/hard/hard-order/index.vue b/src/views/hard/hard-order/index.vue index 746ce9b..832bf8d 100644 --- a/src/views/hard/hard-order/index.vue +++ b/src/views/hard/hard-order/index.vue @@ -30,8 +30,8 @@ - - + From cf3aabbae1b8ba6d33ec07e8551317f47fbdf32d Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Tue, 21 Oct 2025 20:48:54 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E8=B6=85=E5=B8=82=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../types/inventoryInOutReport.ts | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/api/supermarketerp/types/inventoryInOutReport.ts diff --git a/src/api/supermarketerp/types/inventoryInOutReport.ts b/src/api/supermarketerp/types/inventoryInOutReport.ts new file mode 100644 index 0000000..cb5554e --- /dev/null +++ b/src/api/supermarketerp/types/inventoryInOutReport.ts @@ -0,0 +1,73 @@ +// 进销存报表相关类型定义 + +// 查询参数接口 +export interface InventoryInOutQueryParams { + current?: number // 当前页码 + size?: number // 每页记录数 + startDate?: string // 开始日期 (yyyy-MM-dd) + endDate?: string // 结束日期 (yyyy-MM-dd) + startTime?: string // 开始时间 (yyyy-MM-dd HH:mm:ss) + endTime?: string // 结束时间 (yyyy-MM-dd HH:mm:ss) + productName?: string // 商品名称 + productCode?: string // 商品编码 + categoryId?: number // 分类ID + warehouseId?: string // 仓库ID + onlyChanged?: boolean // 是否仅显示有发生额的商品 + topLimit?: number // 限制返回记录数 +} + +// 进销存报表数据项接口 +export interface InventoryInOutItem { + productId: number // 商品ID + productCode: string // 商品编码 + productName: string // 商品名称 + categoryId: number // 分类ID + categoryName: string // 分类名称 + unit: string // 基础单位 + openingQty: number // 期初库存数量 + inQty: number // 入库数量 + outQty: number // 出库数量 + closingQty: number // 期末库存数量 + inAmount: number // 入库金额 + outAmount: number // 出库金额 +} + +// 分页响应接口 +export interface InventoryInOutPageResponse { + records: InventoryInOutItem[] // 数据列表 + total: number // 总记录数 + size: number // 每页记录数 + current: number // 当前页码 + pages: number // 总页数 +} + +// 汇总统计接口 +export interface InventoryInOutSummary { + totalProducts: number // 统计商品总数 + changedProducts: number // 有发生额的商品数量 + totalOpeningQty: number // 总期初库存数量 + totalInQty: number // 总入库数量 + totalOutQty: number // 总出库数量 + totalClosingQty: number // 总期末库存数量 + totalInAmount: number // 总入库金额 + totalOutAmount: number // 总出库金额 + turnoverRate: number // 库存周转率 + avgPrice: number // 平均单价 +} + +// API响应接口 +export interface ApiResponse { + code: number // 状态码 + msg: string // 消息描述 + data: T // 具体数据 +} + +// 分页查询响应 +export type InventoryInOutPageApiResponse = ApiResponse + +// 列表查询响应 +export type InventoryInOutListApiResponse = ApiResponse + +// 汇总统计响应 +export type InventoryInOutSummaryApiResponse = ApiResponse + From 564a668344e60aab220286252c4c6b5b8a948eec Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Wed, 22 Oct 2025 16:31:44 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/supermarket/mallProduct/form.vue | 28 ++++++++++++++++----- src/views/supermarket/mallProduct/index.vue | 23 ++++++++++------- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/src/views/supermarket/mallProduct/form.vue b/src/views/supermarket/mallProduct/form.vue index 3dd959a..6c0ec6b 100644 --- a/src/views/supermarket/mallProduct/form.vue +++ b/src/views/supermarket/mallProduct/form.vue @@ -30,11 +30,18 @@ - - - - - + + + + + + + + + + + + @@ -69,6 +76,12 @@ 单位:元 + + + + + + @@ -240,6 +253,7 @@ import { tree as fetchCategoryTree } from "/@/api/supermarket/mallCategory" const emit = defineEmits(["refresh"]) // 定义变量内容 +const { supermarket_nature } = useDict("supermarket_nature") const dataFormRef = ref() const visible = ref(false) const loading = ref(false) @@ -272,7 +286,8 @@ const form = reactive({ priceType: 1, // 默认多SKU模式 spuPrice: 0, originalPrice: 0, - unit: "", + totalStock: 0, // SPU模式库存 + productNature: "", status: "0", // 默认上架 saleStartTime: "", saleEndTime: "", @@ -387,6 +402,7 @@ const openDialog = (id: string) => { priceType: 1, spuPrice: 0, originalPrice: 0, + totalStock: 0, unit: "", status: "0", saleStartTime: "", diff --git a/src/views/supermarket/mallProduct/index.vue b/src/views/supermarket/mallProduct/index.vue index 7eaf4c2..6c74632 100644 --- a/src/views/supermarket/mallProduct/index.vue +++ b/src/views/supermarket/mallProduct/index.vue @@ -58,7 +58,7 @@ - + - - - + + + + + - - - - @@ -137,7 +118,7 @@ + - + @@ -73,22 +60,19 @@ - + From 13497eb22d8b8102f27291ef5a20539b48cd1a6c Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Thu, 23 Oct 2025 21:00:38 +0800 Subject: [PATCH 8/9] =?UTF-8?q?feat:=E5=A4=A7=E5=B1=8F=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/panel/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/panel/index.vue b/src/views/panel/index.vue index 1a5c4b1..710c205 100644 --- a/src/views/panel/index.vue +++ b/src/views/panel/index.vue @@ -14,7 +14,12 @@ const loading = ref(false) onMounted(async () => { try { - openPlanUrl("http://localhost:5173/#/canteen") + // 是否生成环境 + if (import.meta.env.VITE_ENV === "prod") { + openPlanUrl("https://stgl.pj.gov.cn/cockpit/#/canteen") + } else { + openPlanUrl("http://localhost:5173/#/canteen") + } loading.value = true router.back() } catch (error: any) { From e684883acd0f47ff459218f2428e7cf4af673b2e Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Sun, 26 Oct 2025 21:54:58 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/supermarketerp/report/sales/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/supermarketerp/report/sales/index.vue b/src/views/supermarketerp/report/sales/index.vue index 8ef1fe0..51298b7 100644 --- a/src/views/supermarketerp/report/sales/index.vue +++ b/src/views/supermarketerp/report/sales/index.vue @@ -72,7 +72,7 @@ - +