页面布局调整
parent
67ffe34097
commit
6adf228d02
|
|
@ -289,7 +289,7 @@ export function getBrandList(params) {
|
||||||
// 获取品牌树状结构
|
// 获取品牌树状结构
|
||||||
export function getBrandTree(storeId, brandName) {
|
export function getBrandTree(storeId, brandName) {
|
||||||
return request8081({
|
return request8081({
|
||||||
baseUrl: 'http://192.168.0.7:8081',
|
baseUrl: 'http://193.112.94.36:8081',
|
||||||
url: `/mall/brand/getTree/${storeId}`,
|
url: `/mall/brand/getTree/${storeId}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { brandName }
|
params: { brandName }
|
||||||
|
|
@ -328,7 +328,7 @@ export function addClassification(data) {
|
||||||
// 获取分类树状结构
|
// 获取分类树状结构
|
||||||
export function getClassificationTree(storeId, classificationName) {
|
export function getClassificationTree(storeId, classificationName) {
|
||||||
return request8081({
|
return request8081({
|
||||||
baseUrl: 'http://192.168.0.7:8081',
|
baseUrl: 'http://193.112.94.36:8081',
|
||||||
url: `/mall/classification/getTree/${storeId}`,
|
url: `/mall/classification/getTree/${storeId}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { classificationName }
|
params: { classificationName }
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ module.exports = {
|
||||||
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
||||||
|
|
||||||
// baseUrl:'http://yunzs2.haich.cc',
|
// baseUrl:'http://yunzs2.haich.cc',
|
||||||
baseUrl:'https://yunzs.haich.cc',
|
// baseUrl:'https://yunzs.haich.cc',
|
||||||
// baseUrl:'http://193.112.94.36:8080',
|
baseUrl:'http://193.112.94.36:8080',
|
||||||
// baseUrl = 'https://api.ruoyi.com'
|
// baseUrl = 'https://api.ruoyi.com'
|
||||||
// prodApi: 'https://vue.ruoyi.vip/prod-api',
|
// prodApi: 'https://vue.ruoyi.vip/prod-api',
|
||||||
// baseUrl: 'http://localhost:8080',
|
// baseUrl: 'http://localhost:8080',
|
||||||
|
|
|
||||||
|
|
@ -771,6 +771,10 @@ export default {
|
||||||
margin: 0 28rpx;
|
margin: 0 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sub-category-name {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* 添加按钮样式 */
|
/* 添加按钮样式 */
|
||||||
.add-sub-btn {
|
.add-sub-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -400,21 +400,65 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteGoods(goods) {
|
deleteGoods(goods) {
|
||||||
this.$refs.popup.close();
|
this.$refs.popup.close();
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认删除',
|
title: '确认删除',
|
||||||
content: `确定要删除商品"${goods.name}"吗?`,
|
content: `确定要删除商品"${goods.name}"吗?`,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
console.log('删除商品:', goods);
|
console.log('删除商品:', goods);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '删除成功',
|
title: '删除成功',
|
||||||
icon: 'success'
|
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>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -278,12 +278,48 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 缺货页面批量删除商品
|
// 缺货页面批量删除商品
|
||||||
batchDeleteGoods() {
|
batchDeleteGoods() {
|
||||||
this.$refs.popup.close();
|
this.$refs.popup.close();
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/batchDeleteProduct/batchDeleteProduct'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 分类管理
|
||||||
|
goToCategoryManagement() {
|
||||||
|
this.$refs.popup.close();
|
||||||
uni.navigateTo({
|
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() {
|
onSearch() {
|
||||||
console.log('搜索关键词:', this.searchText);
|
console.log('搜索关键词:', this.searchText);
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,12 @@
|
||||||
全部
|
全部
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="tab-item"
|
class="tab-item"
|
||||||
:class="{ active: currentTab === 'expiring' }"
|
:class="{ active: currentTab === 'expiring' }"
|
||||||
@tap="navigateToExpiredPage"
|
@tap="switchTab('expiring')"
|
||||||
>
|
>
|
||||||
临期/过期<text class="badge">0</text>
|
临期/过期<text class="badge">0</text>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="tab-item"
|
class="tab-item"
|
||||||
:class="{ active: currentTab === 'outstock' }"
|
:class="{ active: currentTab === 'outstock' }"
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 微店状态栏 -->
|
<!-- 微店状态栏 -->
|
||||||
<view class="store-status">
|
<view class="store-status" v-if="currentTab === 'all'">
|
||||||
<view class="status-content">
|
<view class="status-content">
|
||||||
<view class="dui">
|
<view class="dui">
|
||||||
<image class="dui-img" src="http://193.112.94.36:8099/static/images/Frame 52.png"></image>
|
<image class="dui-img" src="http://193.112.94.36:8099/static/images/Frame 52.png"></image>
|
||||||
|
|
@ -68,6 +68,46 @@
|
||||||
</view>
|
</view>
|
||||||
</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">
|
<scroll-view class="goods-list" scroll-y="true">
|
||||||
<view class="goods-item" v-for="item in goodsList" :key="item.id">
|
<view class="goods-item" v-for="item in goodsList" :key="item.id">
|
||||||
|
|
@ -213,6 +253,16 @@
|
||||||
searchParams.storeId = this.storeId;
|
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);
|
const res = await fetchProductList(searchParams);
|
||||||
|
|
||||||
console.log('商品列表接口返回:', res);
|
console.log('商品列表接口返回:', res);
|
||||||
|
|
@ -225,12 +275,14 @@
|
||||||
}));
|
}));
|
||||||
console.log('处理后的商品列表:', this.goodsList);
|
console.log('处理后的商品列表:', this.goodsList);
|
||||||
} else {
|
} else {
|
||||||
|
this.goodsList = [];
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res?.msg || '获取商品列表失败',
|
title: res?.msg || '获取商品列表失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
this.goodsList = [];
|
||||||
console.error('获取商品列表失败:', error);
|
console.error('获取商品列表失败:', error);
|
||||||
console.error('错误详情:', JSON.stringify(error));
|
console.error('错误详情:', JSON.stringify(error));
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -242,7 +294,8 @@
|
||||||
|
|
||||||
switchTab(tab) {
|
switchTab(tab) {
|
||||||
this.currentTab = tab;
|
this.currentTab = tab;
|
||||||
// 这里可以添加筛选逻辑
|
// 根据标签重新获取商品列表
|
||||||
|
this.getProductList();
|
||||||
console.log('切换到标签:', tab);
|
console.log('切换到标签:', tab);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -257,14 +310,13 @@
|
||||||
const searchText = this.searchText.trim();
|
const searchText = this.searchText.trim();
|
||||||
let searchParams = {};
|
let searchParams = {};
|
||||||
|
|
||||||
// if (/^\d+$/.test(searchText)) {
|
if (/^\d+$/.test(searchText)) {
|
||||||
searchParams = { productBarCode: searchText };
|
searchParams = { productBarCode: searchText };
|
||||||
// console.log('商品名称模糊查询:', searchParams);
|
console.log('按条形码精准查询:', searchParams);
|
||||||
// console.log('按条形码精准查询按:', searchParams);
|
} else {
|
||||||
// } else {
|
searchParams = { productName: searchText };
|
||||||
// searchParams = { productName: searchText };
|
console.log('商品名称模糊查询:', searchParams);
|
||||||
// console.log('按条形码精准查询按:', searchParams);
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
this.getProductList(searchParams);
|
this.getProductList(searchParams);
|
||||||
},
|
},
|
||||||
|
|
@ -275,6 +327,25 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 库存不足预警设置
|
||||||
|
goToAlertSettings() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/alertSettings/index'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 临期促销
|
||||||
|
goToPromotion() {
|
||||||
|
console.log('临期促销');
|
||||||
|
// 这里可以添加临期促销的逻辑
|
||||||
|
},
|
||||||
|
|
||||||
|
// 过期出库
|
||||||
|
goToExpiredOut() {
|
||||||
|
console.log('过期出库');
|
||||||
|
// 这里可以添加过期出库的逻辑
|
||||||
|
},
|
||||||
|
|
||||||
showMoreActions() {
|
showMoreActions() {
|
||||||
this.$refs.popup.open();
|
this.$refs.popup.open();
|
||||||
},
|
},
|
||||||
|
|
@ -340,15 +411,7 @@
|
||||||
|
|
||||||
addNewGoods() {
|
addNewGoods() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
// url: '/pages/enter/enter'
|
url: '/pages/enter/enter'
|
||||||
url: '/pages/addProduct/addProduct'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 导航到临期/过期商品页面
|
|
||||||
navigateToExpiredPage() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/expired/expired'
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -544,50 +607,78 @@
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-content {
|
.status-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-left-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-right-buttons {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.dui {
|
.dui {
|
||||||
margin-right: 12rpx;
|
margin-right: 12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dui-img {
|
.dui-img {
|
||||||
width: 24rpx;
|
width: 24rpx;
|
||||||
height: 24rpx;
|
height: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-left {
|
.status-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-text {
|
.status-text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-num {
|
.status-num {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #666;
|
color: #666;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-right {
|
.status-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 1rpx;
|
margin-right: 1rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.set-text {
|
.set-text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #666;
|
color: #666;
|
||||||
margin-right: 4px;
|
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 {
|
.goods-list {
|
||||||
height: calc(100vh - 320px);
|
height: calc(100vh - 320px);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue