|
@ -2,20 +2,32 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="uni-flex" style="flex-direction: column"> |
|
|
<view class="uni-flex" style="flex-direction: column"> |
|
|
<itemFilter ref="filter" @onConfirmClick="confirm"> </itemFilter> |
|
|
<itemFilter ref="filter" @onConfirmClick="confirm"> </itemFilter> |
|
|
<view class="top" style=""> |
|
|
<view class="top" ref="topContent"> |
|
|
<com-blank-view @goScan="openScanPopup" v-if="itemCode == ''"></com-blank-view> |
|
|
<com-blank-view @goScan="openScanPopup" v-if="itemCode == ''"></com-blank-view> |
|
|
<item-info v-if="itemDetail" :itemdetail="itemDetail"></item-info> |
|
|
<item-info v-if="itemDetail" :itemdetail="itemDetail"></item-info> |
|
|
<z-tabs v-if="itemCode" :list="tabList" @change="tabChange" /> |
|
|
<z-tabs v-if="itemCode" :list="tabList" :current="tabIndex" @change="tabChange" /> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view style="padding-top: 230rpx; width: 100%"> |
|
|
<view :style="{'margin-top':topHeight+'px'}"> |
|
|
<view v-if="totalCount > 0" style="margin: 10rpx; font-size: 35rpx; font-weight: bold">总数 : {{ totalCount }} |
|
|
<view v-if="totalCount > 0" style="margin: 10rpx; font-size: 35rpx; font-weight: bold">总数 : {{ totalCount }} |
|
|
</view> |
|
|
</view> |
|
|
<view v-for="(item, index) in dataList" style="width: 100%" :key="index"> |
|
|
<view v-for="(item, index) in dataList" style="width: 100%" :key="index"> |
|
|
<view class="uni-flex uni-row" |
|
|
<view class="uni-flex uni-row" |
|
|
style="align-items: center; background-color: #fff; border-radius: 10rpx; margin: 10rpx"> |
|
|
style="align-items: center; background-color: #fff; border-radius: 10rpx; margin: 10rpx"> |
|
|
<view class="" style="font-size: 35rpx"> ({{ index + 1 }}) </view> |
|
|
<view class="" style="font-size: 35rpx"> ({{ index + 1 }}) </view> |
|
|
<comItemDetailCard :isShowPack="false" :dataContent="item" style="margin: 10rpx"> </comItemDetailCard> |
|
|
<comItemDetailCard |
|
|
|
|
|
:isShowPack="item.isShowPack" |
|
|
|
|
|
:isShowWarehouseCode="item.isShowWarehouseCode" |
|
|
|
|
|
:isShowJobNumber="item.isShowJobNumber" |
|
|
|
|
|
:isShowBusinessType="item.isShowBusinessType" |
|
|
|
|
|
:isShowTransactionType="item.isShowTransactionType" |
|
|
|
|
|
:isShowInventoryAction="item.isShowInventoryAction" |
|
|
|
|
|
:isShowRecordNumber="item.isShowRecordNumber" |
|
|
|
|
|
:isShowNumber="item.isShowNumber" |
|
|
|
|
|
:isShowWorker="item.isShowWorker" |
|
|
|
|
|
:dataContent="item" |
|
|
|
|
|
style='margin: 10rpx;'> |
|
|
|
|
|
</comItemDetailCard> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<uni-load-more :status="loadingType" v-if="dataList.length > 0" /> |
|
|
<uni-load-more :status="loadingType" v-if="dataList.length > 0" /> |
|
@ -29,7 +41,7 @@ |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { ref, getCurrentInstance, nextTick, onMounted, watch } from 'vue' |
|
|
import { ref, getCurrentInstance, nextTick, onMounted, watch } from 'vue' |
|
|
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' |
|
|
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' |
|
|
import { getExpectoutByItemcode, getExpectinByItemcode, getBalanceByItemCode, getBasicItemByCode, getBalanceSummary } from '@/api/request2.js' |
|
|
import { getExpectoutByItemcode, getExpectinByItemcode, getBalanceByItemCode, getBasicItemByCode, getBalanceSummary,getTransaction } from '@/api/request2.js' |
|
|
import { goHome } from '@/common/basic.js' |
|
|
import { goHome } from '@/common/basic.js' |
|
|
import itemInfo from '@/mycomponents/item/itemInfo.vue' |
|
|
import itemInfo from '@/mycomponents/item/itemInfo.vue' |
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
@ -42,7 +54,7 @@ |
|
|
const { proxy } = getCurrentInstance() |
|
|
const { proxy } = getCurrentInstance() |
|
|
|
|
|
|
|
|
const dataList = ref([]) |
|
|
const dataList = ref([]) |
|
|
const tabList = ref(['汇总', '明细', '预计入', '预计出']) |
|
|
const tabList = ref(['库存余额', '预计入', '预计出', '库存事务']) |
|
|
const tabIndex = ref(0) |
|
|
const tabIndex = ref(0) |
|
|
const itemDetail = ref(undefined) |
|
|
const itemDetail = ref(undefined) |
|
|
const itemCode = ref('') |
|
|
const itemCode = ref('') |
|
@ -57,6 +69,8 @@ |
|
|
const paging = ref() |
|
|
const paging = ref() |
|
|
const comMessageRef = ref() |
|
|
const comMessageRef = ref() |
|
|
const filter = ref() |
|
|
const filter = ref() |
|
|
|
|
|
const topHeight = ref(115) |
|
|
|
|
|
const topContent = ref(null) |
|
|
onNavigationBarButtonTap((e) => { |
|
|
onNavigationBarButtonTap((e) => { |
|
|
if (e.index === 0) { |
|
|
if (e.index === 0) { |
|
|
goHome() |
|
|
goHome() |
|
@ -107,6 +121,10 @@ |
|
|
closeScanPopup() |
|
|
closeScanPopup() |
|
|
itemCode.value = res.data.list[0].code |
|
|
itemCode.value = res.data.list[0].code |
|
|
itemDetail.value = res.data.list[0] |
|
|
itemDetail.value = res.data.list[0] |
|
|
|
|
|
nextTick(()=>{ |
|
|
|
|
|
topHeight.value = topContent.value.$el.clientHeight |
|
|
|
|
|
}) |
|
|
|
|
|
tabIndex.value = 0 |
|
|
tabChange(0) |
|
|
tabChange(0) |
|
|
} else { |
|
|
} else { |
|
|
showMessage(`未查找到物料【${code}】`) |
|
|
showMessage(`未查找到物料【${code}】`) |
|
@ -119,7 +137,7 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getSummary = (pageNo, pageSize, type) => { |
|
|
const getBalanceItem = (pageNo, pageSize, type) => { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中...", |
|
|
title: "加载中...", |
|
|
mask: true |
|
|
mask: true |
|
@ -130,7 +148,7 @@ |
|
|
dataList.value = []; |
|
|
dataList.value = []; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var filters = []; |
|
|
let filters = []; |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
column: "itemCode", |
|
|
column: "itemCode", |
|
|
action: "==", |
|
|
action: "==", |
|
@ -152,10 +170,11 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var params = { |
|
|
const params = { |
|
|
filters: filters, |
|
|
filters: filters, |
|
|
pageNo: pageNo.value, |
|
|
pageNo: pageNo.value, |
|
|
pageSize: pageSize |
|
|
pageSize: pageSize, |
|
|
|
|
|
sorts:[{sort:"locationCode",by:"ASC"},{sort:"batch",by:"ASC"} ,{sort:"id",by:"DESC"}], |
|
|
} |
|
|
} |
|
|
getBalanceByItemCode(params).then(res => { |
|
|
getBalanceByItemCode(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
@ -163,7 +182,11 @@ |
|
|
if (type === "refresh") { |
|
|
if (type === "refresh") { |
|
|
uni.stopPullDownRefresh(); |
|
|
uni.stopPullDownRefresh(); |
|
|
} |
|
|
} |
|
|
var list = res.data.list; |
|
|
let list = res.data.list; |
|
|
|
|
|
list.forEach(item=>{ |
|
|
|
|
|
item.isShowPack=true |
|
|
|
|
|
item.isShowWarehouseCode=true |
|
|
|
|
|
}) |
|
|
totalCount.value = res.data.total |
|
|
totalCount.value = res.data.total |
|
|
loadingType.value = "loadmore"; |
|
|
loadingType.value = "loadmore"; |
|
|
if (list == null || list.length == 0) { |
|
|
if (list == null || list.length == 0) { |
|
@ -174,7 +197,7 @@ |
|
|
item.packingNumber = "" |
|
|
item.packingNumber = "" |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
dataList.value = type === "refresh" ? list : dataList.value..valueconcat(list); |
|
|
dataList.value = type === "refresh" ? list : dataList.value.valueconcat(list); |
|
|
pageNo.value++; |
|
|
pageNo.value++; |
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
@ -184,7 +207,7 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
//明细 |
|
|
//明细 |
|
|
const getDetailList = (pageNo, pageSize, type) => { |
|
|
const getTransactionByItemCode = (pageNo, pageSize, type) => { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中...", |
|
|
title: "加载中...", |
|
|
mask: true |
|
|
mask: true |
|
@ -195,7 +218,7 @@ |
|
|
dataList.value = []; |
|
|
dataList.value = []; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var filters = []; |
|
|
let filters = []; |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
column: "itemCode", |
|
|
column: "itemCode", |
|
|
action: "==", |
|
|
action: "==", |
|
@ -217,18 +240,28 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var params = { |
|
|
const params = { |
|
|
filters: filters, |
|
|
filters: filters, |
|
|
pageNo: pageNo.value, |
|
|
pageNo: pageNo.value, |
|
|
pageSize: pageSize |
|
|
pageSize: pageSize |
|
|
} |
|
|
} |
|
|
getBalanceByItemCode(params).then(res => { |
|
|
getTransaction(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
|
if (type === "refresh") { |
|
|
if (type === "refresh") { |
|
|
uni.stopPullDownRefresh(); |
|
|
uni.stopPullDownRefresh(); |
|
|
} |
|
|
} |
|
|
var list = res.data.list; |
|
|
let list = res.data.list; |
|
|
|
|
|
list.forEach(item => { |
|
|
|
|
|
item.isShowPack = true |
|
|
|
|
|
item.isShowWarehouseCode = true |
|
|
|
|
|
item.isShowBusinessType = true |
|
|
|
|
|
item.isShowTransactionType = true |
|
|
|
|
|
item.isShowInventoryAction = true |
|
|
|
|
|
item.isShowRecordNumber = true |
|
|
|
|
|
item.isShowNumber = true |
|
|
|
|
|
item.isShowWorker = true |
|
|
|
|
|
}) |
|
|
totalCount.value = res.data.total |
|
|
totalCount.value = res.data.total |
|
|
loadingType.value = "loadmore"; |
|
|
loadingType.value = "loadmore"; |
|
|
if (list == null || list.length == 0) { |
|
|
if (list == null || list.length == 0) { |
|
@ -246,16 +279,16 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getContentByTab = (index, pageNo, pageSize, type) => { |
|
|
const getContentByTab = (index, pageNo, pageSize, type) => { |
|
|
if (index === 0) getSummary(pageNo, pageSize, type); |
|
|
if (index === 0) getBalanceItem(pageNo, pageSize, type); |
|
|
else if (index === 1) getDetailList(pageNo, pageSize, type); |
|
|
else if (index === 1) getExpectin(pageNo, pageSize, type); |
|
|
else if (index === 2) { |
|
|
else if (index === 2) { |
|
|
getExpectin(pageNo, pageSize, type); |
|
|
getExpectin(pageNo, pageSize, type); |
|
|
} else if (index == 3) { |
|
|
} else if (index == 3) { |
|
|
getExpectout(pageNo, pageSize, type); |
|
|
getTransactionByItemCode(pageNo, pageSize, type); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//预计入 |
|
|
//预计入 |
|
|
const getExpectin = (pageNo, pageSize, type) { |
|
|
const getExpectin = (pageNo, pageSize, type)=> { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "加载中...", |
|
|
title: "加载中...", |
|
|
mask: true |
|
|
mask: true |
|
@ -268,7 +301,7 @@ |
|
|
dataList.value = []; |
|
|
dataList.value = []; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var filters = []; |
|
|
let filters = []; |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
column: "itemCode", |
|
|
column: "itemCode", |
|
|
action: "==", |
|
|
action: "==", |
|
@ -290,10 +323,11 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var params = { |
|
|
const params = { |
|
|
filters: filters, |
|
|
filters: filters, |
|
|
pageNo: pageNo.value, |
|
|
pageNo: pageNo.value, |
|
|
pageSize: pageSize |
|
|
pageSize: pageSize, |
|
|
|
|
|
sorts:[{sort:"locationCode",by:"ASC"},{sort:"batch",by:"ASC"} ,{sort:"id",by:"DESC"}], |
|
|
} |
|
|
} |
|
|
getExpectinByItemcode(params).then(res => { |
|
|
getExpectinByItemcode(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
@ -301,7 +335,13 @@ |
|
|
if (type === "refresh") { |
|
|
if (type === "refresh") { |
|
|
uni.stopPullDownRefresh(); |
|
|
uni.stopPullDownRefresh(); |
|
|
} |
|
|
} |
|
|
var list = res.data.list; |
|
|
let list = res.data.list; |
|
|
|
|
|
list.forEach(item => { |
|
|
|
|
|
item.isShowPack = false |
|
|
|
|
|
item.isShowJobNumber = true |
|
|
|
|
|
item.isShowBusinessType = true |
|
|
|
|
|
item.isShowWarehouseCode = true |
|
|
|
|
|
}) |
|
|
totalCount.value = res.data.total |
|
|
totalCount.value = res.data.total |
|
|
loadingType.value = "loadmore"; |
|
|
loadingType.value = "loadmore"; |
|
|
if (list == null || list.length == 0) { |
|
|
if (list == null || list.length == 0) { |
|
@ -330,7 +370,7 @@ |
|
|
dataList.value = []; |
|
|
dataList.value = []; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var filters = []; |
|
|
let filters = []; |
|
|
filters.push({ |
|
|
filters.push({ |
|
|
column: "itemCode", |
|
|
column: "itemCode", |
|
|
action: "==", |
|
|
action: "==", |
|
@ -352,17 +392,24 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var params = { |
|
|
const params = { |
|
|
filters: filters, |
|
|
filters: filters, |
|
|
pageNo: pageNo.value, |
|
|
pageNo: pageNo.value, |
|
|
pageSize: pageSize |
|
|
pageSize: pageSize, |
|
|
|
|
|
sorts:[{sort:"locationCode",by:"ASC"},{sort:"batch",by:"ASC"} ,{sort:"id",by:"DESC"}], |
|
|
} |
|
|
} |
|
|
getExpectoutByItemcode(params).then(res => { |
|
|
getExpectoutByItemcode(params).then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
if (type === "refresh") { |
|
|
if (type === "refresh") { |
|
|
uni.stopPullDownRefresh(); |
|
|
uni.stopPullDownRefresh(); |
|
|
} |
|
|
} |
|
|
var list = res.data.list; |
|
|
let list = res.data.list; |
|
|
|
|
|
list.forEach(item => { |
|
|
|
|
|
item.isShowPack = true |
|
|
|
|
|
item.isShowJobNumber = true |
|
|
|
|
|
item.isShowBusinessType = true |
|
|
|
|
|
item.isShowWarehouseCode = true |
|
|
|
|
|
}) |
|
|
totalCount.value = res.data.total |
|
|
totalCount.value = res.data.total |
|
|
loadingType.value = "loadmore"; |
|
|
loadingType.value = "loadmore"; |
|
|
if (list == null || list.length == 0) { |
|
|
if (list == null || list.length == 0) { |
|
@ -407,6 +454,7 @@ |
|
|
} |
|
|
} |
|
|
tabChange(tabIndex.value) |
|
|
tabChange(tabIndex.value) |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
filter.value.clearData() |
|
|
showMessage("请先扫描物料") |
|
|
showMessage("请先扫描物料") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -418,15 +466,16 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.top { |
|
|
.top { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
position: fixed; |
|
|
position: fixed; |
|
|
/* #ifdef APP */ |
|
|
/* #ifdef APP */ |
|
|
top: 0rpx; |
|
|
top: 0rpx; |
|
|
/* #endif */ |
|
|
/* #endif */ |
|
|
|
|
|
|
|
|
/* #ifdef H5 */ |
|
|
/* #ifdef H5 */ |
|
|
top: 80rpx; |
|
|
top: 80rpx; |
|
|
/* #endif */ |
|
|
/* #endif */ |
|
|
|
|
|
|
|
|
right: 0; |
|
|
right: 0; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |