Browse Source

添加按包装号查询库存

hella_online_20240829
lijuncheng 4 months ago
parent
commit
5f0de76cb8
  1. 13
      src/mycomponents/scan/winScanItem.vue
  2. 30
      src/pages.json
  3. 101
      src/pages/query/coms/comPackDetailCard.vue
  4. 18
      src/pages/query/item.vue
  5. 456
      src/pages/query/pack.vue

13
src/mycomponents/scan/winScanItem.vue

@ -83,11 +83,6 @@
closeScanPopup() {
this.$refs.popup.close()
},
getfocus() {
if (this.isShow) {
this.$refs.scan.getfocus()
}
},
scanClick() {
this.$refs.scan.clickScanMsg();
},
@ -159,10 +154,14 @@
})
},
getfocus() {
this.$refs.scan.getfocus();
if(this.$refs.scan){
this.$refs.scan.getfocus();
}
},
losefocus() {
this.$refs.scan.losefocus();
if(this.$refs.scan){
this.$refs.scan.losefocus();
}
},
}

30
src/pages.json

@ -82,6 +82,36 @@
}
}
},
{
"path": "pages/query/pack",
"style": {
"enablePullDownRefresh": true, //
"navigationBarTitleText": "按包装号查询库存",
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/query/location",
"style": {

101
src/pages/query/coms/comPackDetailCard.vue

@ -0,0 +1,101 @@
<template>
<view class="" style="width: 100%; background-color: #fff; border-radius: 10rpx;">
<view class="uni-flex uni-row space-between" style="align-items: center;">
<view>
<view class="uni-flex uni-row" style="align-items: center;">
<text style="font-size: 30rpx; margin-left: 15rpx;">物料</text>
<item :dataContent="dataContent" style="padding-top: 10rpx; margin-left: 20rpx;"></item>
</view>
<pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
<pack v-if=" dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location :locationCode="dataContent.locationCode"></location>
<view class="" v-if="dataContent.jobNumber"
style="font-size: 30rpx; padding-left: 10rpx ; padding-bottom: 10rpx;">
<text style="color: coral; ">任务号</text>
{{dataContent.jobNumber}}
</view>
<view class="" v-if="dataContent.businessType"
style="font-size: 30rpx; padding-left: 10rpx ; padding-bottom: 10rpx;">
<text style="color:green; ">业务类型</text>
{{businessTypeDesc(dataContent.businessType)}}
</view>
</view>
<view class="uni-flex" style="flex-direction: column;">
<view class="uni-flex uni-row center">
<qty :dataContent="dataContent" :isShowStdPack="isShowStdPack" :isShowStatus="true"></qty>
</view>
</view>
</view>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import item from '@/mycomponents/item/item.vue'
import pack from '@/mycomponents/balance/pack.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qty from '@/mycomponents/qty/qty.vue'
import status from '@/mycomponents/status/status.vue'
import location from '@/mycomponents/balance/location.vue'
import {
getBusinessTypeName,
} from '@/common/directory.js';
export default {
components: {
itemQty,
item,
pack,
batch,
qty,
status,
location,
},
data() {
return {
};
},
props: {
dataContent: {
type: Object,
default: null,
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
},
},
methods: {
businessTypeDesc(type) {
return getBusinessTypeName(type)
},
}
}
</script>
<style>
</style>

18
src/pages/query/item.vue

@ -415,7 +415,7 @@
});
},
afterCloseMessage() {
if (this.$refs.scanPopup != undefined) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus();
}
},
@ -425,14 +425,18 @@
},
confirm(locationCode, status) {
this.locationCode = locationCode;
if(status.length>0){
var arrayItems = status.join(',')
this.inventoryStatus = arrayItems
if(this.itemCode){
this.locationCode = locationCode;
if(status.length>0){
var arrayItems = status.join(',')
this.inventoryStatus = arrayItems
}else {
this.inventoryStatus=""
}
this.tabChange(this.tabIndex)
}else {
this.inventoryStatus=""
this.showMessage("请先扫描物料")
}
this.tabChange(this.tabIndex)
}
}
}

456
src/pages/query/pack.vue

@ -0,0 +1,456 @@
<!-- 基于z-paging封装个性化分页组件演示(vue) -->
<template>
<view class="uni-flex" style="flex-direction: column">
<itemFilter ref="filter" @onConfirmClick="confirm">
</itemFilter>
<view class="top" style="">
<com-blank-view @goScan='openScanPopup' v-if="packingNumber==''"></com-blank-view>
<z-tabs v-if="packingNumber" :list="tabList" @change="tabChange" />
</view>
<view style="padding-top: 100rpx;width:100%">
<view v-if="totalCount>0" style="margin:10rpx; font-size:35rpx; font-weight:bold">总数 : {{totalCount}}
</view>
<view v-for="(item, index) in dataList" style="width:100%" :key="index">
<view class="uni-flex uni-row"
style=" align-items: center; background-color: #fff; border-radius:10rpx;margin:10rpx; ">
<view class="" style="font-size:35rpx; ">
({{index+1}})
</view>
<comPackDetailCard :isShowPack="false" :dataContent="item" style='margin: 10rpx;'>
</comPackDetailCard>
</view>
</view>
<uni-load-more :status="loadingType" v-if="dataList.length>0" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="packingNumber!=''"></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ"></win-scan-pack>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getExpectoutByItemcode,
getExpectinByItemcode,
getBalanceByItemCode,
getBasicItemByCode,
getBalanceSummary
} from '@/api/request2.js';
import {
goHome
} from '@/common/basic.js';
import itemInfo from '@/mycomponents/item/itemInfo.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comPackDetailCard from '@/pages/query/coms/comPackDetailCard.vue'
import itemFilter from '@/mycomponents/item/itemFilter.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
export default {
components: {
itemInfo,
comBlankView,
winScanPack,
winScanButton,
comPackDetailCard,
itemFilter,
comEmptyView
},
data() {
return {
//v-model
dataList: [],
tabList: ['明细', '预计出'],
tabIndex: 0,
itemDetail: undefined,
packingNumber: '',
balances: [],
loadingType: "nomore",
totalCount: 0,
locationCode: "",
inventoryStatus: "",
pageSize:10
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
onReachBottom() {
console.log("底部")
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getContentByTab(this.tabIndex, this.pageNo, this.pageSize, "more");
},
onLoad(option){
uni.setNavigationBarTitle({
title: option.title
})
},
mounted() {
this.openScanPopup();
},
onPullDownRefresh() {
this.getContentByTab(this.tabIndex, this.pageNo, this.pageSize, "refresh");
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
getScanResult(result) {
if (!result.label.packingNumber ) {
this.showMessage('包装号不能为空')
return;
}
this.packingNumber =result.label.packingNumber ;
this.tabChange(0)
},
getItemInfo(code) {
uni.showLoading({
title: "正在查询物料信息...",
mask: true
});
getBasicItemByCode(code).then(res => {
uni.hideLoading();
if (res.data.list.length > 0) {
this.closeScanPopup();
this.packingNumber = res.data.list[0].code;
this.itemDetail = res.data.list[0];
this.tabChange(0)
} else {
this.showMessage('未查找到物料【' + code + '】');
}
}).catch(error => {
uni.hideLoading();
this.packingNumber = "";
this.showMessage(error);
})
},
//
getSummary(pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var filters = [];
filters.push({
column: "packingNumber",
action: "==",
value: this.packingNumber
})
if (this.locationCode) {
filters.push({
column: "locationCode",
action: "==",
value: this.locationCode
})
}
if (this.inventoryStatus) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.inventoryStatus
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: pageSize
}
getBalanceByItemCode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.dataList = type === "refresh" ? list : this.dataList.concat(list);
this.pageNo++;
}).catch(error => {
this.$refs.paging.complete(false);
uni.hideLoading();
this.showMessage(error);
})
},
//
getDetailList(pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var filters = [];
filters.push({
column: "packingNumber",
action: "==",
value: this.packingNumber
})
if (this.locationCode) {
filters.push({
column: "locationCode",
action: "==",
value: this.locationCode
})
}
if (this.inventoryStatus) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.inventoryStatus
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: pageSize
}
getBalanceByItemCode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.dataList = type === "refresh" ? list : this.dataList.concat(list);
this.pageNo++;
}).catch(error => {
uni.hideLoading();
this.showMessage(error);
})
},
getContentByTab(index, pageNo, pageSize, type) {
if (index === 0) this.getDetailList(pageNo, pageSize, type);
else if (index === 1) this.getExpectout(pageNo, pageSize, type);
else if (index === 2) {
// this.getExpectout(pageNo, pageSize, type);
}
},
//
getExpectin(pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var filters = [];
filters.push({
column: "packingNumber",
action: "==",
value: this.packingNumber
})
if (this.locationCode) {
filters.push({
column: "locationCode",
action: "==",
value: this.locationCode
})
}
if (this.inventoryStatus) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.inventoryStatus
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: pageSize
}
getExpectinByItemcode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.dataList = type === "refresh" ? list : this.dataList.concat(list);
this.pageNo++;
}).catch(error => {
uni.hideLoading();
this.showMessage(error);
})
},
//
getExpectout(pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.dataList = [];
}
var filters = [];
filters.push({
column: "packingNumber",
action: "==",
value: this.packingNumber
})
if (this.locationCode) {
filters.push({
column: "locationCode",
action: "==",
value: this.locationCode
})
}
if (this.inventoryStatus) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.inventoryStatus
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: pageSize
}
getExpectoutByItemcode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.dataList = type === "refresh" ? list : this.dataList.concat(list);
this.pageNo++;
}).catch(error => {
uni.hideLoading();
this.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
afterCloseMessage() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
tabChange(index) {
this.tabIndex = index;
this.getContentByTab(index, this.pageNo, this.pageSize, "refresh")
},
confirm(locationCode, status) {
if(this.packingNumber){
this.locationCode = locationCode;
if(status.length>0){
var arrayItems = status.join(',')
this.inventoryStatus = arrayItems
}else {
this.inventoryStatus=""
}
this.tabChange(this.tabIndex)
}else {
this.showMessage("请先扫描物料")
}
}
}
}
</script>
<style scoped lang="scss">
page {
height: 100%;
}
.top{
width: 100%;
position: fixed;
/* #ifdef APP */
top: 0rpx;
/* #endif */
/* #ifdef H5 */
top: 80rpx;
/* #endif */
right: 0;
}
</style>
Loading…
Cancel
Save