From 6adf228d020cb6f3627768257a16a4ff9fb0b7ce Mon Sep 17 00:00:00 2001 From: fy <> Date: Wed, 4 Feb 2026 16:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/product.js | 4 +- config.js | 4 +- pages/category/category.vue | 4 + pages/expired/expired.vue | 72 ++++++++++++--- pages/navailable/navailable.vue | 44 ++++++++- pages/product/product.vue | 157 +++++++++++++++++++++++++------- 6 files changed, 230 insertions(+), 55 deletions(-) diff --git a/api/product.js b/api/product.js index ebcacd7..a2d361e 100644 --- a/api/product.js +++ b/api/product.js @@ -289,7 +289,7 @@ export function getBrandList(params) { // 获取品牌树状结构 export function getBrandTree(storeId, brandName) { return request8081({ - baseUrl: 'http://192.168.0.7:8081', + baseUrl: 'http://193.112.94.36:8081', url: `/mall/brand/getTree/${storeId}`, method: 'get', params: { brandName } @@ -328,7 +328,7 @@ export function addClassification(data) { // 获取分类树状结构 export function getClassificationTree(storeId, classificationName) { return request8081({ - baseUrl: 'http://192.168.0.7:8081', + baseUrl: 'http://193.112.94.36:8081', url: `/mall/classification/getTree/${storeId}`, method: 'get', params: { classificationName } diff --git a/config.js b/config.js index 1617c5a..a103b19 100644 --- a/config.js +++ b/config.js @@ -3,8 +3,8 @@ module.exports = { // baseUrl: 'https://vue.ruoyi.vip/prod-api', // baseUrl:'http://yunzs2.haich.cc', - baseUrl:'https://yunzs.haich.cc', - // baseUrl:'http://193.112.94.36:8080', + // baseUrl:'https://yunzs.haich.cc', + baseUrl:'http://193.112.94.36:8080', // baseUrl = 'https://api.ruoyi.com' // prodApi: 'https://vue.ruoyi.vip/prod-api', // baseUrl: 'http://localhost:8080', diff --git a/pages/category/category.vue b/pages/category/category.vue index 53347c9..d582db0 100644 --- a/pages/category/category.vue +++ b/pages/category/category.vue @@ -771,6 +771,10 @@ export default { margin: 0 28rpx; } +.sub-category-name { + flex: 1; +} + /* 添加按钮样式 */ .add-sub-btn { display: flex; diff --git a/pages/expired/expired.vue b/pages/expired/expired.vue index f229283..cfd6b20 100644 --- a/pages/expired/expired.vue +++ b/pages/expired/expired.vue @@ -400,21 +400,65 @@ }, deleteGoods(goods) { - this.$refs.popup.close(); - uni.showModal({ - title: '确认删除', - content: `确定要删除商品"${goods.name}"吗?`, - success: (res) => { - if (res.confirm) { - console.log('删除商品:', goods); - uni.showToast({ - title: '删除成功', - icon: 'success' - }); - } + this.$refs.popup.close(); + uni.showModal({ + title: '确认删除', + content: `确定要删除商品"${goods.name}"吗?`, + success: (res) => { + if (res.confirm) { + console.log('删除商品:', goods); + uni.showToast({ + title: '删除成功', + icon: 'success' + }); } - }); - } + } + }); + }, + + // 批量删除商品 + batchDeleteGoods() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/batchDeleteProduct/batchDeleteProduct' + }); + }, + + // 分类管理 + goToCategoryManagement() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/category/category' + }); + }, + // 品牌管理 + goToBrandManagement() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/addBrand/addBrand' + }); + }, + // 条码规则设置 + goToBarcodeSettings() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/barcodeSettings/barcodeSettings' + }); + }, + // 盘点库存 + goToInventoryCount() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/inventoryCount/inventoryCount' + }); + }, + // 出库 + goToOutbound() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/outbound/outbound' + }); + } } } diff --git a/pages/navailable/navailable.vue b/pages/navailable/navailable.vue index 1487e44..dfd39d0 100644 --- a/pages/navailable/navailable.vue +++ b/pages/navailable/navailable.vue @@ -278,12 +278,48 @@ } }, // 缺货页面批量删除商品 - batchDeleteGoods() { - this.$refs.popup.close(); + batchDeleteGoods() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/batchDeleteProduct/batchDeleteProduct' + }); + }, + + // 分类管理 + goToCategoryManagement() { + this.$refs.popup.close(); uni.navigateTo({ - // url: '/pages/batchDeleteProduct/batchDeleteProduct' + url: '/pages/category/category' }); - }, + }, + // 品牌管理 + goToBrandManagement() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/addBrand/addBrand' + }); + }, + // 条码规则设置 + goToBarcodeSettings() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/barcodeSettings/barcodeSettings' + }); + }, + // 盘点库存 + goToInventoryCount() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/inventoryCount/inventoryCount' + }); + }, + // 出库 + goToOutbound() { + this.$refs.popup.close(); + uni.navigateTo({ + url: '/pages/outbound/outbound' + }); + }, onSearch() { console.log('搜索关键词:', this.searchText); diff --git a/pages/product/product.vue b/pages/product/product.vue index 79864e1..bd96dcc 100644 --- a/pages/product/product.vue +++ b/pages/product/product.vue @@ -31,12 +31,12 @@ 全部 - 临期/过期0 - + class="tab-item" + :class="{ active: currentTab === 'expiring' }" + @tap="switchTab('expiring')" + > + 临期/过期0 + - + @@ -68,6 +68,46 @@ + + + + + + + + 快速处理 + 临期/过期食品 + + + + + 临期促销 + + + + 过期出库 + + + + + + + + + + + + + 库存不足预警设置 + 库存低于已设置阈值时,会收到APP推送提醒 + + + + 设置 + + + + @@ -213,6 +253,16 @@ searchParams.storeId = this.storeId; } + // 根据标签添加不同的查询参数 + if (this.currentTab === 'outstock') { + // 缺货商品 + searchParams.stockQuantity = 0; + } else if (this.currentTab === 'expiring') { + // 临期/过期商品 + // 这里需要根据实际API添加相应的参数 + // 例如:searchParams.expiring = true; + } + const res = await fetchProductList(searchParams); console.log('商品列表接口返回:', res); @@ -225,12 +275,14 @@ })); console.log('处理后的商品列表:', this.goodsList); } else { + this.goodsList = []; uni.showToast({ title: res?.msg || '获取商品列表失败', icon: 'none' }); } } catch (error) { + this.goodsList = []; console.error('获取商品列表失败:', error); console.error('错误详情:', JSON.stringify(error)); uni.showToast({ @@ -242,7 +294,8 @@ switchTab(tab) { this.currentTab = tab; - // 这里可以添加筛选逻辑 + // 根据标签重新获取商品列表 + this.getProductList(); console.log('切换到标签:', tab); }, @@ -257,14 +310,13 @@ const searchText = this.searchText.trim(); let searchParams = {}; - // if (/^\d+$/.test(searchText)) { - searchParams = { productBarCode: searchText }; - // console.log('商品名称模糊查询:', searchParams); - // console.log('按条形码精准查询按:', searchParams); - // } else { - // searchParams = { productName: searchText }; - // console.log('按条形码精准查询按:', searchParams); - // } + if (/^\d+$/.test(searchText)) { + searchParams = { productBarCode: searchText }; + console.log('按条形码精准查询:', searchParams); + } else { + searchParams = { productName: searchText }; + console.log('商品名称模糊查询:', searchParams); + } this.getProductList(searchParams); }, @@ -275,6 +327,25 @@ }); }, + // 库存不足预警设置 + goToAlertSettings() { + uni.navigateTo({ + url: '/pages/alertSettings/index' + }); + }, + + // 临期促销 + goToPromotion() { + console.log('临期促销'); + // 这里可以添加临期促销的逻辑 + }, + + // 过期出库 + goToExpiredOut() { + console.log('过期出库'); + // 这里可以添加过期出库的逻辑 + }, + showMoreActions() { this.$refs.popup.open(); }, @@ -340,15 +411,7 @@ addNewGoods() { uni.navigateTo({ - // url: '/pages/enter/enter' - url: '/pages/addProduct/addProduct' - }); - }, - - // 导航到临期/过期商品页面 - navigateToExpiredPage() { - uni.navigateTo({ - url: '/pages/expired/expired' + url: '/pages/enter/enter' }); }, @@ -544,50 +607,78 @@ margin-top: 8px; border-bottom: 1px solid #eee; } - + .status-content { display: flex; align-items: center; } - + + .status-left-content { + display: flex; + align-items: center; + } + + .status-right-buttons { + display: flex; + align-items: center; + gap: 12rpx; + } + .dui { margin-right: 12rpx; } - + .dui-img { width: 24rpx; height: 24rpx; } - + .status-left { display: flex; flex-direction: column; margin-left: 0; } - + .status-text { font-size: 14px; color: #333; } - + .status-num { font-size: 12px; color: #666; margin-top: 4px; } - + .status-right { display: flex; align-items: center; margin-right: 1rpx; } - + .set-text { font-size: 14px; color: #666; margin-right: 4px; } + /* 右侧粉色按钮通用样式 */ + .quick-btn { + display: flex; + align-items: center; + background: red; + padding: 8rpx 16rpx; + border-radius: 20rpx; + color: white; + font-size: 22rpx; + gap: 4rpx; + flex-shrink: 0; + } + + .btn-text { + font-size: 22rpx; + } + /* 商品列表 */ .goods-list { height: calc(100vh - 320px);