Browse Source

组件扫码

hella_vue3
zhang_li 3 months ago
parent
commit
33a59d5e26
  1. 14
      src/mycomponents/package/packageCard.vue
  2. 3
      src/mycomponents/scan/winComScan.vue
  3. 11
      src/mycomponents/scan/winScanPack.vue
  4. 26
      src/mycomponents/scan/winScanPackAndLocation.vue
  5. 3
      src/pages/productReceipt/job/productReceiptDetail.vue
  6. 20
      src/pages/purchaseReceipt/job/receiptDetail.vue
  7. 37
      src/pages/putaway/job/putawayDetail.vue
  8. 2
      src/pages/putaway/job/putawayJob.vue

14
src/mycomponents/package/packageCard.vue

@ -70,6 +70,20 @@ const props = defineProps({
default: '库位' default: '库位'
} }
}) })
watch(
() => props.dataContent,
(newVal, oldVal) => {
if (newVal.scaned) {
newVal.copyContent = `HPQ;V1.0;I${newVal.itemCode};P${newVal.packingNumber};B${newVal.batch};Q${newVal.qty}`
} else {
newVal.copyContent = ''
}
},
{
immediate: true,
deep: true
}
)
const copy = () => { const copy = () => {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 // HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
const content = `HPQ;V1.0;I${props.dataContent.itemCode};P${props.dataContent.packingNumber};B${props.dataContent.batch};Q${props.dataContent.qty}` const content = `HPQ;V1.0;I${props.dataContent.itemCode};P${props.dataContent.packingNumber};B${props.dataContent.batch};Q${props.dataContent.qty}`

3
src/mycomponents/scan/winComScan.vue

@ -102,6 +102,9 @@ watch(
placeholderValue.value = `请扫描${val}` placeholderValue.value = `请扫描${val}`
} }
) )
const setItemCodeSimulate = () => {
scanMsg.value = scanMsg
}
const hide = () => { const hide = () => {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// //

11
src/mycomponents/scan/winScanPack.vue

@ -16,6 +16,8 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
<com-message ref="comMessageRef" @afterClose="getfocus" /> <com-message ref="comMessageRef" @afterClose="getfocus" />
</view> </view>
</template> </template>
@ -41,6 +43,12 @@ const props = defineProps({
const show = ref(false) const show = ref(false)
const comMessageRef = ref() const comMessageRef = ref()
const comscan = ref() const comscan = ref()
const comscansimulate = ref()
//
const simulateScan = (item) => {
comscansimulate.value.setItemCodeSimulate(item.itemCode, item.copyContent)
comscansimulate.value.clickScanMsg()
}
const openScanPopup = () => { const openScanPopup = () => {
setTimeout((res) => { setTimeout((res) => {
show.value = true show.value = true
@ -88,7 +96,8 @@ defineExpose({
openScanPopup, openScanPopup,
closeScanPopup, closeScanPopup,
getfocus, getfocus,
losefocus losefocus,
simulateScan
}) })
</script> </script>

26
src/mycomponents/scan/winScanPackAndLocation.vue

@ -34,6 +34,8 @@
</view> </view>
</u-popup> </u-popup>
<balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select> <balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
</view> </view>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
</template> </template>
@ -141,6 +143,30 @@ const openScanPopupForJob = (fromLocationCodePrams, fromLocationListPrams, jobCo
inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态 inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态
fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) // fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) //
} }
//
const openScanPopupForJobSimulate = (fromLocationCodeParams, fromLocationListParams, jobContent, item) => {
fromLocationCode.value = fromLocationCodeParams
fromLocationList.value = fromLocationListParams
if (fromLocationListParams != '') {
// this.packGetFocus();
if (comscansimulate.value != undefined) {
comscansimulate.value.getfocus()
}
} else if (fromLocationList.value.length == 0) {
// this.locationGetFocus();
alert('没有来源库位:List')
} else {
fromLocationCode.value = fromLocationList.value[0]
}
fromInventoryStatuses.value = getDirectoryItemArray(jobContent.outInventoryStatuses)
inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态
fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) //
const timer = setTimeout((res) => {
if (timer) {
clearTimeout(timer)
}
}, 500)
}
const closeScanPopup = (content) => { const closeScanPopup = (content) => {
show.value = false show.value = false
emit('close', '') emit('close', '')

3
src/pages/productReceipt/job/productReceiptDetail.vue

@ -180,7 +180,8 @@ const getDetail = () => {
r.subList.forEach((s) => { r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true s.scaned = true
s.handleQty = s.qty scanPopup.value.simulateScan(s)
// s.handleQty = s.qty
} }
}) })
}) })

20
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -97,7 +97,7 @@ const comReceiptDetailCardRef = ref()
const count = ref(0) const count = ref(0)
onLoad((option) => { onLoad((option) => {
id.value = option.id id.value = option.id
// scanedPackingNumber.value = option.scaned || '' scanedPackingNumber.value = option.scaned || ''
operation.value = option.operation operation.value = option.operation
if (id.value != undefined) { if (id.value != undefined) {
// //
@ -168,14 +168,19 @@ const getDetail = () => {
jobStatus.value = res.data.status jobStatus.value = res.data.status
jobToLocationCode.value = subList.value[0].toLocationCode jobToLocationCode.value = subList.value[0].toLocationCode
detailSource.value = getTreeDataSource(subList.value) detailSource.value = getTreeDataSource(subList.value)
detailSource.value.forEach((r) => { isAllReceived.value = false
r.subList.forEach((s) => { nextTick(() => {
s.scaned = false detailSource.value.forEach((r) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) s.scaned = true r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true
scanPopup.value.simulateScan(s)
}
})
}) })
count.value++
isAllReceived.value = false
}) })
count.value++
isAllReceived.value = false
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -406,7 +411,6 @@ const submitJob = () => {
pageSize: 1000 pageSize: 1000
}).then((res1) => { }).then((res1) => {
timerCount += 1 timerCount += 1
console.log(11111)
if (res1.data && res1.data.list && res1.data.list.length && res1.data.total >= res.data.detailCount) { if (res1.data && res1.data.list && res1.data.list.length && res1.data.total >= res.data.detailCount) {
uni.hideLoading() uni.hideLoading()
clearInterval(timer1) clearInterval(timer1)

37
src/pages/putaway/job/putawayDetail.vue

@ -146,13 +146,6 @@ const getDetail = () => {
subList.value = res.data.subList subList.value = res.data.subList
detailSource.value = getTreeDataSource(subList.value) detailSource.value = getTreeDataSource(subList.value)
detailSource.value.forEach((r) => {
r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) s.scaned = true
s.inventoryStatus = s.inspectResult //
})
})
fromLocationCode.value = subList.value[0].fromLocationCode fromLocationCode.value = subList.value[0].fromLocationCode
jobToLocationCode.value = subList.value[0].toLocationCode jobToLocationCode.value = subList.value[0].toLocationCode
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
@ -162,6 +155,16 @@ const getDetail = () => {
} else { } else {
toLocationCode.value = jobToLocationCode.value toLocationCode.value = jobToLocationCode.value
} }
detailSource.value.forEach((r) => {
r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true
s.packList.forEach((item) => (item.scaned = true))
s.inventoryStatus = s.inspectResult //
openScanPopupSimulate(s)
}
})
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -200,6 +203,26 @@ const continueScan = () => {
const updateData = () => { const updateData = () => {
calcTreeHandleQty(detailSource.value) calcTreeHandleQty(detailSource.value)
} }
//
const openScanPopupSimulate = (item) => {
let fromlocationCode = ''
const fromlocationList = []
for (let i = 0; i < detailSource.value.length; i++) {
const item = detailSource.value[i]
item.subList.forEach((l) => {
//
const location = fromlocationList.find((res) => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode)
}
//
if (fromlocationCode == '') {
fromlocationCode = l.fromLocationCode
}
})
}
scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, item)
}
const openScanPopup = () => { const openScanPopup = () => {
let fromlocationCode = '' let fromlocationCode = ''
const fromlocationList = [] const fromlocationList = []

2
src/pages/putaway/job/putawayJob.vue

@ -256,7 +256,7 @@ const openScanPopup = () => {
const selectItem = (item) => { const selectItem = (item) => {
scanPopup.value.closeScanPopup() scanPopup.value.closeScanPopup()
uni.navigateTo({ uni.navigateTo({
url: `./putawayDetail?id=${item.masterId}&status=${item.status}` url: `./putawayDetail?id=${item.masterId}&status=${item.status}&scaned=${item.packingNumber}`
}) })
} }

Loading…
Cancel
Save