Browse Source

page/query 文件迁移 8/8-10/25

hella_vue3
王志国 3 weeks ago
parent
commit
302b6fca1c
  1. 107
      src/pages/query/item.vue
  2. 81
      src/pages/query/location.vue
  3. 16
      src/pages/query/pack.vue

107
src/pages/query/item.vue

@ -2,20 +2,32 @@
<template>
<view class="uni-flex" style="flex-direction: column">
<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>
<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 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>
<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>
<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>
<uni-load-more :status="loadingType" v-if="dataList.length > 0" />
@ -29,7 +41,7 @@
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick, onMounted, watch } from 'vue'
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 itemInfo from '@/mycomponents/item/itemInfo.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
@ -42,7 +54,7 @@
const { proxy } = getCurrentInstance()
const dataList = ref([])
const tabList = ref(['汇总', '明细', '预计入', '预计出'])
const tabList = ref(['库存余额', '预计入', '预计出', '库存事务'])
const tabIndex = ref(0)
const itemDetail = ref(undefined)
const itemCode = ref('')
@ -57,6 +69,8 @@
const paging = ref()
const comMessageRef = ref()
const filter = ref()
const topHeight = ref(115)
const topContent = ref(null)
onNavigationBarButtonTap((e) => {
if (e.index === 0) {
goHome()
@ -107,6 +121,10 @@
closeScanPopup()
itemCode.value = res.data.list[0].code
itemDetail.value = res.data.list[0]
nextTick(()=>{
topHeight.value = topContent.value.$el.clientHeight
})
tabIndex.value = 0
tabChange(0)
} else {
showMessage(`未查找到物料【${code}`)
@ -119,7 +137,7 @@
})
}
const getSummary = (pageNo, pageSize, type) => {
const getBalanceItem = (pageNo, pageSize, type) => {
uni.showLoading({
title: "加载中...",
mask: true
@ -130,7 +148,7 @@
dataList.value = [];
}
var filters = [];
let filters = [];
filters.push({
column: "itemCode",
action: "==",
@ -152,10 +170,11 @@
})
}
var params = {
const params = {
filters: filters,
pageNo: pageNo.value,
pageSize: pageSize
pageSize: pageSize,
sorts:[{sort:"locationCode",by:"ASC"},{sort:"batch",by:"ASC"} ,{sort:"id",by:"DESC"}],
}
getBalanceByItemCode(params).then(res => {
uni.hideLoading();
@ -163,7 +182,11 @@
if (type === "refresh") {
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
loadingType.value = "loadmore";
if (list == null || list.length == 0) {
@ -174,7 +197,7 @@
item.packingNumber = ""
})
dataList.value = type === "refresh" ? list : dataList.value..valueconcat(list);
dataList.value = type === "refresh" ? list : dataList.value.valueconcat(list);
pageNo.value++;
}).catch(error => {
@ -184,7 +207,7 @@
})
}
//
const getDetailList = (pageNo, pageSize, type) => {
const getTransactionByItemCode = (pageNo, pageSize, type) => {
uni.showLoading({
title: "加载中...",
mask: true
@ -195,7 +218,7 @@
dataList.value = [];
}
var filters = [];
let filters = [];
filters.push({
column: "itemCode",
action: "==",
@ -217,18 +240,28 @@
})
}
var params = {
const params = {
filters: filters,
pageNo: pageNo.value,
pageSize: pageSize
}
getBalanceByItemCode(params).then(res => {
getTransaction(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
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
loadingType.value = "loadmore";
if (list == null || list.length == 0) {
@ -246,16 +279,16 @@
}
const getContentByTab = (index, pageNo, pageSize, type) => {
if (index === 0) getSummary(pageNo, pageSize, type);
else if (index === 1) getDetailList(pageNo, pageSize, type);
if (index === 0) getBalanceItem(pageNo, pageSize, type);
else if (index === 1) getExpectin(pageNo, pageSize, type);
else if (index === 2) {
getExpectin(pageNo, pageSize, type);
} else if (index == 3) {
getExpectout(pageNo, pageSize, type);
getTransactionByItemCode(pageNo, pageSize, type);
}
}
//
const getExpectin = (pageNo, pageSize, type) {
const getExpectin = (pageNo, pageSize, type)=> {
uni.showLoading({
title: "加载中...",
mask: true
@ -268,7 +301,7 @@
dataList.value = [];
}
var filters = [];
let filters = [];
filters.push({
column: "itemCode",
action: "==",
@ -290,10 +323,11 @@
})
}
var params = {
const params = {
filters: filters,
pageNo: pageNo.value,
pageSize: pageSize
pageSize: pageSize,
sorts:[{sort:"locationCode",by:"ASC"},{sort:"batch",by:"ASC"} ,{sort:"id",by:"DESC"}],
}
getExpectinByItemcode(params).then(res => {
uni.hideLoading();
@ -301,7 +335,13 @@
if (type === "refresh") {
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
loadingType.value = "loadmore";
if (list == null || list.length == 0) {
@ -330,7 +370,7 @@
dataList.value = [];
}
var filters = [];
let filters = [];
filters.push({
column: "itemCode",
action: "==",
@ -352,17 +392,24 @@
})
}
var params = {
const params = {
filters: filters,
pageNo: pageNo.value,
pageSize: pageSize
pageSize: pageSize,
sorts:[{sort:"locationCode",by:"ASC"},{sort:"batch",by:"ASC"} ,{sort:"id",by:"DESC"}],
}
getExpectoutByItemcode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
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
loadingType.value = "loadmore";
if (list == null || list.length == 0) {
@ -407,6 +454,7 @@
}
tabChange(tabIndex.value)
} else {
filter.value.clearData()
showMessage("请先扫描物料")
}
}
@ -429,4 +477,5 @@
/* #endif */
right: 0;
}
</style>

81
src/pages/query/location.vue

@ -4,14 +4,26 @@
<view class="" style="width: 100%; position: fixed; top: 0; right: 0">
<com-blank-view @goScan="openScanPopup" v-if="locationCode == ''"></com-blank-view>
<location-info :locationDetail="locationDetail" v-if="locationCode"></location-info>
<z-tabs v-if="locationCode" :list="tabList" @change="tabChange" />
<z-tabs v-if="locationCode" :current="tabIndex" :list="tabList" @change="tabChange" />
</view>
<view style="padding-top: 200rpx; 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%">
<view style="padding-top: 280rpx; width: 100%">
<view v-if="totalCount > 0" style="margin-left: 10rpx;margin-bottom: 10rpx; font-size:35rpx; font-weight:bold">总数 : {{ totalCount }} </view>
<view v-for="(item, index) in dataList" :key="index" style="width: 100%">
<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>
<comLocationDetailCard :isShowPack="false" :dataContent="item" style="margin: 10rpx"> </comLocationDetailCard>
<comLocationDetailCard
: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;'>
</comLocationDetailCard>
</view>
</view>
<uni-load-more :status="loadingType" v-if="dataList.length > 0" />
@ -28,7 +40,7 @@
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick, onMounted, watch } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { getBalanceByLocationcode, getBalanceByLocationcodeGroup, getExpectInByLocationCode, getExpectOutByLocationCode } from '@/api/request2.js'
import { getBalanceByLocationcode, getTransaction, getExpectInByLocationCode, getExpectOutByLocationCode } from '@/api/request2.js'
import { maxPageSize, goHome } from '@/common/basic.js'
@ -54,7 +66,7 @@ const pageSize = ref(10)
const pageCurrent = ref(1)
//
const dataList = ref([])
const tabList = ref(['汇总', '明细', '预计入', '预计出'])
const tabList = ref(['库存余额', '预计入', '预计出', '库存事务'])
const tabIndex = ref(0)
const loadingType = ref('nomore')
const totalCount = ref(0)
@ -108,7 +120,7 @@ const getScanCode = (location, code) => {
// this.getContentByTab(this.tabIndex);
}
const getSummary = (pageNo, pageSize, type) => {
const getBalance = (pageNo, pageSize, type) => {
proxy.$modal.loading('加载中­....')
loadingType.value = 'loading'
if (type === 'refresh') {
@ -117,18 +129,26 @@ const getSummary = (pageNo, pageSize, type) => {
}
const params = {
locationCode: locationCode.value,
pageNo: pageNo.value,
pageSize
pageSize,
filters: [{
column: "locationCode",
action: "==",
value: locationCode.value
}],
sorts:[{sort:"createTime",by:"ASC"},{sort:"locationCode",by:"ASC"} ,{sort:"id",by:"DESC"}],
}
getBalanceByLocationcodeGroup(params)
getBalanceByLocationcode(params)
.then((res) => {
uni.hideLoading()
if (type === 'refresh') {
uni.stopPullDownRefresh()
}
const { list } = res.data
list.forEach(item => {
item.isShowPack = true
})
totalCount.value = res.data.total
loadingType.value = 'loadmore'
if (list == null || list.length == 0) {
@ -145,7 +165,7 @@ const getSummary = (pageNo, pageSize, type) => {
})
}
const getDetailList = (pageNo, pageSize, type) => {
const getTransactionFun = (pageNo, pageSize, type) => {
proxy.$modal.loading('加载中­....')
loadingType.value = 'loading'
if (type === 'refresh') {
@ -154,17 +174,32 @@ const getDetailList = (pageNo, pageSize, type) => {
}
const params = {
locationCode: locationCode.value,
pageNo: pageNo.value,
pageSize
pageSize,
filters: [{
column: "locationCode",
action: "==",
value: locationCode.value
}],
sorts:[{sort:"createTime",by:"DESC"},{sort:"locationCode",by:"ASC"} ,{sort:"id",by:"DESC"}]
}
getBalanceByLocationcode(params)
getTransaction(params)
.then((res) => {
uni.hideLoading()
if (type === 'refresh') {
uni.stopPullDownRefresh()
}
const { list } = res.data
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
loadingType.value = 'loadmore'
if (list == null || list.length == 0) {
@ -200,7 +235,8 @@ const getExpectin = (pageNo, pageSize, type) => {
action: '==',
value: locationCode.value
}
]
],
sorts:[{sort:"createTime",by:"ASC"},{sort:"locationCode",by:"ASC"} ,{sort:"id",by:"DESC"}]
}
getExpectInByLocationCode(params)
@ -210,6 +246,11 @@ const getExpectin = (pageNo, pageSize, type) => {
uni.stopPullDownRefresh()
}
const { list } = res.data
list.forEach(item => {
item.isShowPack = false
item.isShowJobNumber = true
item.isShowBusinessType = true
})
totalCount.value = res.data.total
loadingType.value = 'loadmore'
if (list == null || list.length == 0) {
@ -271,13 +312,13 @@ const getExpectOut = (pageNo, pageSize, type) => {
const getContentByTab = (index, pageNo, pageSize, type) => {
if (index === 0) {
getSummary(pageNo, pageSize, type)
getBalance(pageNo, pageSize, type)
} else if (index === 1) {
getDetailList(pageNo, pageSize, type)
} else if (index === 2) {
getExpectin(pageNo, pageSize, type)
} else if (index === 2) {
getExpectOut(pageNo, pageSize, type)
} else if (index == 3) {
getExpectin(pageNo, pageSize, type)
getTransactionFun(pageNo, pageSize, type)
}
}

16
src/pages/query/pack.vue

@ -39,7 +39,7 @@ import itemFilter from '@/mycomponents/item/itemFilter.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
const dataList = ref([])
const tabList = ref(['明细', '预计出'])
const tabList = ref(['库存余额', '预计出'])
const tabIndex = ref(0)
const packingNumber = ref('')
const itemDetail = ref(undefined)
@ -94,6 +94,7 @@ const getScanResult = (result) => {
return
}
packingNumber.value = result.label.packingNumber
closeScanPopup()
tabChange(0)
}
const getItemInfo = (code) => {
@ -159,7 +160,8 @@ const getSummary = (pageNo, pageSize, type) => {
const params = {
filters,
pageNo: pageNo.value,
pageSize
pageSize,
sorts:[{sort:"createTime",by:"ASC"},{sort:"locationCode",by:"ASC"} ,{sort:"id",by:"DESC"}]
}
getBalanceByItemCode(params)
.then((res) => {
@ -223,7 +225,8 @@ const getDetailList = (pageNo, pageSize, type) => {
const params = {
filters,
pageNo: pageNo.value,
pageSize
pageSize,
sorts:[{sort:"createTime",by:"ASC"},{sort:"locationCode",by:"ASC"} ,{sort:"id",by:"DESC"}]
}
getBalanceByItemCode(params)
.then((res) => {
@ -358,7 +361,8 @@ const getExpectout = (pageNo, pageSize, type) => {
const params = {
filters,
pageNo: pageNo.value,
pageSize
pageSize,
sorts:[{sort:"createTime",by:"ASC"},{sort:"locationCode",by:"ASC"} ,{sort:"id",by:"DESC"}]
}
getExpectoutByItemcode(params)
.then((res) => {
@ -383,6 +387,7 @@ const getExpectout = (pageNo, pageSize, type) => {
}
const showMessage = (message) => {
scanPopup.value && scanPopup.value.losefocus()
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
afterCloseMessage()
@ -391,7 +396,7 @@ const showMessage = (message) => {
}
const afterCloseMessage = () => {
if (scanPopup.value != undefined) {
if (scanPopup.value) {
scanPopup.value.getfocus()
}
}
@ -412,6 +417,7 @@ const confirm = (locationCode, status) => {
}
tabChange(tabIndex.value)
} else {
filter.value.clearData()
showMessage('请先扫描物料')
}
}

Loading…
Cancel
Save