|
@@ -1,24 +1,29 @@
|
|
|
<template>
|
|
|
<view class="moreShelfPart flex flex_column">
|
|
|
<view class="moreShelfPart-search">
|
|
|
- <u-search
|
|
|
- placeholder="请输入货位号/产品编码/产品名称搜索"
|
|
|
- v-model="queryWord"
|
|
|
- :show-action="isGobleSearch"
|
|
|
- @focus="isGobleSearch=true"
|
|
|
- @blur="isGobleSearch=false"
|
|
|
- @custom="searchPart"
|
|
|
- @search="searchPart"
|
|
|
- @clear="clearSearch"
|
|
|
- :action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': '#57a3f3', 'border-radius': '6upx', 'padding': '12upx 0'}">
|
|
|
- </u-search>
|
|
|
- <view class="p-title">
|
|
|
- <text></text>
|
|
|
- {{shelfInfo.shelfName}}
|
|
|
+ <view class="p-title flex align_center">
|
|
|
+ <view class="shelfName flex align_center"><text></text>{{shelfInfo.shelfName}}</view>
|
|
|
+ <view class="btns" @click="showTab = true">筛选<u-icon name="more-circle"></u-icon></view>
|
|
|
+ </view>
|
|
|
+ <view class="search flex align_center">
|
|
|
+ <view class="input">
|
|
|
+ <u-search
|
|
|
+ v-model="queryWord"
|
|
|
+ @input="change"
|
|
|
+ @custom="searchPart"
|
|
|
+ @search="searchPart"
|
|
|
+ @clear="clearSearch"
|
|
|
+ bg-color="#fff"
|
|
|
+ :action-style="{border:'0.1rpx solid #00aaff',borderRadius:'50rpx',color:'#00aaff'}"
|
|
|
+ placeholder="请输入货位号/产品编码/产品名称搜索"></u-search>
|
|
|
+ </view>
|
|
|
+ <view class="icon" @click="toScan">
|
|
|
+ <u-icon name="scan"></u-icon>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="moreShelfPart-body">
|
|
|
- <scroll-view class="nav-right" scroll-y @scrolltolower="onreachBottom">
|
|
|
+ <scroll-view class="nav-right" scroll-y>
|
|
|
<view class="partList-list-box" v-for="item in partList" :key="item.id">
|
|
|
<view class="product flex align_center">
|
|
|
<view class="flex align_center flex_1">
|
|
@@ -27,39 +32,51 @@
|
|
|
</view>
|
|
|
<view class="pinfo">
|
|
|
<view class="pname">
|
|
|
- <text>{{item.shelfPlaceCode}}</text>{{item.productEntity&&item.productEntity.productName}}
|
|
|
+ <text>{{item.shelfPlaceCode}}</text>{{item.productCode}}
|
|
|
+ </view>
|
|
|
+ <view class="pname pname1">
|
|
|
+ {{item.productName}}
|
|
|
</view>
|
|
|
<view class="ptxt flex align_center justify_between">
|
|
|
<view>
|
|
|
- <text class="pcode">{{item.productEntity&&item.productEntity.code}}</text>
|
|
|
+ 最大库容:<text class="pnums">{{item.maxQty}}{{item.productEntity&&item.productEntity.unit}}</text>
|
|
|
+ / 当前库存:<text class="pnums">{{item.qty}}{{item.productEntity&&item.productEntity.unit}}</text>
|
|
|
</view>
|
|
|
- <view>
|
|
|
- 库存数量:<text class="pnums">{{item.qty}}{{item.productEntity&&item.productEntity.unit}}</text>
|
|
|
+ <view v-if="item.qty" class="print" @click.stop="print(item)">
|
|
|
+ <u-image :src="`/static/${$config('themePath')}/icon_printer@3x.png`" width="45" height="45"></u-image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="ptools flex align_center justify_between">
|
|
|
- <view></view>
|
|
|
- <view class="print" @click="print(item)">
|
|
|
- <u-image :src="`/static/${$config('themePath')}/icon_printer@3x.png`" width="48" height="48"></u-image>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
<view v-if="partList&&partList.length==0">
|
|
|
<u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="240" :text="noDataText" mode="list" :margin-top="50"></u-empty>
|
|
|
</view>
|
|
|
- <view style="padding: 20upx;" v-if="total>pageSize || status=='loading'">
|
|
|
+ <view style="padding: 20upx;" v-if="status!='loadmore'">
|
|
|
<u-loadmore :status="status" />
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
+ <!-- 筛选项 -->
|
|
|
+ <u-popup v-model="showTab" mode="right" width="70%">
|
|
|
+ <view class="tabBox flex flex_column">
|
|
|
+ <view class="tabs">
|
|
|
+ <view class="flex">
|
|
|
+ <view :class="item==curTab?'active':''" v-for="item in placeTab" :key="item" @click="curTab=item">{{item}}层</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="btns">
|
|
|
+ <u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClear">重置</u-button>
|
|
|
+ <u-button class="handle-btn" shape="circle" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="clearSearch">查询</u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getShelfProductList } from '@/api/shelf'
|
|
|
+ import { queryShelfProductList,getProductPlace } from '@/api/shelf'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -69,7 +86,7 @@
|
|
|
pageNo:1,
|
|
|
pageSize: 10,
|
|
|
total: 0, // 列表总数
|
|
|
- noDataText: '暂无货架',
|
|
|
+ noDataText: '暂无数据',
|
|
|
status: 'loading',
|
|
|
vinstatus: 'loading',
|
|
|
shelfInfo: {
|
|
@@ -77,6 +94,14 @@
|
|
|
shelfName: ''
|
|
|
},
|
|
|
theme: '',
|
|
|
+ showTab: false,
|
|
|
+ placeTab: [],
|
|
|
+ curTab: '',
|
|
|
+ customBtnStyle: { // 自定义按钮样式
|
|
|
+ borderColor: this.$config('primaryColor'),
|
|
|
+ backgroundColor: this.$config('primaryColor'),
|
|
|
+ color: '#fff'
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
@@ -86,14 +111,55 @@
|
|
|
shelfName: options.shelfName
|
|
|
}
|
|
|
this.getpartList()
|
|
|
+ this.getShelfPlace()
|
|
|
+ },
|
|
|
+ // 批量打印
|
|
|
+ onNavigationBarButtonTap(e) {
|
|
|
+ const data = Object.assign(this.shelfInfo, {list:this.partList.filter(item => item.qty)})
|
|
|
+ console.log(data)
|
|
|
+ if(data.list.length){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/shelfSetting/batchPrint?page=bdtq&data="+encodeURIComponent(JSON.stringify(data))
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '没有可打印的产品',
|
|
|
+ duration: 5000
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ getShelfPlace(flag){
|
|
|
+ getProductPlace({ shelfSn: this.shelfInfo.shelfSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ for(let a in res.data){
|
|
|
+ this.placeTab.push(a)
|
|
|
+ }
|
|
|
+ if(!flag){
|
|
|
+ this.curTab = ''
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.placeTab = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleClear(){
|
|
|
+ this.curTab = ''
|
|
|
+ this.clearSearch()
|
|
|
+ },
|
|
|
+ // -------------------
|
|
|
clearSearch(){
|
|
|
this.queryWord = ''
|
|
|
this.pageNo = 1
|
|
|
this.partList = []
|
|
|
this.getpartList()
|
|
|
},
|
|
|
+ change(v){
|
|
|
+ if(v==''){
|
|
|
+ this.clearSearch()
|
|
|
+ }
|
|
|
+ },
|
|
|
// 搜索配件
|
|
|
searchPart(){
|
|
|
this.getpartList()
|
|
@@ -102,16 +168,15 @@
|
|
|
getpartList(){
|
|
|
const _this = this
|
|
|
let params = {
|
|
|
- pageNo: this.pageNo,
|
|
|
- pageSize: this.pageSize,
|
|
|
shelfSn: this.shelfInfo.shelfSn,
|
|
|
- queryWord: this.queryWord
|
|
|
+ queryWord: this.queryWord,
|
|
|
+ shelfPlaceCodeHead: this.curTab
|
|
|
}
|
|
|
_this.status = 'loading'
|
|
|
- getShelfProductList(params).then(res => {
|
|
|
+ queryShelfProductList(params).then(res => {
|
|
|
uni.hideLoading()
|
|
|
if(res.status == 200){
|
|
|
- let list = res.data.list
|
|
|
+ let list = res.data
|
|
|
console.log(list)
|
|
|
if (list && list.length){
|
|
|
// 分页 拼接数据
|
|
@@ -120,40 +185,79 @@
|
|
|
} else {
|
|
|
_this.partList = list
|
|
|
}
|
|
|
- this.total = res.data.count
|
|
|
- if (_this.partList.length == res.data.count) {
|
|
|
- _this.status = 'nomore'
|
|
|
- } else {
|
|
|
- _this.status = 'loadmore'
|
|
|
- }
|
|
|
+ _this.status = 'nomore'
|
|
|
} else {
|
|
|
_this.partList = list || []
|
|
|
- this.total = 0
|
|
|
- _this.status = 'nomore'
|
|
|
+ _this.status = 'loadmore'
|
|
|
}
|
|
|
- _this.noDataText = '暂无配件'
|
|
|
+ _this.noDataText = '没有搜索到产品'
|
|
|
}else{
|
|
|
_this.status = 'loadmore'
|
|
|
_this.partList = []
|
|
|
_this.total = 0
|
|
|
_this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
|
|
|
}
|
|
|
+ this.showTab = false
|
|
|
})
|
|
|
},
|
|
|
- // 加载更多
|
|
|
- onreachBottom () {
|
|
|
- if(this.partList.length < this.total ){
|
|
|
- if(this.isGobleSearch&&this.queryWord==''){
|
|
|
- return
|
|
|
+ print(data){
|
|
|
+ uni.navigateTo({ url: "/pages/common/printTag/printTag?page=bdtq&data="+JSON.stringify(data)})
|
|
|
+ },
|
|
|
+ // 扫描
|
|
|
+ toScan(){
|
|
|
+ this.mpaasScanModule = uni.requireNativePlugin("wss-scan")
|
|
|
+ this.mpaasScanModule.scan(
|
|
|
+ {
|
|
|
+ "scanMode":"Customized",
|
|
|
+ "scanStyle":{
|
|
|
+ "scanFrameSizePlus":{"width":250,"height":250},
|
|
|
+ "scanFrameSize":200,
|
|
|
+ "scanLight":"visible",
|
|
|
+ "scanText":"对准条形码/二维码进行识别",
|
|
|
+ "scanTitle":"扫码打印",
|
|
|
}
|
|
|
- this.pageNo++
|
|
|
- this.getpartList()
|
|
|
+ },
|
|
|
+ (result) => {
|
|
|
+ console.log(result)
|
|
|
+ if(result.scanStatus == 1){
|
|
|
+ this.scanResult(result)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 扫描结果
|
|
|
+ scanResult(data){
|
|
|
+ const params = {
|
|
|
+ shelfSn: this.shelfInfo.shelfSn,
|
|
|
+ }
|
|
|
+ // 二维码
|
|
|
+ if(data.scanType == 'QRCODE'){
|
|
|
+ const ret = data.scanValue.split("&")
|
|
|
+ params.queryWord = ret[1] // 产品编码
|
|
|
}else{
|
|
|
- this.status = "nomore"
|
|
|
+ params.qrCode = data.scanValue
|
|
|
}
|
|
|
- },
|
|
|
- print(data){
|
|
|
- uni.navigateTo({ url: "/pages/common/printTag/printTag?page=bdtq&data="+JSON.stringify(data) })
|
|
|
+ queryShelfProductList(params).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if(res.status == 200){
|
|
|
+ if(res.data&&res.data.length){
|
|
|
+ if(res.data[0].qty){
|
|
|
+ this.print(res.data[0])
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "产品库存不足,不能打印",
|
|
|
+ duration: 5000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "产品不属于此货架,请重新扫描",
|
|
|
+ duration: 5000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -164,23 +268,49 @@
|
|
|
width: 100%;
|
|
|
height: 100vh;
|
|
|
.moreShelfPart-search{
|
|
|
- padding: 20rpx 20rpx 0;
|
|
|
+ padding: 0 10rpx;
|
|
|
background-color: #FFFFFF;
|
|
|
border-bottom: 2rpx solid #f5f5f5;
|
|
|
}
|
|
|
.p-title{
|
|
|
- padding: 20rpx;
|
|
|
+ padding: 0 20rpx;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
color: #222;
|
|
|
font-size: 32rpx;
|
|
|
- text{
|
|
|
- display: block;
|
|
|
- height: 32rpx;
|
|
|
- width: 6rpx;
|
|
|
- background: #0485F6;
|
|
|
- margin-right: 10rpx;
|
|
|
- border-radius: 10rpx;
|
|
|
+ .shelfName{
|
|
|
+ width: 80%;
|
|
|
+ flex-grow: 1;
|
|
|
+ font-weight: bold;
|
|
|
+ text{
|
|
|
+ display: block;
|
|
|
+ height: 30rpx;
|
|
|
+ width: 6rpx;
|
|
|
+ background: #0485F6;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btns{
|
|
|
+ width:100rpx;
|
|
|
+ text-align: right;
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .search{
|
|
|
+ padding: 0.5rem;
|
|
|
+ .input{
|
|
|
+ flex-grow: 1;
|
|
|
+ border:0.1rpx solid #eee;
|
|
|
+ padding: 0.1rpx;
|
|
|
+ border-radius: 50rpx;
|
|
|
+ padding-right: 10rpx;
|
|
|
+ }
|
|
|
+ .icon{
|
|
|
+ width: 10%;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 50rpx;
|
|
|
+ color: #999;
|
|
|
}
|
|
|
}
|
|
|
.moreShelfPart-body{
|
|
@@ -188,7 +318,7 @@
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
.nav-right{
|
|
|
- height: calc(100vh - 180rpx);
|
|
|
+ height: calc(100vh - 160rpx);
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
.partList-list-box{
|
|
@@ -206,20 +336,22 @@
|
|
|
flex-grow: 1;
|
|
|
padding-left: 20rpx;
|
|
|
.pname{
|
|
|
- font-size: 32rpx;
|
|
|
color: #191919;
|
|
|
- font-weight: bold;
|
|
|
margin-bottom: 10rpx;
|
|
|
text{
|
|
|
font-weight: normal;
|
|
|
margin-right: 6rpx;
|
|
|
- padding: 0 10rpx;
|
|
|
+ padding: 0 20rpx;
|
|
|
background: rgba(3, 54, 146, 0.15);
|
|
|
border-radius: 100rpx;
|
|
|
color: #033692;
|
|
|
- font-size: 28rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
}
|
|
|
}
|
|
|
+ .pname1{
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
.pno{
|
|
|
background-color: rgba(3, 54, 146, 0.15);
|
|
|
border-radius: 50rpx;
|
|
@@ -237,11 +369,40 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .ptools{
|
|
|
- margin-top: 20rpx;
|
|
|
- .print{
|
|
|
- padding: 0 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 筛选
|
|
|
+ .tabBox{
|
|
|
+ height: 100vh;
|
|
|
+ .tabs{
|
|
|
+ flex-grow: 1;
|
|
|
+ overflow: auto;
|
|
|
+ padding: 20rpx;
|
|
|
+ > view{
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: space-between;
|
|
|
+ > view{
|
|
|
+ width: 45%;
|
|
|
+ border: 0.1rpx solid #eee;
|
|
|
+ padding: 15rpx;
|
|
|
+ border-radius: 50rpx;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 15rpx;
|
|
|
}
|
|
|
+ .active{
|
|
|
+ border:0;
|
|
|
+ background-color: #0485F6;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btns{
|
|
|
+ display: flex;
|
|
|
+ padding: 20upx;
|
|
|
+ justify-content: space-between;
|
|
|
+ .handle-btn {
|
|
|
+ font-size: 28upx;
|
|
|
}
|
|
|
}
|
|
|
}
|