Browse Source

修改查询物料号添加库位和状态,修改扫描后清空2024/7/9 18:33:31

hella_vue3
zhang_li 3 months ago
parent
commit
e859de7dd4
  1. 16
      src/api/request2.js
  2. 16
      src/common/basic.js
  3. 27
      src/common/directory.js
  4. 8
      src/mycomponents/balance/bussinessType.vue
  5. 119
      src/mycomponents/item/itemFilter.vue
  6. 4
      src/mycomponents/scan/winCheckFgLabel.vue
  7. 82
      src/mycomponents/scan/winScanAsnNumber.vue
  8. 2
      src/mycomponents/scan/winScanContainer.vue
  9. 3
      src/mycomponents/scan/winScanItem.vue
  10. 86
      src/mycomponents/scan/winScanJobNumber.vue
  11. 25
      src/pages.json
  12. 8
      src/pages/index/index.vue
  13. 5
      src/pages/query/coms/comItemBalance.vue
  14. 59
      src/pages/query/coms/comItemDetailCard.vue
  15. 6
      src/pages/query/coms/comLocationDetailCard.vue
  16. 544
      src/pages/query/item.vue

16
src/api/request2.js

@ -145,12 +145,12 @@ export function getBusinesstypeByCode(code) {
return http.get("/wms/businesstype/page",{params}) return http.get("/wms/businesstype/page",{params})
} }
/** /**
* 按物料代码查询库存明细 * 按物品查询库存
* @param {*} itemCode * @param {*} itemCode
* *
*/ */
export function getBalanceByItemCode(params) { export function getBalanceByItemCode(params) {
return http.get("/wms/balance/page",{params}) return http.post("/wms/balance/seniorAll",params)
} }
/** /**
* 按物品查询预计入 * 按物品查询预计入
@ -159,7 +159,7 @@ export function getBalanceByItemCode(params) {
*/ */
export function getExpectinByItemcode(params) { export function getExpectinByItemcode(params) {
return http.get("/wms/expectin/page",{params}) return http.post("/wms/expectin/senior",params)
} }
/** /**
* 按物品查询预计出 * 按物品查询预计出
@ -168,7 +168,7 @@ export function getExpectinByItemcode(params) {
*/ */
export function getExpectoutByItemcode(params) { export function getExpectoutByItemcode(params) {
return http.get("/wms/expectout/page",{params}) return http.post("/wms/expectout/senior",params)
} }
/** /**
* 按库位查询库存汇总 * 按库位查询库存汇总
@ -2615,3 +2615,11 @@ export function getJimuPutawayJobDetail(data) {
export function getBalanceByParams(data) { export function getBalanceByParams(data) {
return http.post("/wms/balance/getBalanceListByPackage",data) return http.post("/wms/balance/getBalanceListByPackage",data)
} }
/**
* 获取业务类型
* @param {*}
*/
export function getBusinessType() {
return http.get("/wms/businesstype/page?pageSize=1000&pageNo=1)
}

16
src/common/basic.js

@ -18,6 +18,7 @@ let unplannedIissueReason = [];
let scrapReasonList = []; let scrapReasonList = [];
let inspectFailedReasonList = []; let inspectFailedReasonList = [];
let switchList=[] let switchList=[]
let businessList=[]
@ -355,6 +356,21 @@ export function getSwitchInfoByCode(code) {
return isCheck; return isCheck;
} }
//获取业务类型名称
export function getBusinessTypeName(code) {
var resultInfo = null
if (businessList.length == 0) {
businessList = uni.getStorageSync("businessType")
}
for (let item of businessList) {
if (item.code == code) {
resultInfo = item
break;
}
}
return resultInfo.name;
}

27
src/common/directory.js

@ -20,6 +20,7 @@ let sampleMethodList = [];
let transferModeList = []; let transferModeList = [];
let countStageList = []; let countStageList = [];
let locationAreaTypeList = []; let locationAreaTypeList = [];
let businessList=[]
@ -59,7 +60,8 @@ export function clearCacheData() {
sampleMethodList = []; sampleMethodList = [];
transferModeList = []; transferModeList = [];
countStageList = []; countStageList = [];
locationAreaTypeList=[] locationAreaTypeList=[];
businessList=[]
} }
//获取字典信息 //获取字典信息
@ -225,6 +227,21 @@ export function getItemStateInfo(value) {
return resultInfo return resultInfo
} }
//获取业务类型名称
export function getBusinessTypeName(code) {
var resultInfo = null
if (businessList.length == 0) {
businessList = uni.getStorageSync("businessType")
}
for (let item of businessList) {
if (item.code == code) {
resultInfo = item
break;
}
}
return resultInfo.name;
}
//获取库区类型 //获取库区类型
export function getLocationAreaTypeInfo(value) { export function getLocationAreaTypeInfo(value) {
var resultInfo = ""; var resultInfo = "";
@ -334,7 +351,13 @@ export function getRequestStateInfo(value) {
} }
return resultInfo return resultInfo
} }
//获取库存状态集合
export function getInventoryStatusList() {
if (inventoryStatusList.length == 0) {
inventoryStatusList = getDirectoryInfo("inventory_status")
}
return inventoryStatusList
}
//获取库存状态 //获取库存状态
export function getInventoryStatusInfo(value) { export function getInventoryStatusInfo(value) {

8
src/mycomponents/balance/bussinessType.vue

@ -1,12 +1,12 @@
<template> <template>
<view class="card_view"> <view class="card_view">
<text class="card_business">{{ businessTypeDesc(bussinessType) }}</text> <text class="card_business">业务类型</text>
<text class="card_business_content">{{ number }}</text> <text class="card_business_content">{{ businessTypeDesc(bussinessType) }}</text>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getBusinessTypeDesc } from '@/common/directory.js' import { getBusinessTypeName } from '@/common/directory.js'
const props = defineProps({ const props = defineProps({
bussinessType: { bussinessType: {
@ -19,7 +19,7 @@ const props = defineProps({
} }
}) })
const businessTypeDesc = (type) => { const businessTypeDesc = (type) => {
return getBusinessTypeDesc(type) return getBusinessTypeName(type)
} }
</script> </script>

119
src/mycomponents/item/itemFilter.vue

@ -0,0 +1,119 @@
<template>
<u-popup v-model="show" @click="show = false" mode="right" width="450rpx">
<view class="maskbox" @tap="maskClick"></view>
<view class="uni-flex uni-column center" style="background-color: white; width: 200px; height: auto; padding: 20rpx; z-index: 100; position: relative; top: 100rpx; right: 20rpx; left: 30rpx; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); border-radius: 10rpx">
<view class="uni-flex" style="justify-content: center; font-size: 35rpx; font-weight: bold"> 筛选条件 </view>
<view class="uni-flex" style="flex-direction: column; width: 100%; margin-top: 10rpx">
<view class="" style="font-size: 35rpx; margin-bottom: 10rpx"> 库位 </view>
<u-input style="margin-left: 0rpx" confirmType="search" v-model="locationCode" :border="true" placeholder="请输入库位" :focus="true" />
</view>
<view class="" style="font-size: 35rpx; margin-top: 10rpx; margin-bottom: 10rpx">
库存状态 :
<uni-data-checkbox mode="tag" multiple v-model="state" :localdata="stateList"></uni-data-checkbox>
</view>
<view class="" style="margin-top: 30rpx; margin-left: 30rpx; margin-right: 30rpx">
<button type="primary" size="default" @click="confirm">确认</button>
</view>
</view>
</u-popup>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { getTodayDate } from '@/common/basic.js'
import { getInventoryStatusList } from '@/common/directory.js'
const props = defineProps({
checkedToday: {
type: Boolean,
default: false
},
checkedWaitTask: {
type: Boolean,
default: false
},
otherTitle: {
type: String,
default: ''
},
isShowAsn: {
type: Boolean,
default: false
},
isShowJob: {
type: Boolean,
default: true
},
isShowFromLocationCode: {
type: Boolean,
default: false
},
isShowProductionLineCode: {
type: Boolean,
default: false
},
productionline: {
type: Array,
default: []
}
})
const stateList = ref([])
const state = ref([])
const show = ref(false)
const scanNumber = ref()
const locationCode = ref()
//
const maskClick = () => {
//
closeScanPopup()
}
const openFilter = () => {
stateList.value = getInventoryStatusList()
stateList.value.forEach((res) => {
res.text = res.label
})
show.value = true
}
const closeScanPopup = () => {
show.value = false
}
const switchChangeToday = (isOn) => {
let creationTime = ''
if (isOn) {
creationTime = getTodayDate()
}
emit('switchChangeToday', isOn, creationTime)
closeScanPopup()
}
const scanNumberClick = () => {
scanNumber.value.openScanPopup()
}
const scanOtherClick = () => {
scanAsnNumber.value.openScanPopup()
}
const confirm = () => {
emit('onConfirmClick', locationCode.value, state.value)
closeScanPopup()
}
//
const emit = defineEmits(['onConfirmClick', 'switchChangeToday'])
</script>
<style lang="scss">
.maskbox {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 0;
}
</style>

4
src/mycomponents/scan/winCheckFgLabel.vue

@ -13,13 +13,13 @@
<view class=""> <view class="">
<view class="" style="position: relative"> <view class="" style="position: relative">
<win-com-scan ref="comscanFgLabel" placeholder="WMS制品标签" @getResult="getScanFgResult" :isShowHistory="false" :clearResult="false" :headerType="headerType"></win-com-scan> <win-com-scan ref="comscanFgLabel" placeholder="WMS制品标签" @getResult="getScanFgResult" :isShowHistory="false" :clearResult="true" :headerType="headerType"></win-com-scan>
<view class="uni-flex" style="position: absolute; color: #3c9cff; font-weight: bold; font-size: 15px; left: 10px; bottom: 10px; z-index: 999"> <view class="uni-flex" style="position: absolute; color: #3c9cff; font-weight: bold; font-size: 15px; left: 10px; bottom: 10px; z-index: 999">
{{ itemCode }} {{ itemCode }}
</view> </view>
</view> </view>
<view class=""> <view class="">
<win-com-scan-customer-label ref="comscanCustomerLabel" placeholder="客户标签" @getResult="getScanCustomerResult" :isShowHistory="false" :clearResult="false" :headerType="headerType"></win-com-scan-customer-label> <win-com-scan-customer-label ref="comscanCustomerLabel" placeholder="客户标签" @getResult="getScanCustomerResult" :isShowHistory="false" :clearResult="true" :headerType="headerType"></win-com-scan-customer-label>
</view> </view>
</view> </view>
</view> </view>

82
src/mycomponents/scan/winScanAsnNumber.vue

@ -1,20 +1,16 @@
<template> <template>
<view class=""> <view class="">
<u-popup v-model="isShow" mode='bottom'> <u-popup v-model="isShow" mode="bottom">
<view class="popup_box"> <view class="popup_box">
<view class="pop_title uni-flex space-between"> <view class="pop_title uni-flex space-between">
<view class=""> 扫描{{ title }} </view>
<view class=""> <view class="">
扫描{{title}} <image class="icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()"></image>
</view>
<view class="">
<image class=" icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view> </view>
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false" :isShowHistory="false"> <win-com-scan ref="scan" @getResult="getScanResult" :placeholder="title" :clearResult="false" :isShowHistory="false"> </win-com-scan>
</win-com-scan>
</view> </view>
</view> </view>
</view> </view>
@ -23,12 +19,10 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import { ref, getCurrentInstance } from 'vue'
ref, import winComScan from '@/mycomponents/scan/winComScan.vue'
getCurrentInstance
} from 'vue' const props = defineProps({
import winComScan from '@/mycomponents/scan/winComScan.vue'
const props = defineProps({
title: { title: {
type: String, type: String,
default: '' default: ''
@ -37,47 +31,45 @@
type: Boolean, type: Boolean,
default: true default: true
} }
}) })
const code = ref('') const code = ref('')
const isShow = ref(false) const isShow = ref(false)
const expand = ref(false) const expand = ref(false)
const scanList = ref([]) const scanList = ref([])
const expendIcon = ref('arrow-down') const expendIcon = ref('arrow-down')
const scan = ref() const scan = ref()
const openScanPopup = () => { const openScanPopup = () => {
setTimeout(res => { setTimeout((res) => {
isShow.value = true isShow.value = true
}, 500) }, 500)
} }
const closeScanPopup = () => { const closeScanPopup = () => {
isShow.value = false isShow.value = false
} }
const getfocus = () => { const getfocus = () => {
if (isShow.value) { if (isShow.value) {
scan.value.getfocus() scan.value.getfocus()
} }
} }
const scanClick = () => { const scanClick = () => {
scan.value.handelScanMsg() scan.value.handelScanMsg()
} }
const cancelClick = () => { const cancelClick = () => {
scan.value.clearScanValue() scan.value.clearScanValue()
} }
const getScanResult = (result) => { const getScanResult = (result) => {
if (result.label.barType === 'BarCode') { if (result.label.barType === 'BarCode') {
code.value = result.label.code; code.value = result.label.code
}
callBack();
} }
const callBack = () => { callBack()
}
const callBack = () => {
scan.value.clear() scan.value.clear()
emit("getScanCode", code.value); emit('getScanCode', code.value)
} }
// //
const emit = defineEmits(['getScanCode']) const emit = defineEmits(['getScanCode'])
defineExpose({openScanPopup,closeScanPopup}) defineExpose({ openScanPopup, closeScanPopup })
</script> </script>
<style> <style></style>
</style>

2
src/mycomponents/scan/winScanContainer.vue

@ -9,7 +9,7 @@
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" headerType="HCQ" @getResult="getScanResult" :placeholder="title" :clearResult="false" :boxFocus="true" :isShowHistory="isShowHistory"> </win-com-scan> <win-com-scan ref="scan" headerType="HCQ" @getResult="getScanResult" :placeholder="title" :clearResult="true" :boxFocus="true" :isShowHistory="isShowHistory"> </win-com-scan>
</view> </view>
</view> </view>
</view> </view>

3
src/mycomponents/scan/winScanItem.vue

@ -10,7 +10,8 @@
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder="title" :clearResult="false" headerType="HMQ,HPQ"> </win-com-scan> <win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false"
headerType="HMQ,HPQ">
</view> </view>
</view> </view>
</view> </view>

86
src/mycomponents/scan/winScanJobNumber.vue

@ -1,21 +1,16 @@
<template> <template>
<view class=""> <view class="">
<u-popup v-model="isShow" mode='bottom'> <u-popup v-model="isShow" mode="bottom">
<view class="popup_box"> <view class="popup_box">
<view class="pop_title uni-flex space-between"> <view class="pop_title uni-flex space-between">
<view class=""> 扫描{{ title }} </view>
<view class=""> <view class="">
扫描{{title}} <image class="icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()"></image>
</view>
<view class="">
<image class=" icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view> </view>
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false" <win-com-scan ref="scan" @getResult="getScanResult" :placeholder="title" :clearResult="true" :isShowHistory="false" headerType=""> </win-com-scan>
:isShowHistory="false" headerType="">
</win-com-scan>
</view> </view>
</view> </view>
</view> </view>
@ -24,14 +19,12 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import { ref, getCurrentInstance } from 'vue'
ref, import winComScan from '@/mycomponents/scan/winComScan.vue'
getCurrentInstance
} from 'vue' const { proxy } = getCurrentInstance()
import winComScan from '@/mycomponents/scan/winComScan.vue' // defineOptions({ name: 'winScanJobNumber' })
const { proxy } = getCurrentInstance() const props = defineProps({
// defineOptions({ name: 'winScanJobNumber' })
const props = defineProps({
title: { title: {
type: String, type: String,
default: '' default: ''
@ -40,46 +33,45 @@
type: Boolean, type: Boolean,
default: true default: true
} }
}) })
const code = ref('') const code = ref('')
const isShow = ref(false) const isShow = ref(false)
const expand = ref(false) const expand = ref(false)
const scanList = ref([]) const scanList = ref([])
const expendIcon = ref('arrow-down') const expendIcon = ref('arrow-down')
const scan = ref() const scan = ref()
const openScanPopup = () => { const openScanPopup = () => {
setTimeout(res => { setTimeout((res) => {
isShow.value = true isShow.value = true
}, 500) }, 500)
} }
const closeScanPopup = () => { const closeScanPopup = () => {
isShow.value = false isShow.value = false
} }
const getfocus = () => { const getfocus = () => {
if (isShow.value) { if (isShow.value) {
scan.value.getfocus() scan.value.getfocus()
} }
} }
const scanClick = () => { const scanClick = () => {
scan.value.handelScanMsg() scan.value.handelScanMsg()
} }
const cancelClick = () => { const cancelClick = () => {
scan.value.clearScanValue() scan.value.clearScanValue()
} }
const getScanResult = (result) => { const getScanResult = (result) => {
if (result.label.barType === 'BarCode') { if (result.label.barType === 'BarCode') {
code.value = result.label.code; code.value = result.label.code
} }
callBack(); callBack()
} }
const callBack = () => { const callBack = () => {
scan.value.clear() scan.value.clear()
emit("getScanCode", code.value); emit('getScanCode', code.value)
} }
// //
const emit = defineEmits(['getScanCode']) const emit = defineEmits(['getScanCode'])
defineExpose({openScanPopup,closeScanPopup}) defineExpose({ openScanPopup, closeScanPopup })
</script> </script>
<style> <style></style>
</style>

25
src/pages.json

@ -63,11 +63,28 @@
{ {
"path": "pages/query/item", "path": "pages/query/item",
"style": { "style": {
"enablePullDownRefresh": false, // "enablePullDownRefresh": true, //
"navigationBarTitleText": "按物料查询库存", "navigationBarTitleText": "按物料查询库存",
"titleNView": { "titleNView": {
"autoBackButton": "true", // "autoBackButton": "true",
"buttons": [{}] "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"
}
]
} }
} }
}, },
@ -2094,7 +2111,7 @@
"navigationBarTitleText": "标签成品标签", "navigationBarTitleText": "标签成品标签",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ }, {
"path": "pages/material/materialDowngrade", "path": "pages/material/materialDowngrade",
"style": { "style": {
"navigationBarTitleText": "物料降级", "navigationBarTitleText": "物料降级",

8
src/pages/index/index.vue

@ -57,7 +57,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh, onHide, onUnload } from '@dcloudio/uni-app' import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh, onHide, onUnload } from '@dcloudio/uni-app'
import { getDictionaryItem, getPackageUnitList, getMainMessage, getSwitchByCode } from '@/api/request2.js' import { getDictionaryItem, getPackageUnitList, getMainMessage, getSwitchByCode, getBusinessType } from '@/api/request2.js'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -358,6 +358,12 @@ const getDictory = () => {
uni.setStorageSync('switch', res.data) uni.setStorageSync('switch', res.data)
}) })
.catch((error) => {}) .catch((error) => {})
//
getBusinessType()
.then((res) => {
uni.setStorageSync('businessType', res.data.list)
})
.catch((error) => {})
} }
const openCheck = (url) => { const openCheck = (url) => {

5
src/pages/query/coms/comItemBalance.vue

@ -1,11 +1,12 @@
<template> <template>
<view :class="dataContent.scaned ? 'scan_view' : ''" style="width: 100%"> <view :class="dataContent.scaned ? 'scan_view' : ''" style="width: 100%">
<view class="uni-flex uni-row space-between center"> <view class="uni-flex uni-row space-between" style="width: 100%">
<view> <view>
<view class="" v-if="dataContent.jobNumber" style="font-size: 32rpx; margin-left: 15rpx"> 任务号{{ dataContent.jobNumber }} </view>
<pack v-if="isShowPack" :packingCode="dataContent.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch" :batch="dataContent.batch"></batch>
<location v-if="isShowLocation" :locationCode="dataContent.locationCode"></location> <location v-if="isShowLocation" :locationCode="dataContent.locationCode"></location>
<bussinessType v-if="isShowBusiness" :bussinessType="dataContent.businessType" :number="dataContent.jobNumber"></bussinessType> <bussinessType v-if="isShowBusiness && dataContent.businessType" :bussinessType="dataContent.businessType"></bussinessType>
</view> </view>
<view> <view>
<qty v-if="dataContent.record == null || dataContent.record == undefined" :dataContent="dataContent" :isShowStdPack="isShowStdPack"></qty> <qty v-if="dataContent.record == null || dataContent.record == undefined" :dataContent="dataContent" :isShowStdPack="isShowStdPack"></qty>

59
src/pages/query/coms/comItemDetailCard.vue

@ -1,10 +1,24 @@
<template> <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>
<!-- <com-empty-view v-if="itemList.length == 0"></com-empty-view>s --> <pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
<view class="" style="background-color: #fff; width: 100%; padding: 10rpx 20rpx" v-for="(item, index) in itemList"> <pack v-if="dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<!-- <view class="flex uni-center u-col-center" style="flex-direction: row; "> --> <batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<view> <location :locationCode="dataContent.locationCode"></location>
<com-item-balance :dataContent="item" :isShowStdPack="false" :isShowPack="isShowPack" :isShowBatch="isShowBatch" :isShowLocation="isShowLocation" :isShowBusiness="isShowBusiness"> </com-item-balance> <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> </view>
</view> </view>
@ -12,25 +26,19 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
import { getBusinessTypeDesc } from '@/common/directory.js' import itemQty from '@/mycomponents/item/itemQty.vue'
import item from '@/mycomponents/item/item.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/location/location.vue' import batch from '@/mycomponents/balance/batch.vue'
import comItemBalance from '@/pages/query/coms/comItemBalance.vue' import qty from '@/mycomponents/qty/qty.vue'
import bussinessType from '@/mycomponents/balance/bussinessType.vue' import status from '@/mycomponents/status/status.vue'
import location from '@/mycomponents/balance/location.vue'
import { getBusinessTypeName } from '@/common/directory.js'
const props = defineProps({ const props = defineProps({
itemList: { dataContent: {
type: Array, type: Object,
value: null default: null
},
displayLocations: {
type: Boolean,
default: true
},
type: {
type: String,
default: 'partCode'
}, },
isShowPack: { isShowPack: {
type: Boolean, type: Boolean,
@ -44,11 +52,14 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowBusiness: { isShowStdPack: {
type: Boolean, type: Boolean,
default: false default: true
} }
}) })
const businessTypeDesc = (type) => {
return getBusinessTypeName(type)
}
</script> </script>
<style></style> <style></style>

6
src/pages/query/coms/comLocationDetailCard.vue

@ -16,7 +16,7 @@
</view> </view>
<view class="" v-if="dataContent.businessType" style="font-size: 30rpx; padding-left: 10rpx; padding-bottom: 10rpx"> <view class="" v-if="dataContent.businessType" style="font-size: 30rpx; padding-left: 10rpx; padding-bottom: 10rpx">
<text style="color: green">业务类型</text> <text style="color: green">业务类型</text>
{{ dataContent.businessType }} {{ businessTypeDesc(dataContent.businessType) }}
</view> </view>
</view> </view>
<view class="uni-flex" style="flex-direction: column"> <view class="uni-flex" style="flex-direction: column">
@ -35,6 +35,7 @@ import pack from '@/mycomponents/balance/pack.vue'
import batch from '@/mycomponents/balance/batch.vue' import batch from '@/mycomponents/balance/batch.vue'
import qty from '@/mycomponents/qty/qty.vue' import qty from '@/mycomponents/qty/qty.vue'
import status from '@/mycomponents/status/status.vue' import status from '@/mycomponents/status/status.vue'
import { getBusinessTypeName } from '@/common/directory.js'
const props = defineProps({ const props = defineProps({
dataContent: { dataContent: {
@ -58,6 +59,9 @@ const props = defineProps({
default: true default: true
} }
}) })
const businessTypeDesc = (type) => {
return getBusinessTypeName(type)
}
</script> </script>
<style></style> <style></style>

544
src/pages/query/item.vue

@ -1,24 +1,25 @@
<!-- 基于z-paging封装个性化分页组件演示(vue) --> <!-- 基于z-paging封装个性化分页组件演示(vue) -->
<template> <template>
<view class=""> <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="itemCode == ''"></com-blank-view> <com-blank-view @goScan="openScanPopup" v-if="itemCode == ''"></com-blank-view>
<!-- 这里就很整洁了只要设置ref绑定query事件绑定list就可以了 --> <item-info v-if="itemDetail" :itemdetail="itemDetail"></item-info>
<my-paging v-show="itemCode != ''" ref="paging" v-model="dataList" @query="queryList"> <z-tabs v-if="itemCode" :list="tabList" @change="tabChange" />
<!-- 需要固定在顶部不滚动的view放在slot="top"的view中如果需要跟着滚动则不要设置slot="top" -->
<template #top>
<view v-if="itemDetail != undefined">
<item-info :itemdetail="itemDetail"></item-info>
<view class="split_line"></view>
<z-tabs :list="tabList" @change="tabChange" />
</view> </view>
</template>
<view class="" style="padding-bottom: 50rpx"> <view style="padding-top: 230rpx; width: 100%">
<comItemDetailCard v-if="tabIndex == 0" :itemList="dataList" :isShowPack="false" style="margin: 20rpx"> </comItemDetailCard> <view v-if="totalCount > 0" style="margin: 10rpx; font-size: 35rpx; font-weight: bold">总数 : {{ totalCount }}
<comItemDetailCard v-if="tabIndex == 1" :itemList="dataList" style="margin: 20rpx"> </comItemDetailCard> </view>
<comItemDetailCard v-if="tabIndex == 2" :itemList="dataList" :isShowLocation="false" :isShowBusiness="true" style="margin: 20rpx"></comItemDetailCard> <view v-for="(item, index) in dataList" style="width: 100%" :key="index">
<comItemDetailCard v-if="tabIndex == 3" :itemList="dataList" :isShowLocation="false" :isShowBusiness="true" style="margin: 20rpx"> </comItemDetailCard> <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>
</view>
</view>
<uni-load-more :status="loadingType" v-if="dataList.length > 0" />
</view> </view>
</my-paging>
<win-scan-button @goScan="openScanPopup" v-if="itemCode != ''"></win-scan-button> <win-scan-button @goScan="openScanPopup" v-if="itemCode != ''"></win-scan-button>
<win-scan-item ref="scanPopup" title="物料代码" @getScanResult="getScanCode"> </win-scan-item> <win-scan-item ref="scanPopup" title="物料代码" @getScanResult="getScanCode"> </win-scan-item>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
@ -26,50 +27,72 @@
</template> </template>
<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 } 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'
import winScanItem from '@/mycomponents/scan/winScanItem.vue' import winScanItem from '@/mycomponents/scan/winScanItem.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comItemDetailCard from '@/pages/query/coms/comItemDetailCard.vue' import comItemDetailCard from '@/pages/query/coms/comItemDetailCard.vue'
import itemFilter from '@/mycomponents/item/itemFilter.vue'
const { proxy } = getCurrentInstance() import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
const dataList = ref([]) const { proxy } = getCurrentInstance()
const tabList = ref(['汇总', '明细', '预计入', '预计出'])
const tabIndex = ref(0) const dataList = ref([])
const itemDetail = ref(undefined) const tabList = ref(['汇总', '明细', '预计入', '预计出'])
const itemCode = ref('') const tabIndex = ref(0)
const balances = ref([]) const itemDetail = ref(undefined)
const scanPopup = ref() const itemCode = ref('')
const paging = ref() const balances = ref([])
const comMessageRef = ref() const loadingType = ref('nomore')
onNavigationBarButtonTap((e) => { const totalCount = ref(0)
const locationCode = ref('')
const inventoryStatus = ref('')
const pageSize = ref(10)
const pageNo = ref(1)
const scanPopup = ref()
const paging = ref()
const comMessageRef = ref()
const filter = ref()
onNavigationBarButtonTap((e) => {
if (e.index === 0) { if (e.index === 0) {
goHome() goHome()
} else if (e.index == 1) {
filter.value.openFilter()
} }
}) })
onMounted(() => { onMounted(() => {
openScanPopup() openScanPopup()
}) })
const openScanPopup = (val) => { onReachBottom(() => {
console.log('底部')
//
if (loadingType.value == 'loading' || loadingType.value == 'nomore') {
return
}
getContentByTab(tabIndex.value, pageNo.value, pageSize.value, 'more')
})
onPullDownRefresh(() => {
getContentByTab(tabIndex.value, pageNo.value, pageSize.value, 'refresh')
})
const openScanPopup = (val) => {
scanPopup.value.openScanPopup() scanPopup.value.openScanPopup()
} }
const closeScanPopup = () => { const closeScanPopup = () => {
scanPopup.value.closeScanPopup() scanPopup.value.closeScanPopup()
} }
const getScanCode = (code) => { const getScanCode = (code) => {
if (code == '') { if (code == '') {
showMessage('物料号不能为空') showMessage('物料号不能为空')
return return
} }
itemCode.value = '' itemCode.value = ''
getItemInfo(code) getItemInfo(code)
} }
const getItemInfo = (code) => { const getItemInfo = (code) => {
proxy.$modal.loading('正在查询物料信息­....') proxy.$modal.loading('正在查询物料信息­....')
getBasicItemByCode(code) getBasicItemByCode(code)
@ -89,182 +112,311 @@ const getItemInfo = (code) => {
itemCode.value = '' itemCode.value = ''
showMessage(error) showMessage(error)
}) })
} }
// const getSummary = (pageNo, pageSize, type) => {
const getSummary = (pageNo, pageSize) => { uni.showLoading({
proxy.$modal.loading('加载中­....') title: "加载中...",
const params = { mask: true
itemCode: itemCode.value, });
pageNo, loadingType.value = "loading";
pageSize if (type === "refresh") {
pageNo.value = 1;
dataList.value = [];
} }
getBalanceSummary(params)
.then((res) => { var filters = [];
uni.hideLoading() filters.push({
if (res.data.list.length > 0) { column: "itemCode",
paging.value.complete(res.data.list) action: "==",
} else { value: itemCode.value
paging.value.complete(false) })
showMessage(`未查找到物料【${itemCode.value}`) if (locationCode.value) {
filters.push({
column: "locationCode",
action: "==",
value: locationCode.value
})
} }
if (inventoryStatus.value) {
filters.push({
column: "inventoryStatus",
action: "in",
value: inventoryStatus.value
}) })
.catch((error) => { }
paging.value.complete(false)
uni.hideLoading() var params = {
showMessage(error) filters: filters,
pageNo: pageNo.value,
pageSize: pageSize
}
getBalanceByItemCode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
totalCount.value = res.data.total
loadingType.value = "loadmore";
if (list == null || list.length == 0) {
loadingType.value = "nomore";
return;
}
list.forEach(item => {
item.packingNumber = ""
})
dataList.value = type === "refresh" ? list : dataList.value..valueconcat(list);
pageNo.value++;
}).catch(error => {
paging.value.complete(false);
uni.hideLoading();
showMessage(error);
})
}
//
const getDetailList = (pageNo, pageSize, type) => {
uni.showLoading({
title: "加载中...",
mask: true
});
loadingType.value = "loading";
if (type === "refresh") {
pageNo.value = 1;
dataList.value = [];
}
var filters = [];
filters.push({
column: "itemCode",
action: "==",
value: itemCode.value
})
if (locationCode.value) {
filters.push({
column: "locationCode",
action: "==",
value: locationCode.value
}) })
}
//
const getDetailList = (pageNo, pageSize) => {
proxy.$modal.loading('加载中­....')
const params = {
itemCode: itemCode.value,
pageNo,
pageSize
}
getBalanceByItemCode(params)
.then((res) => {
uni.hideLoading()
if (res.data.list.length > 0) {
paging.value.complete(res.data.list)
} else {
paging.value.complete(false)
showMessage(`未查找到物料【${itemCode.value}`)
} }
if (inventoryStatus.value) {
filters.push({
column: "inventoryStatus",
action: "in",
value: inventoryStatus.value
}) })
.catch((error) => { }
paging.value.complete(false)
uni.hideLoading() var params = {
showMessage(error) filters: filters,
pageNo: pageNo.value,
pageSize: pageSize
}
getBalanceByItemCode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
totalCount.value = res.data.total
loadingType.value = "loadmore";
if (list == null || list.length == 0) {
loadingType.value = "nomore";
return;
}
dataList.value = type === "refresh" ? list : dataList.value.concat(list);
pageNo.value++;
}).catch(error => {
uni.hideLoading();
showMessage(error);
}) })
}
const ontabtap = (e) => { }
const index = e.target.dataset.current || e.currentTarget.dataset.current
tabIndex.value = index const getContentByTab = (index, pageNo, pageSize, type) => {
getContentByTab(index) if (index === 0) getSummary(pageNo, pageSize, type);
} else if (index === 1) getDetailList(pageNo, pageSize, type);
const getContentByTab = (index, pageNo, pageSize) => {
if (index === 0) getSummary(pageNo, pageSize)
else if (index === 1) getDetailList(pageNo, pageSize)
else if (index === 2) { else if (index === 2) {
getExpectin(pageNo, pageSize) getExpectin(pageNo, pageSize, type);
} else if (index == 3) { } else if (index == 3) {
getExpectout(pageNo, pageSize) getExpectout(pageNo, pageSize, type);
} }
}
//
const getExpectin = (pageNo, pageSize) => {
proxy.$modal.loading('加载中­....')
const params = {
itemCode: itemCode.value,
pageNo,
pageSize
}
getExpectinByItemcode(params)
.then((res) => {
uni.hideLoading()
if (res.data.total > 0) {
paging.value.complete(res.data.list)
} else {
paging.value.complete(false)
showMessage(`未查找到物料【${itemCode.value}`)
} }
//
const getExpectin = (pageNo, pageSize, type) {
uni.showLoading({
title: "加载中...",
mask: true
});
loadingType.value = "loading";
if (type === "refresh") {
pageNo.value = 1;
dataList.value = [];
}
var filters = [];
filters.push({
column: "itemCode",
action: "==",
value: itemCode.value
}) })
.catch((error) => { if (locationCode.value) {
paging.value.complete(false) filters.push({
uni.hideLoading() column: "locationCode",
showMessage(error) action: "==",
value: locationCode.value
}) })
} }
// if (inventoryStatus.value) {
const getExpectout = (pageNo, pageSize) => { filters.push({
proxy.$modal.loading('加载中­....') column: "inventoryStatus",
const params = { action: "in",
itemCode: itemCode.value, value: inventoryStatus.value
pageNo, })
pageSize
} }
getExpectoutByItemcode(params)
.then((res) => { var params = {
uni.hideLoading() filters: filters,
console.log(res) pageNo: pageNo.value,
if (res.data.total > 0) { pageSize: pageSize
paging.value.complete(res.data.list) }
} else { getExpectinByItemcode(params).then(res => {
paging.value.complete(false) uni.hideLoading();
showMessage(`未查找到物料【${itemCode.value}`)
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
totalCount.value = res.data.total
loadingType.value = "loadmore";
if (list == null || list.length == 0) {
loadingType.value = "nomore";
return;
} }
dataList.value = type === "refresh" ? list : dataList.value.concat(list);
pageNo.value++;
}).catch(error => {
uni.hideLoading();
showMessage(error);
}) })
.catch((error) => {
paging.value.complete(false) }
uni.hideLoading()
showMessage(error) //
const getExpectout = (pageNo, pageSize, type) => {
uni.showLoading({
title: "加载中...",
mask: true
});
loadingType.value = "loading";
if (type === "refresh") {
pageNo.value = 1;
dataList.value = [];
}
var filters = [];
filters.push({
column: "itemCode",
action: "==",
value: itemCode.value
}) })
} if (locationCode.value) {
filters.push({
column: "locationCode",
action: "==",
value: locationCode.value
})
}
const showMessage = (message) => { if (inventoryStatus.value) {
comMessageRef.value.showErrorMessage(message, (res) => { filters.push({
if (res) { column: "inventoryStatus",
afterCloseMessage() action: "in",
value: inventoryStatus.value
})
}
var params = {
filters: filters,
pageNo: pageNo.value,
pageSize: pageSize
} }
getExpectoutByItemcode(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
totalCount.value = res.data.total
loadingType.value = "loadmore";
if (list == null || list.length == 0) {
loadingType.value = "nomore";
return;
}
dataList.value = type === "refresh" ? list : dataList.value.concat(list);
pageNo.value++;
}).catch(error => {
uni.hideLoading();
showMessage(error);
}) })
}
const afterCloseMessage = () => { }
const showMessage = (message) => {
comMessageRef.value.showErrorMessage(message, res => {
if (res) {
afterCloseMessage()
}
});
}
const afterCloseMessage = () => {
if (scanPopup.value != undefined) { if (scanPopup.value != undefined) {
scanPopup.value.getfocus() scanPopup.value.getfocus();
}
} }
} const tabChange = (index) => {
const tabChange = (index) => { tabIndex.value = index;
console.log(index) getContentByTab(index, pageNo.value, pageSize.value, "refresh")
tabIndex.value = index
paging.value.reload(true)
}
const queryList = (pageNo, pageSize) => {
if (itemCode.value != '') {
getContentByTab(tabIndex.value, pageNo, pageSize)
} }
}
const itemClick = (item) => {} const confirm = (locationCodeParams, status) => {
locationCode.value = locationCodeParams;
if (status.length > 0) {
var arrayItems = status.join(',')
inventoryStatus.value = arrayItems
} else {
inventoryStatus.value = ""
}
tabChange(tabIndex.value)
}
</script> </script>
<style> <style>
.notice { page {
background-color: red; height: 100%;
color: white; }
display: flex; .top{
flex-direction: column;
padding: 12rpx 20rpx;
font-size: 24rpx;
}
.item {
position: relative;
height: 150rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0rpx 30rpx;
}
.item-detail {
padding: 5rpx 15rpx;
border-radius: 10rpx;
font-size: 28rpx;
color: white;
background-color: #007aff;
}
.item-line {
position: absolute;
bottom: 0rpx;
left: 0rpx;
height: 1px;
width: 100%; width: 100%;
background-color: #eeeeee; position: fixed;
} /* #ifdef APP */
top: 0rpx;
/* #endif */
/* #ifdef H5 */
top: 80rpx;
/* #endif */
right: 0;
</style> </style>
Loading…
Cancel
Save