You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
987 lines
28 KiB
987 lines
28 KiB
<!-- 库存列表页 -->
|
|
<template>
|
|
<view>
|
|
<view class="" style="width: 100%;display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;position: fixed;background: #fff;top: 0;z-index: 99;">
|
|
<view class="title-left">
|
|
<view class="title-left-box" style="color:blue;text-decoration: underline;" @tap="goWarnList">
|
|
<text>{{warnMsg.tailWarnCount}}</text>
|
|
<text>库存预警</text>
|
|
</view>
|
|
<view class="title-left-box">
|
|
<text>{{warnMsg.salesWeekCount}}</text>
|
|
<text>尾货预警</text>
|
|
</view>
|
|
<view class="title-left-box" style="color:blue;text-decoration: underline;" @tap="goRuku">
|
|
<text>{{total}}</text>
|
|
<text>待入库</text>
|
|
</view>
|
|
<view class="title-left-box" style="flex-direction: inherit;width: 66%;">
|
|
<view class="shop-box">
|
|
<view>{{warnMsg.productCount}}</view>
|
|
<view>商品数</view>
|
|
</view>
|
|
<view class="shop-box" @tap="seeStockCount(warnMsg.stockCount,warnMsg.minusStockCount)">
|
|
<view>{{warnMsg.stockCount + warnMsg.minusStockCount}}</view>
|
|
<view>
|
|
库存数
|
|
<uni-icons type="help" size="15"></uni-icons>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="title-left-box" style="width: 34%;" @tap="clickModel">
|
|
<text>{{type ==0?warnMsg.stockCost:'0'}}</text>
|
|
<view>
|
|
库存成本
|
|
<uni-icons type="help" size="15"></uni-icons>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
<view class="title-right">
|
|
<view class="title-right-top title-btn" @tap.stop="onGridClick('2')">
|
|
新增商品
|
|
</view>
|
|
<view class="title-right-bottom title-btn" @tap.stop="onGridClick('3')">
|
|
更多
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" @blur="search" @clear="clearSearch" />
|
|
</view>
|
|
<view class="content-left" style="height: 78%;float: left;position: fixed;top: 23%;">
|
|
<view v-if="gateType == ''" class="left-box" v-for="(item, index) in indexList" :key="index"
|
|
:class="item.parentId ? 'left-box-hover':''" @tap="clickLeftBtn(index)">
|
|
<text style="width: 100%;height: 90rpx;line-height: 90rpx;display: inline-block;overflow: hidden;" :class="item.parentId ? 'red' :''">{{item.categoryName}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="content-right" style="width: 570rpx;background: #fff;margin-left:170rpx;margin-top: 300rpx;">
|
|
<view style="display: flex;height: 60rpx;line-height: 60rpx;background: #C6E2FF;color: #777;text-align: center;">
|
|
<view style="width: 33%;">
|
|
商品数:{{indexList[categoryIndex].count != undefined ? indexList[categoryIndex].count : 0}}
|
|
</view>
|
|
<view style="width: 46%;" @tap.stop="seeStockCount(indexList[categoryIndex].stockCount,indexList[categoryIndex].minusStockCount)">
|
|
库存数:{{indexList[categoryIndex].stockCount != undefined ? indexList[categoryIndex].stockCount + indexList[categoryIndex].minusStockCount: 0}}
|
|
<uni-icons type="help" size="15" style="padding-right: 50rpx;" @tap.stop="seeStockCount(indexList[categoryIndex].stockCount,indexList[categoryIndex].minusStockCount)"></uni-icons>
|
|
</view>
|
|
<view style="width: 17%;position: relative;" @tap.stop="goodsListSort">
|
|
排序
|
|
<uni-icons type="up" size="14" v-if="sort == ''" style="position: absolute;top: -4px;right: 0;"></uni-icons>
|
|
<uni-icons type="down" size="14" v-if="sort == ''" style="position: absolute;top: 6px;right: 0;"></uni-icons>
|
|
<uni-icons type="up" size="14" color='#FF6A6A' v-if="sort != '' && orderSort == 'asc'" style="position: absolute;top: 0;right: 0;"></uni-icons>
|
|
<uni-icons type="down" size="14" color='#FF6A6A' v-if="sort != '' && orderSort == 'desc'" style="position: absolute;top: 0;right: 0;"></uni-icons>
|
|
</view>
|
|
</view>
|
|
<view class="right-box" v-for="(item,index) in shopList" :key="index" @tap="goDetail(item)">
|
|
<view class="box-left" @tap.stop="largeImg(item)">
|
|
<img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture">
|
|
<view class="noPic" v-else>暂无图片</view>
|
|
</view>
|
|
<view class="box-right">
|
|
<view class="box-right-num">货号:{{item.productSn==null?'':item.productSn}}</view>
|
|
<view class="box-right-name">名称:{{item.productName == null?'暂无':item.productName}}</view>
|
|
<view class="box-right-name">供应商:{{item.supplierName == null?'暂无':item.supplierName}}</view>
|
|
<!-- 1上架 0下架 -->
|
|
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
|
|
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
|
|
<view @tap.stop="oneShare(item)" style="position: absolute;top: 0;right: 20rpx;width: 100rpx;height: 80rpx;">
|
|
<button class="shareBtn">
|
|
<uni-icons type="redo" size="22"></uni-icons>
|
|
</button>
|
|
</view>
|
|
<view class="box-right-price">
|
|
<view class="price-box" v-if='type==0'>
|
|
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
|
|
<text>采购价</text>
|
|
</view>
|
|
<view class="price-box">
|
|
<text>{{item.wholesalePrice}}</text>
|
|
<text>批发价</text>
|
|
</view>
|
|
<view class="price-box">
|
|
<text>{{item.price}}</text>
|
|
<text>零售价</text>
|
|
</view>
|
|
<view class="price-box" @tap.stop="seeStockCount(item.stockCount,item.minusStockCount)">
|
|
<text>{{item.stockCount + item.minusStockCount}}</text>
|
|
<view>
|
|
库存
|
|
<uni-icons type="help" size="15"></uni-icons>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view @tap.stop="seeCustomCategory(item.customerCategoryRule)" style="padding: 4px 2px;position: absolute;right: 20rpx;bottom: 104rpx;background: #088FEB;border-radius: 5px;color: #fff;">
|
|
客户价格
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="right-box" v-for="(item,index) in shopList1" :key="index" @tap="goDetail(item)">
|
|
<view class="box-left" @tap.stop="largeImg(item)">
|
|
<img :src="item.productPicture" class="img-radius" alt="" v-if="item.productPicture">
|
|
<view class="noPic" v-else>暂无图片</view>
|
|
</view>
|
|
<view class="box-right">
|
|
|
|
<view class="box-right-num">货号:{{item.productSn}}</view>
|
|
<view class="box-right-name">名称:{{item.productName == null?'暂无':item.productName}}</view>
|
|
<view class="box-right-name">供应商:{{item.supplierName == null?'暂无':item.supplierName}}</view>
|
|
<!-- 1上架 0下架 -->
|
|
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">下架</view>
|
|
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">上架</view>
|
|
<view @tap.stop="oneShare(item)" style="position: absolute;top: 20rpx;right: 20rpx;width: 100rpx;height: 100rpx;">
|
|
<button class="shareBtn">
|
|
<uni-icons type="redo" size="22"></uni-icons>
|
|
</button>
|
|
</view>
|
|
<view class="box-right-price">
|
|
<view class="price-box" v-if='type==0'>
|
|
<text style="color: red;">{{item.inStorageStatus==0?'待入库':item.purchasePrice==null?'新商品':item.purchasePrice}}</text>
|
|
<text>采购价</text>
|
|
</view>
|
|
<view class="price-box">
|
|
<text>{{item.wholesalePrice}}</text>
|
|
<text>批发价</text>
|
|
</view>
|
|
<view class="price-box">
|
|
<text>{{item.price}}</text>
|
|
<text>零售价</text>
|
|
</view>
|
|
<view class="price-box" @tap.stop="seeStockCount(item.stockCount,item.minusStockCount)">
|
|
<text>{{item.stockCount + item.minusStockCount}}</text>
|
|
<view>
|
|
库存
|
|
<uni-icons type="help" size="15"></uni-icons>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view @tap.stop="seeCustomCategory(item.customerCategoryRule)" v-if="item.customerCategoryRule != null && item.customerCategoryRule != ''" style="padding: 4px 2px;position: absolute;right: 20rpx;bottom: 104rpx;background: #088FEB;border-radius: 5px;color: #fff;">
|
|
客户价格
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<u-loadmore :status="status" />
|
|
</view>
|
|
<!-- 弹出输入框 -->
|
|
<uni-popup ref="payDialog" background-color="#fff">
|
|
<view class="popup-pay-content">
|
|
<view class="popup-pay-title">
|
|
<text>请选择</text>
|
|
</view>
|
|
<view class="popup-pay-container" @tap="onGridClick('0')">
|
|
<text style="display: inline-block">分类管理</text>
|
|
</view>
|
|
<view class="popup-pay-container" @tap="onGridClick('4')">
|
|
<text style="display: inline-block">批量打印商品码</text>
|
|
</view>
|
|
<view class="popup-pay-container" @tap="onGridClick('5')">
|
|
<text style="display: inline-block">批量下架</text>
|
|
</view>
|
|
<view v-if="type == 0" class="popup-pay-container" @tap="onGridClick('6')">
|
|
<text style="display: inline-block">批量删除商品</text>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
<!-- 弹出输入框 -->
|
|
<uni-popup ref="sharePriceDialog" background-color="#fff">
|
|
<view class="popup-pay-content">
|
|
<view class="popup-pay-title">
|
|
<text>选择商品价格</text>
|
|
</view>
|
|
<view class="popup-pay-container" @tap="checkPay('0')">
|
|
<text style="display: inline-block">以零售价分享</text>
|
|
</view>
|
|
<view class="popup-pay-container" @tap="checkPay('1')">
|
|
<text style="display: inline-block">以批发价分享</text>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
<!-- 弹出层 -->
|
|
<uni-popup ref="sharePopup" background-color="#fff">
|
|
<view style="height: 250rpx;">
|
|
<button open-type="share" @tap="$refs.sharePopup.close()" class="popup-photo">分享给微信好友</button>
|
|
<view @tap="$refs.sharePopup.close()" class="popup-photo" style="border-bottom:0;border-top:10px solid #eee;">取消</view>
|
|
</view>
|
|
</uni-popup>
|
|
<!-- 弹出多图轮播 -->
|
|
<uni-popup ref="imgPopup" background-color="#fff">
|
|
<view class="showImg-box">
|
|
<swiper indicator-dots class="swiper-box" @change="lunbochange" circular autoplay :current="swiperDotIndex">
|
|
<swiper-item v-for="(item, index) in bigImg" :key="index">
|
|
<view class="swiper-item">
|
|
<image mode='aspectFit' show-menu-by-longpress :src="item.productPicture" alt="" style="width: 100%;height: 100%;border-radius: 10px;" /></image>
|
|
</view>
|
|
</swiper-item>
|
|
</swiper>
|
|
</view>
|
|
</uni-popup>
|
|
<!-- 维护客户价格弹出层 -->
|
|
<uni-popup ref="customPopup" background-color="#fff">
|
|
<view class="popup-content" style="height: auto;max-height: 600rpx;margin-bottom: 0;">
|
|
<view v-for="(item,index) in customerCategoryList" :key="index">
|
|
<view style="height: 60rpx;line-height: 60rpx;">
|
|
{{item.categoryName}}
|
|
</view>
|
|
<input type="number" disabled v-model='item.categoryPrice'
|
|
style="height: 60rpx;padding-left: 20rpx;border: 1px solid #eee;border-radius: 10rpx;">
|
|
</view>
|
|
<view @tap="$refs.customPopup.close()"
|
|
style="text-align:center;margin-top:20rpx;width: 100%;height: 60rpx;line-height: 60rpx;background: #088FEB;color: #fff;">
|
|
确认
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
<!-- 显示正负库存弹窗 -->
|
|
<uni-popup ref="showPopup" background-color="#fff">
|
|
<view class="popup-pay-content" style="width: 550rpx;">
|
|
<view class="popup-pay-title">
|
|
<text>库存数</text>
|
|
</view>
|
|
<view style="width: 100%;height: 150rpx;">
|
|
<view
|
|
style="width: 200rpx;height: 130rpx;border: 3px solid #FFE4C4;border-radius: 10px;margin-top: 20rpx;padding-top: 10px;display: flex;flex-direction: column;text-align: center;float: left;margin-left: 20rpx;">
|
|
<text style="font-weight: bold;">
|
|
正数库存
|
|
</text>
|
|
<text style="font-size: 30rpx;color: #000;font-weight: bold;">
|
|
{{zheng}}
|
|
</text>
|
|
</view>
|
|
<view
|
|
style="width: 200rpx;height: 130rpx;border: 3px solid #FFE4C4;border-radius: 10px;margin-top: 20rpx;padding-top: 10px;display: flex;flex-direction: column;text-align: center;float: left;margin-left: 40rpx;">
|
|
<text style="font-weight: bold;">
|
|
负数库存
|
|
</text>
|
|
<text style="font-size: 30rpx;color: #000;font-weight: bold;">
|
|
{{fu}}
|
|
</text>
|
|
</view>
|
|
</view>
|
|
<view class="popup-pay-container" style="display: flex;margin-top: 50rpx;background: #89CFF0;">
|
|
<view @tap='$refs.showPopup.close()'
|
|
style="flex:1;text-align: center;border-right: 1px solid #eee;background: #088FEB;font-size:32rpx;">
|
|
确认
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
mapState
|
|
} from 'vuex';
|
|
export default {
|
|
computed: mapState(['shopIndex', 'region']),
|
|
data() {
|
|
return {
|
|
size: 30,
|
|
customerCategoryList:[],
|
|
indexList: [],
|
|
zheng:'0',
|
|
fu:'0',
|
|
bigImg:[],
|
|
swiperDotIndex:0,
|
|
// status: 'loadmore',
|
|
pageNum: 1, //分页的页码
|
|
shopList: [],
|
|
categoryId: '', //分类id
|
|
shopId: '', //店铺id,
|
|
type:'',
|
|
orderSort:'',
|
|
sort:'',
|
|
warnMsg:[],
|
|
goodsData:[],
|
|
searchName:'',
|
|
categoryIndex:0,
|
|
windowHeight:0,
|
|
shopList1:[],
|
|
picture:'',
|
|
gateType:'',
|
|
total:0
|
|
}
|
|
},
|
|
onLoad(option){
|
|
if (option.khid != undefined) {
|
|
uni.redirectTo({
|
|
url: "/package1/index/downStearmList?khid=" + option.khid
|
|
})
|
|
}
|
|
// if(uni.getStorageSync('noReload') == true){
|
|
// uni.removeStorageSync('noReload')
|
|
// }
|
|
let that = this
|
|
this.type=uni.getStorageSync('type')
|
|
uni.getSystemInfo({
|
|
success: function (info) {
|
|
that.windowHeight = info.windowHeight
|
|
}
|
|
});
|
|
},
|
|
onShareAppMessage() {
|
|
return {
|
|
title: '查看我的推荐',
|
|
imageUrl:this.picture,
|
|
path: '/package1/index/downStearmList?khid=' + this.khid +'&userId=""'
|
|
}
|
|
},
|
|
onReachBottom() {
|
|
if (this.pageNum >= this.pages) return;
|
|
// this.status = 'loading';
|
|
this.pageNum ++;
|
|
if(this.gateType == 'search'){
|
|
this.getShareList('search');
|
|
}else{
|
|
this.getShareList();
|
|
}
|
|
|
|
},
|
|
onShow() {
|
|
console.log('shopList',this.shopList)
|
|
if(uni.getStorageSync('noReload') == true){
|
|
this.searchName = ''
|
|
uni.removeStorageSync('noReload')
|
|
}else{
|
|
this.searchName = ''
|
|
this.getGategoryList()
|
|
}
|
|
this.getWarnMsg()
|
|
this.getweiruku()
|
|
},
|
|
methods: {
|
|
lunbochange(e) {
|
|
this.current = e.detail.current
|
|
},
|
|
//排序
|
|
goodsListSort(){
|
|
//sort空 stockCount desc asc
|
|
this.pageNum = 1
|
|
this.shopList1 = []
|
|
this.shopList = []
|
|
this.sort = 'stockCount'
|
|
if(this.orderSort == ''){
|
|
this.orderSort = 'asc'
|
|
}else if(this.orderSort == 'asc'){
|
|
this.orderSort = 'desc'
|
|
}else if(this.orderSort == 'desc'){
|
|
this.orderSort = 'asc'
|
|
}
|
|
this.getShareList()
|
|
},
|
|
largeImg(img) {
|
|
if(img.productPicture == null &&img.productPictures == null ){
|
|
this.tui.toast("暂无可展示的图片",1000)
|
|
return
|
|
}
|
|
this.bigImg = []
|
|
if(img.productPicture != null){
|
|
let data = {
|
|
productPicture:img.productPicture
|
|
}
|
|
this.bigImg.push(data)
|
|
}
|
|
if(img.productPictures != null){
|
|
for(let i=0;i<img.productPictures.length;i++){
|
|
this.bigImg.push(img.productPictures[i])
|
|
}
|
|
}
|
|
this.$refs.imgPopup.open()
|
|
},
|
|
checkPay(type){
|
|
this.tui.request("/app/productShare/save", "POST", {
|
|
shareType: '2',
|
|
shareProductId: [this.goodsData.id],
|
|
priceType:type
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
this.khid = res.result.id
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
}).catch((res) => {})
|
|
this.checkPayData = type
|
|
this.$refs.sharePriceDialog.close()
|
|
this.$refs.sharePopup.open('bottom')
|
|
},
|
|
seeStockCount(zheng,fu){
|
|
this.zheng = zheng;
|
|
this.fu = fu;
|
|
this.$refs.showPopup.open()
|
|
},
|
|
//初始化获取分类列表
|
|
getGategoryList() {
|
|
this.tui.request("/app/productCategory/list", "get", {
|
|
// shopId: 1,
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
this.indexList = res.result;
|
|
for (var i = 0; i < this.indexList.length; i++) {
|
|
if (i == this.categoryIndex) {
|
|
this.indexList[i].parentId = true
|
|
} else {
|
|
this.indexList[i].parentId = false
|
|
}
|
|
}
|
|
this.categoryId = this.indexList[this.categoryIndex].id
|
|
this.pageNum = 1
|
|
this.searchName = ""
|
|
this.shopList1 = []
|
|
this.shopList = []
|
|
this.getShareList();
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
}).catch((res) => {})
|
|
},
|
|
//获取库存预警信息
|
|
getWarnMsg(){
|
|
this.tui.request("/app/stock/getShopStock", "POST", {}, false, false).then((res) => {
|
|
if (res.code == 200) {
|
|
this.warnMsg = res.result
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
}).catch((res) => {})
|
|
},
|
|
//点击左侧菜单切换
|
|
clickLeftBtn(index) {
|
|
uni.removeStorageSync('noReload')
|
|
for (var i = 0; i < this.indexList.length; i++) {
|
|
if (i == index) {
|
|
this.indexList[i].parentId = true
|
|
} else {
|
|
this.indexList[i].parentId = false
|
|
}
|
|
}
|
|
this.categoryIndex = index
|
|
this.categoryId = this.indexList[index].id
|
|
this.pageNum = 1
|
|
this.searchName = ""
|
|
this.orderSort = ""
|
|
this.sort = ''
|
|
this.shopList1 = []
|
|
this.shopList = []
|
|
this.getShareList()
|
|
},
|
|
//待入库
|
|
goRuku(){
|
|
uni.navigateTo({
|
|
url: '/package1/index/waitStorage?inStorageStatus=0'
|
|
})
|
|
},
|
|
getweiruku(){
|
|
this.tui.request("/app/purchase/list", "POST", {
|
|
inStorageStatus: 0
|
|
}, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
this.total = res.result.total
|
|
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
},
|
|
//入库单详情
|
|
goDetail(item) {
|
|
uni.setStorageSync('noReload',true)
|
|
uni.navigateTo({
|
|
url: '/package1/inventory/inventoryDetail?item=' + JSON.stringify(item)
|
|
})
|
|
},
|
|
goWarnList(){
|
|
uni.navigateTo({
|
|
url: '/package1/inventory/inventoryWarn'
|
|
})
|
|
},
|
|
clickModel(type){
|
|
if(type="num"){
|
|
this.tui.toast("商品规格库存数为负数,则该规格库存数不计入库存总数中")
|
|
}else{
|
|
this.tui.toast("商品规格库存数为负数,则该规格的库存成本不计入总库存成本")
|
|
}
|
|
},
|
|
seeCustomCategory(item){
|
|
if(item == null || item == ''){
|
|
this.tui.toast("暂无客户分类价格",300)
|
|
}else{
|
|
this.customerCategoryList = JSON.parse(item)
|
|
if(Array.isArray(this.customerCategoryList)){
|
|
this.$refs.customPopup.open()
|
|
}else{
|
|
this.tui.toast("暂无客户分类价格",300)
|
|
}
|
|
}
|
|
|
|
},
|
|
//点击分类获取商品列表
|
|
getShareList(type) {
|
|
uni.showLoading({
|
|
title:'加载中...',
|
|
mask:true
|
|
})
|
|
let data = {}
|
|
if(type=='search'){
|
|
this.gateType = 'search'
|
|
data = {
|
|
categoryId: "",
|
|
searchStr: this.searchName,
|
|
pageNum: this.pageNum,
|
|
pageSize: '10',
|
|
sort:"",
|
|
order:""
|
|
}
|
|
}else{
|
|
this.gateType = ''
|
|
data = {
|
|
categoryId: this.categoryId,
|
|
searchStr: this.searchName,
|
|
pageNum: this.pageNum,
|
|
pageSize: '10',
|
|
sort:this.sort,
|
|
order:this.orderSort
|
|
}
|
|
}
|
|
this.status = 'loading';
|
|
this.tui.request("/app/product/getShareList", "POST", data, false, false).then((res) => {
|
|
if (res.code == 200) {
|
|
if(type=='search'){
|
|
this.shopList = []
|
|
this.status = 'nomore';
|
|
if (this.pages == 1) {
|
|
this.shopList1 = res.result.records
|
|
} else {
|
|
this.shopList1 = [...this.shopList1, ...res.result.records]
|
|
}
|
|
this.pages = res.result.pages
|
|
}else{
|
|
this.shopList1 = []
|
|
this.status = 'nomore';
|
|
if (this.pages == 1) {
|
|
this.shopList = res.result.records
|
|
} else {
|
|
this.shopList = [...this.shopList, ...res.result.records]
|
|
}
|
|
this.pages = res.result.pages
|
|
}
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
}).catch((res) => {})
|
|
uni.hideLoading()
|
|
},
|
|
oneShare(item){
|
|
this.goodsData = item
|
|
this.picture = (item.productPicture == null || item.productPicture == "") ?'https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg':item.productPicture
|
|
this.$refs.sharePriceDialog.open()
|
|
},
|
|
//商品上下架
|
|
upDown(type, data) {
|
|
let that = this,
|
|
title = "确定将此款商品" + (type == 0 ? "下架" : "上架") + "吗?"
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: title,
|
|
success: function(res) {
|
|
if(res.confirm){
|
|
that.pageNum = 1
|
|
that.searchName = ""
|
|
that.shopList1 = []
|
|
that.shopList = []
|
|
if (type == 0) { //下架
|
|
that.tui.request("/app/product/down", "POST", {
|
|
id: data.id
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
that.tui.toast("下架成功")
|
|
} else {
|
|
that.tui.toast(res.message)
|
|
}
|
|
that.categoryId = data.categoryId
|
|
that.getShareList()
|
|
}).catch((res) => {})
|
|
} else { //上架
|
|
that.tui.request("/app/product/up", "POST", {
|
|
id: data.id
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
that.tui.toast("上架成功")
|
|
} else {
|
|
that.tui.toast(res.message)
|
|
}
|
|
that.categoryId = data.categoryId
|
|
that.getShareList()
|
|
}).catch((res) => {})
|
|
}
|
|
}
|
|
}
|
|
})
|
|
},
|
|
//搜索接口
|
|
search(e){
|
|
if(e.value == ''){
|
|
this.pageNum = 1
|
|
this.shopList1 = []
|
|
this.shopList = []
|
|
this.searchName = ""
|
|
this.getShareList()
|
|
}else{
|
|
this.pageNum = 1
|
|
this.shopList1 = []
|
|
this.shopList = []
|
|
this.searchName = e.value
|
|
this.getShareList('search')
|
|
|
|
}
|
|
},
|
|
//清空搜索条件
|
|
clearSearch(){
|
|
this.pageNum = 1
|
|
this.shopList1 = []
|
|
this.shopList = []
|
|
this.orderSort = ''
|
|
this.sort = ''
|
|
this.searchName = ''
|
|
this.getShareList()
|
|
},
|
|
//点击头部 更多 和 新增入库 按钮
|
|
onGridClick(target) {
|
|
if (target == '0') {
|
|
uni.navigateTo({
|
|
url: '/package1/inventory/gategory'
|
|
})
|
|
this.$refs.payDialog.close()
|
|
} else if (target == '1') {
|
|
// this.$refs.popup.open('bottom')
|
|
uni.navigateTo({
|
|
url: '/pages/inventory/addinventory'
|
|
})
|
|
|
|
} else if (target == '2') {
|
|
uni.navigateTo({
|
|
url: "/package1/inventory/addGoods"
|
|
})
|
|
this.$refs.payDialog.close()
|
|
}else if(target == '3'){
|
|
this.$refs.payDialog.open('center')
|
|
}else if(target == '4'){
|
|
uni.navigateTo({
|
|
url: "/package1/inventory/batchPrint"
|
|
})
|
|
this.$refs.payDialog.close()
|
|
}else if(target == '5'){
|
|
uni.navigateTo({
|
|
url: "/package1/inventory/goodsDelisting"
|
|
})
|
|
this.$refs.payDialog.close()
|
|
}else{
|
|
uni.navigateTo({
|
|
url: "/package1/inventory/goodsDelete"
|
|
})
|
|
this.$refs.payDialog.close()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.search {
|
|
width: 100%;
|
|
height: 7%;
|
|
background-color: #fff;
|
|
position: fixed;
|
|
top: 200rpx;
|
|
z-index: 99;
|
|
}
|
|
|
|
.title-left {
|
|
width: 70%;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
float: left;
|
|
}
|
|
|
|
.title-right {
|
|
width: 30%;
|
|
border-left: 1px solid #eee;
|
|
background: #fff;
|
|
}
|
|
|
|
.title-left-box {
|
|
display: flex;
|
|
flex-direction: column;
|
|
text-align: center;
|
|
width: 33%;
|
|
height: 100rpx;
|
|
padding-top: 20rpx;
|
|
|
|
.shop-box {}
|
|
}
|
|
|
|
// 偶数行
|
|
.title-left-box:nth-child(even) {
|
|
border-left: 1px solid #fff;
|
|
background: #fff;
|
|
}
|
|
|
|
//奇数行
|
|
.title-left-box:nth-child(odd) {
|
|
border-right: 1px solid #fff;
|
|
background: #fff;
|
|
}
|
|
|
|
.title-btn {
|
|
width: 70%;
|
|
height: 80rpx;
|
|
color: #fff;
|
|
border-radius: 10px;
|
|
text-align: center;
|
|
line-height: 80rpx;
|
|
margin: 10rpx auto 10rpx;
|
|
|
|
}
|
|
|
|
.shop-box {
|
|
width: 50%;
|
|
}
|
|
|
|
.title-right-top {
|
|
background: linear-gradient(90deg, #FF9797, #FFC1E0);
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.title-right-bottom {
|
|
background: linear-gradient(90deg, #60F3FF, #088FEB);
|
|
}
|
|
|
|
.content-box {
|
|
background: #fff;
|
|
flex: 1;
|
|
display: flex;
|
|
overflow: scroll;
|
|
}
|
|
|
|
.content-left {
|
|
width: 170rpx;
|
|
background: #eee;
|
|
height: 100%;
|
|
overflow: scroll;
|
|
}
|
|
|
|
.left-box {
|
|
width: 100%;
|
|
height: 90rpx;
|
|
font-size: 30rpx;
|
|
text-align: center;
|
|
line-height: 90rpx;
|
|
border-bottom: 1px solid #fff;
|
|
}
|
|
|
|
.left-box-hover {
|
|
width: 100%;
|
|
height: 90rpx;
|
|
font-size: 30rpx;
|
|
text-align: center;
|
|
line-height: 90rpx;
|
|
border-bottom: 1px solid #fff;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.red {
|
|
border-right: 3px solid red;
|
|
}
|
|
|
|
.content-right {
|
|
width: 550rpx;
|
|
height: 78%;
|
|
overflow-y: scroll;
|
|
}
|
|
|
|
.right-box {
|
|
width: 100%;
|
|
height: 250rpx;
|
|
display: flex;
|
|
border-bottom: 1px solid #eee;
|
|
position: relative;
|
|
}
|
|
|
|
.box-left {
|
|
width: 130rpx;
|
|
height: 131rpx;
|
|
background-size: 100%;
|
|
margin: 25rpx 30rpx 35rpx 10rpx;
|
|
border-radius: 20rpx;
|
|
}
|
|
|
|
.box-left img {
|
|
width: 140rpx;
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
.box-right {
|
|
width: 100%;
|
|
margin-top: 17rpx;
|
|
}
|
|
|
|
.box-right-price {
|
|
width: 100%;
|
|
display: flex;
|
|
font-size: 25rpx;
|
|
}
|
|
|
|
.price-box {
|
|
width: 25%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
margin-top:10rpx;
|
|
}
|
|
.box-right-name {
|
|
font-size: 26rpx;
|
|
height: 50rpx;
|
|
line-height: 50rpx;
|
|
}
|
|
|
|
.box-right-num {
|
|
padding: 5rpx 0;
|
|
color: #000;
|
|
font-weight: bold;
|
|
font-size: 30rpx;
|
|
}
|
|
|
|
.price-box text:first-child {
|
|
color: #ffa200
|
|
}
|
|
|
|
.uni-mt-10 {
|
|
position: relative;
|
|
width: 100% !important;
|
|
float: left !important;
|
|
}
|
|
|
|
.uni-searchbar,
|
|
.uni-searchbar__box {
|
|
width: 100% !important;
|
|
padding: 5px 10px !important
|
|
}
|
|
|
|
.up-down {
|
|
position: absolute;
|
|
bottom: 10rpx;
|
|
left: 10rpx;
|
|
color: #fff;
|
|
background: #088FEB;
|
|
padding: 10rpx 10rpx;
|
|
border-radius: 5px;
|
|
width: 140rpx;
|
|
text-align: center;
|
|
}
|
|
.noPic{
|
|
border-radius: 10px;
|
|
width: 140rpx;
|
|
height: 140rpx;
|
|
// margin: 30rpx 0 0 30rpx;
|
|
text-align: center;
|
|
line-height: 140rpx;
|
|
color: #777;
|
|
background: #eee;
|
|
}
|
|
.popup-pay-content {
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 15px;
|
|
width: 500rpx;
|
|
height: auto;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.popup-pay-title {
|
|
font-size: 36rpx;
|
|
font-weight: bold;
|
|
text-align: center;
|
|
position: relative;
|
|
}
|
|
|
|
.popup-pay-container {
|
|
margin-top: 20rpx;
|
|
height: 100rpx;
|
|
border-radius: 10px;
|
|
background: #088FEB;
|
|
line-height: 100rpx;
|
|
text-align: center;
|
|
border-bottom: 1px solid #eee;
|
|
border-top: 1px solid #eee;
|
|
color: #fff;
|
|
}
|
|
.showImg-box{
|
|
width: 700rpx;
|
|
height: 1000rpx;
|
|
border-radius: 10px;
|
|
}
|
|
.swiper-box {
|
|
height: 1000rpx;
|
|
}
|
|
.swiper-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 1000rpx;
|
|
color: #fff;
|
|
background-color: #cee1fd;
|
|
border-radius: 10px;
|
|
}
|
|
.popup-photo{
|
|
height: 110rpx;
|
|
line-height: 110rpx;
|
|
text-align: center;
|
|
font-size: 36rpx;
|
|
font-weight: 800;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
.vue-ref{
|
|
padding-bottom:0 !important;
|
|
}
|
|
.shareBtn{
|
|
background: rgba(255, 255, 255, 0);
|
|
width: 90rpx;
|
|
height: 50;
|
|
height: 80rpx;
|
|
line-height: 80rpx;
|
|
border: 1px solid #fff;
|
|
background-color: rgba(255,255,255,0);
|
|
}
|
|
.shareBtn::after{
|
|
border: none;
|
|
}
|
|
.popup-photo{
|
|
height: 110rpx;
|
|
line-height: 110rpx;
|
|
text-align: center;
|
|
font-size: 36rpx;
|
|
font-weight: 800;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
@media screen and (min-width: 470px) {
|
|
|
|
/* 适配宽度为375px及以上的屏幕 */
|
|
.content-left {
|
|
height: 75% !important;
|
|
float: left;
|
|
position: fixed;
|
|
top: 25% !important;
|
|
}
|
|
|
|
}
|
|
.popup-content {
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 15px;
|
|
height: 1200rpx;
|
|
background-color: #fff;
|
|
margin-bottom: 80rpx;
|
|
overflow: scroll;
|
|
}
|
|
</style>
|