页面布局调整
parent
67ffe34097
commit
6adf228d02
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -771,6 +771,10 @@ export default {
|
|||
margin: 0 28rpx;
|
||||
}
|
||||
|
||||
.sub-category-name {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* 添加按钮样式 */
|
||||
.add-sub-btn {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -31,12 +31,12 @@
|
|||
全部
|
||||
</view>
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === 'expiring' }"
|
||||
@tap="navigateToExpiredPage"
|
||||
>
|
||||
临期/过期<text class="badge">0</text>
|
||||
</view>
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === 'expiring' }"
|
||||
@tap="switchTab('expiring')"
|
||||
>
|
||||
临期/过期<text class="badge">0</text>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: currentTab === 'outstock' }"
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
</view>
|
||||
|
||||
<!-- 微店状态栏 -->
|
||||
<view class="store-status">
|
||||
<view class="store-status" v-if="currentTab === 'all'">
|
||||
<view class="status-content">
|
||||
<view class="dui">
|
||||
<image class="dui-img" src="http://193.112.94.36:8099/static/images/Frame 52.png"></image>
|
||||
|
|
@ -68,6 +68,46 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 临期/过期状态栏 -->
|
||||
<view class="store-status" v-else-if="currentTab === 'expiring'">
|
||||
<view class="status-left-content">
|
||||
<view class="dui">
|
||||
<image class="dui-img" src="http://193.112.94.36:8099/static/images/Mask group.png"></image>
|
||||
</view>
|
||||
<view class="status-left">
|
||||
<text class="status-text">快速处理</text>
|
||||
<text class="status-num">临期/过期食品</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="status-right-buttons">
|
||||
<view class="quick-btn pink-btn" @tap="goToPromotion">
|
||||
<text class="btn-text">临期促销</text>
|
||||
<uni-icons type="arrowright" size="12" color="#fff"></uni-icons>
|
||||
</view>
|
||||
<view class="quick-btn pink-btn" @tap="goToExpiredOut">
|
||||
<text class="btn-text">过期出库</text>
|
||||
<uni-icons type="arrowright" size="12" color="#fff"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 缺货状态栏 -->
|
||||
<view class="store-status" v-else-if="currentTab === 'outstock'">
|
||||
<view class="status-content">
|
||||
<view class="dui">
|
||||
<image class="dui-img" src="http://193.112.94.36:8099/static/images/Mask group (1).png"></image>
|
||||
</view>
|
||||
<view class="status-left">
|
||||
<text class="status-text">库存不足预警设置</text>
|
||||
<text class="status-num">库存低于已设置阈值时,会收到APP推送提醒</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="status-right" @tap="goToAlertSettings">
|
||||
<text class="set-text">设置</text>
|
||||
<uni-icons type="forward" size="14" color="#666"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<scroll-view class="goods-list" scroll-y="true">
|
||||
<view class="goods-item" v-for="item in goodsList" :key="item.id">
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue